Skip to content

Commit

Permalink
vim-patch:60cce2f
Browse files Browse the repository at this point in the history
Update runtime files.

vim/vim@60cce2f
  • Loading branch information
dbarnett committed Apr 19, 2016
1 parent 0ba12c6 commit 43fe335
Show file tree
Hide file tree
Showing 16 changed files with 403 additions and 88 deletions.
4 changes: 2 additions & 2 deletions runtime/autoload/tohtml.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
" Vim autoload file for the tohtml plugin.
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
" Last Change: 2013 Jun 19
" Last Change: 2013 Sep 03
"
" Additional contributors:
"
Expand Down Expand Up @@ -302,7 +302,7 @@ func! tohtml#Convert2HTML(line1, line2) "{{{
else "{{{
let win_list = []
let buf_list = []
windo | if &diff | call add(win_list, winbufnr(0)) | endif
windo if &diff | call add(win_list, winbufnr(0)) | endif
let s:settings.whole_filler = 1
let g:html_diff_win_num = 0
for window in win_list
Expand Down
43 changes: 30 additions & 13 deletions runtime/doc/syntax.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.4. Last change: 2015 Aug 13
*syntax.txt* For Vim version 7.4. Last change: 2015 Sep 29


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -417,18 +417,19 @@ and last line to be converted. Example, using the last set Visual area: >
*:TOhtml*
:[range]TOhtml The ":TOhtml" command is defined in a standard plugin.
This command will source |2html.vim| for you. When a
range is given, set |g:html_start_line| and
|g:html_end_line| to the start and end of the range,
respectively. Default range is the entire buffer.

If the current window is part of a |diff|, unless
|g:html_diff_one_file| is set, :TOhtml will convert
all windows which are part of the diff in the current
tab and place them side-by-side in a <table> element
in the generated HTML. With |g:html_line_ids| you can
jump to lines in specific windows with (for example)
#W1L42 for line 42 in the first diffed window, or
#W3L87 for line 87 in the third.
range is given, this command sets |g:html_start_line|
and |g:html_end_line| to the start and end of the
range, respectively. Default range is the entire
buffer.

If the current window is part of a |diff|, unless
|g:html_diff_one_file| is set, :TOhtml will convert
all windows which are part of the diff in the current
tab and place them side-by-side in a <table> element
in the generated HTML. With |g:html_line_ids| you can
jump to lines in specific windows with (for example)
#W1L42 for line 42 in the first diffed window, or
#W3L87 for line 87 in the third.

Examples: >
Expand Down Expand Up @@ -742,6 +743,22 @@ and UTF-32 instead, use: >
Note that documents encoded in either UTF-32 or UTF-16 have known
compatibility problems with some major browsers.

*g:html_font*
Default: "monospace"
You can specify the font or fonts used in the converted document using
g:html_font. If this option is set to a string, then the value will be
surrounded with single quotes. If this option is set to a list then each list
item is surrounded by single quotes and the list is joined with commas. Either
way, "monospace" is added as the fallback generic family name and the entire
result used as the font family (using CSS) or font face (if not using CSS).
Examples: >
" font-family: 'Consolas', monospace;
:let g:html_font = "Consolas"
" font-family: 'DejaVu Sans Mono', 'Consolas', monospace;
:let g:html_font = ["DejaVu Sans Mono", "Consolas"]
<
*convert-to-XML* *convert-to-XHTML* *g:html_use_xhtml*
Default: 0.
When 0, generate standard HTML 4.01 (strict when possible).
Expand Down
8 changes: 7 additions & 1 deletion runtime/filetype.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2015 Sep 22
" Last Change: 2015 Oct 13

" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
Expand Down Expand Up @@ -304,6 +304,9 @@ au BufNewFile,BufRead *.bl setf blank
" Blkid cache file
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml

" Bazel (http://bazel.io)
autocmd BufRead,BufNewFile *.bzl,BUILD,WORKSPACE setfiletype bzl

" C or lpc
au BufNewFile,BufRead *.c call s:FTlpc()

Expand Down Expand Up @@ -2119,6 +2122,9 @@ au BufNewFile,BufRead *.cm setf voscm
" Sysctl
au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf setf sysctl

" Systemd unit files
au BufNewFile,BufRead */systemd/*.{automount,mount,path,service,socket,swap,target,timer} setf systemd

" Synopsys Design Constraints
au BufNewFile,BufRead *.sdc setf sdc

Expand Down
94 changes: 94 additions & 0 deletions runtime/ftplugin/bzl.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
" Vim filetype plugin file
" Language: Bazel (http://bazel.io)
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
" Last Change: 2015 Aug 11

""
" @section Introduction, intro
" Core settings for the bzl filetype, used for BUILD and *.bzl files for the
" Bazel build system (http://bazel.io/).

if exists('b:did_ftplugin')
finish
endif


" Vim 7.4.051 has opinionated settings in ftplugin/python.vim that try to force
" PEP8 conventions on every python file, but these conflict with Google's
" indentation guidelines. As a workaround, we explicitly source the system
" ftplugin, but save indentation settings beforehand and restore them after.
let s:save_expandtab = &l:expandtab
let s:save_shiftwidth = &l:shiftwidth
let s:save_softtabstop = &l:softtabstop
let s:save_tabstop = &l:tabstop

" NOTE: Vim versions before 7.3.511 had a ftplugin/python.vim that was broken
" for compatible mode.
let s:save_cpo = &cpo
set cpo&vim

" Load base python ftplugin (also defines b:did_ftplugin).
source $VIMRUNTIME/ftplugin/python.vim

" NOTE: Vim versions before 7.4.104 and later set this in ftplugin/python.vim.
setlocal comments=b:#,fb:-

" Restore pre-existing indentation settings.
let &l:expandtab = s:save_expandtab
let &l:shiftwidth = s:save_shiftwidth
let &l:softtabstop = s:save_softtabstop
let &l:tabstop = s:save_tabstop

setlocal formatoptions-=t

" Make gf work with imports in BUILD files.
setlocal includeexpr=substitute(v:fname,'//','','')

" Enable syntax-based folding, if specified.
if get(g:, 'ft_bzl_fold', 0)
setlocal foldmethod=syntax
setlocal foldtext=BzlFoldText()
endif

if exists('*BzlFoldText')
finish
endif

function BzlFoldText() abort
let l:start_num = nextnonblank(v:foldstart)
let l:end_num = prevnonblank(v:foldend)

if l:end_num <= l:start_num + 1
" If the fold is empty, don't print anything for the contents.
let l:content = ''
else
" Otherwise look for something matching the content regex.
" And if nothing matches, print an ellipsis.
let l:content = '...'
for l:line in getline(l:start_num + 1, l:end_num - 1)
let l:content_match = matchstr(l:line, '\m\C^\s*name = \zs.*\ze,$')
if !empty(l:content_match)
let l:content = l:content_match
break
endif
endfor
endif

" Enclose content with start and end
let l:start_text = getline(l:start_num)
let l:end_text = substitute(getline(l:end_num), '^\s*', '', '')
let l:text = l:start_text . ' ' . l:content . ' ' . l:end_text

" Compute the available width for the displayed text.
let l:width = winwidth(0) - &foldcolumn - (&number ? &numberwidth : 0)
let l:lines_folded = ' ' . string(1 + v:foldend - v:foldstart) . ' lines'

" Expand tabs, truncate, pad, and concatenate
let l:text = substitute(l:text, '\t', repeat(' ', &tabstop), 'g')
let l:text = strpart(l:text, 0, l:width - len(l:lines_folded))
let l:padding = repeat(' ', l:width - len(l:lines_folded) - len(l:text))
return l:text . l:padding . l:lines_folded
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo
13 changes: 10 additions & 3 deletions runtime/ftplugin/j.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
" Language: J
" Maintainer: David Bürgin <676c7473@gmail.com>
" URL: https://github.com/glts/vim-j
" Last Change: 2015-03-27
" Last Change: 2015-09-27

if exists('b:did_ftplugin')
finish
Expand All @@ -12,13 +12,20 @@ let b:did_ftplugin = 1
let s:save_cpo = &cpo
set cpo&vim

setlocal iskeyword=48-57,A-Z,_,a-z
setlocal iskeyword=48-57,A-Z,a-z,_
setlocal comments=:NB.
setlocal commentstring=NB.\ %s
setlocal formatoptions-=t
setlocal matchpairs=(:)
setlocal path-=/usr/include

let b:undo_ftplugin = 'setlocal matchpairs< formatoptions< commentstring< comments< iskeyword<'
" Includes. To make the shorthand form "require 'web/cgi'" work, double the
" last path component. Also strip off leading folder names like "~addons/".
setlocal include=\\v^\\s*(load\|require)\\s*'\\zs\\f+\\ze'
setlocal includeexpr=substitute(substitute(tr(v:fname,'\\','/'),'\\v^[^~][^/.]*(/[^/.]+)$','&\\1',''),'\\v^\\~[^/]+/','','')
setlocal suffixesadd=.ijs

let b:undo_ftplugin = 'setlocal matchpairs< formatoptions< commentstring< comments< iskeyword< path< include< includeexpr< suffixesadd<'

" Section movement with ]] ][ [[ []. The start/end patterns below are amended
" inside the function in order to avoid matching on the current cursor line.
Expand Down
7 changes: 7 additions & 0 deletions runtime/ftplugin/systemd.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
" Vim filetype plugin file
" Language: systemd.unit(5)

if !exists('b:did_ftplugin')
" Looks a lot like dosini files.
runtime! ftplugin/dosini.vim
endif
97 changes: 97 additions & 0 deletions runtime/indent/bzl.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
" Vim indent file
" Language: Bazel (http://bazel.io)
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
" Last Change: 2015 Aug 11

if exists('b:did_indent')
finish
endif

" Load base python indent.
if !exists('*GetPythonIndent')
runtime! indent/python.vim
endif

let b:did_indent = 1

" Only enable bzl google indent if python google indent is enabled.
if !get(g:, 'no_google_python_indent')
setlocal indentexpr=GetBzlIndent(v:lnum)
endif

if exists('*GetBzlIndent')
finish
endif

let s:save_cpo = &cpo
set cpo-=C

" Maximum number of lines to look backwards.
let s:maxoff = 50

""
" Determine the correct indent level given an {lnum} in the current buffer.
function GetBzlIndent(lnum) abort
let l:use_recursive_indent = !get(g:, 'no_google_python_recursive_indent')
if l:use_recursive_indent
" Backup and override indent setting variables.
if exists('g:pyindent_nested_paren')
let l:pyindent_nested_paren = g:pyindent_nested_paren
endif
if exists('g:pyindent_open_paren')
let l:pyindent_open_paren = g:pyindent_open_paren
endif
" Vim 7.3.693 and later defines a shiftwidth() function to get the effective
" shiftwidth value. Fall back to &shiftwidth if the function doesn't exist.
let l:sw_expr = exists('*shiftwidth') ? 'shiftwidth()' : '&shiftwidth'
let g:pyindent_nested_paren = l:sw_expr . ' * 2'
let g:pyindent_open_paren = l:sw_expr . ' * 2'
endif

let l:indent = -1

" Indent inside parens.
" Align with the open paren unless it is at the end of the line.
" E.g.
" open_paren_not_at_EOL(100,
" (200,
" 300),
" 400)
" open_paren_at_EOL(
" 100, 200, 300, 400)
call cursor(a:lnum, 1)
let [l:par_line, l:par_col] = searchpairpos('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" .
\ " synIDattr(synID(line('.'), col('.'), 1), 'name')" .
\ " =~ '\\(Comment\\|String\\)$'")
if l:par_line > 0
call cursor(l:par_line, 1)
if l:par_col != col('$') - 1
let l:indent = l:par_col
endif
endif

" Delegate the rest to the original function.
if l:indent == -1
let l:indent = GetPythonIndent(a:lnum)
endif

if l:use_recursive_indent
" Restore global variables.
if exists('l:pyindent_nested_paren')
let g:pyindent_nested_paren = l:pyindent_nested_paren
else
unlet g:pyindent_nested_paren
endif
if exists('l:pyindent_open_paren')
let g:pyindent_open_paren = l:pyindent_open_paren
else
unlet g:pyindent_open_paren
endif
endif

return l:indent
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo
10 changes: 10 additions & 0 deletions runtime/indent/systemd.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
" Vim indent file
" Language: systemd.unit(5)

" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif

" Looks a lot like dosini files.
runtime! indent/dosini.vim
Loading

0 comments on commit 43fe335

Please sign in to comment.