Skip to content

Commit

Permalink
Update runtime files.
Browse files Browse the repository at this point in the history
Includes changing &sw to shiftwidth() for all indent scripts.
  • Loading branch information
brammool committed Jun 13, 2017
1 parent 2102035 commit 3ec574f
Show file tree
Hide file tree
Showing 65 changed files with 345 additions and 422 deletions.
7 changes: 6 additions & 1 deletion runtime/doc/channel.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*channel.txt* For Vim version 8.0. Last change: 2016 Dec 02
*channel.txt* For Vim version 8.0. Last change: 2017 Jun 11


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -489,6 +489,11 @@ If you want to handle both stderr and stdout with one handler use the
"callback" option: >
let job = job_start(command, {"callback": "MyHandler"})
Depending on the system, starting a job can put Vim in the background, the
started job gets the focus. To avoid that, use the `foreground()` function.
This might not always work when called early, put in the callback handler or
use a timer to call it after the job has started.

You can send a message to the command with ch_evalraw(). If the channel is in
JSON or JS mode you can use ch_evalexpr().

Expand Down
7 changes: 5 additions & 2 deletions runtime/doc/eval.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Jun 05
*eval.txt* For Vim version 8.0. Last change: 2017 Jun 13


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -5465,7 +5465,10 @@ line({expr}) The result is a Number, which is the line number of the file
< *last-position-jump*
This autocommand jumps to the last known position in a file
just after opening it, if the '" mark is set: >
:au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
:au BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
\ | exe "normal! g`\""
\ | endif
line2byte({lnum}) *line2byte()*
Return the byte count from the start of the buffer for line
Expand Down
10 changes: 7 additions & 3 deletions runtime/doc/pattern.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*pattern.txt* For Vim version 8.0. Last change: 2017 Mar 29
*pattern.txt* For Vim version 8.0. Last change: 2017 Jun 05


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -1076,12 +1076,16 @@ x A single character, with no special meaning, matches itself
":s/[/x/" searches for "[/x" and replaces it with nothing. It does
not search for "[" and replaces it with "x"!

*E944* *E945*
If the sequence begins with "^", it matches any single character NOT
in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
- If two characters in the sequence are separated by '-', this is
shorthand for the full list of ASCII characters between them. E.g.,
"[0-9]" matches any decimal digit. Non-ASCII characters can be
used, but the character values must not be more than 256 apart.
"[0-9]" matches any decimal digit. If the starting character exceeds
the ending character, e.g. [c-a], E944 occurs. Non-ASCII characters
can be used, but the character values must not be more than 256 apart
in the old regexp engine. For example, searching by [\u3000-\u4000]
after setting re=1 emits a E945 error. Prepending \%#=2 will fix it.
- A character class expression is evaluated to the set of characters
belonging to that character class. The following character classes
are supported:
Expand Down
2 changes: 2 additions & 0 deletions runtime/doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -4519,6 +4519,8 @@ E940 eval.txt /*E940*
E941 eval.txt /*E941*
E942 eval.txt /*E942*
E943 message.txt /*E943*
E944 pattern.txt /*E944*
E945 pattern.txt /*E945*
E95 message.txt /*E95*
E96 diff.txt /*E96*
E97 diff.txt /*E97*
Expand Down
52 changes: 8 additions & 44 deletions runtime/doc/todo.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Jun 05
*todo.txt* For Vim version 8.0. Last change: 2017 Jun 13


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -113,6 +113,7 @@ With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
(Marcin Szewczyk, 2017 Apr 26)

ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737)
Lemonboy can reproduce (2017 Jun 5)

ml_get errors with buggy script. (Dominique, 2017 Apr 30)

Expand Down Expand Up @@ -144,15 +145,9 @@ Openhab syntax file (mueller, #1678)

Use gvimext.dll from the nightly build? (Issue #249)

Patch to remove HAVE_GTK_MULTIHEAD-relevant code. (Kazunobu Kuriyama, 2017 May
5) Update May 11

'synmaxcol' works with bytes instead of screen cells. (Llandon, 2017 May 31,
#1736)

Patch to pass quickfix list index to functions. (Yegappan Lakshmanan, 2017 May
31)

Problem with using :cd when remotely editing a file. (Gerd Wachsmuth, 2017 May
8, #1690)

Expand All @@ -168,35 +163,15 @@ manager. Problem with Motif?
Bogus characters inserted when triggering indent while changing text.
(Vitor Antunes, 2016 Nov 22, #1269)

Patch to have ":stag" respect 'switchbuf'. (Ingo Karkat, 2017 May 5, #1681)

Patch to improve building with MSVC. (Leonardo Manera, #1747)

Wrong selection of quoted text (Guraga, #1687)
Patch to fix selection of quoted text. (Christian Brabandt, 2017 May 7, #1687)

Patch to use separate error message for regex range. (Itchyny, Ken Hamada,
2017 May 16)

Segmentation fault with complete(). (Lifepillar, 2017 Apr 29, #1668)
Check for "pat" to be NULL in search_for_exact_line()?
How did it get NULL? Comment by Christian, Apr 30.

Is it possible to keep the complete menu open when calling complete()?
(Prabir Shrestha, 2017 May 19, #1713)

Calling may_req_ambiguous_char_width() and may_req_bg_color() only after
executing command line commands may not work properly.
(Rastislav Barlink, 2017 May 18)
Set "starting" to 0 earlier, and move the may_req calls above exe_commands()?
No, that's a problem with using "-c quit", not running Vim interactive.

Memory leak in test97? The string is actually freed. Weird.

Patch for shellescape(). (Christian Brabandt, 2017 Apr 20, #1590)

Patch for flickering redraw. (Hirohito Higashi, 2017 Apr 23, #1637)

New value "uselast" for 'switchbuf'. (Lemonboy, 2017 Apr 23, #1652)

Add a toolbar in the terminal. Can be global, above all windows, or specific
Expand All @@ -212,18 +187,6 @@ Perhaps simpler: actually delete the mappings. Use maplist() to list matching
mappings (with a lhs prefix, like maparg()), mapdelete() to delete,
maprestore() to restore (using the output of maplist().

Patch to support chinese wordcount in utf-8. (Rain, 2017 May 24, #1722)
Or not?

"gn" selects one character instead of the searched text. (keyboardfire, #1683)
Patch by Christian, 2017 May 7.

Wrong memory access using p_fdm, found in patch to add tests for diff mode
(#1658) (Dominique Pelle, 2017 May 6)

Patch to improve test coverage for diff mode. (Dominique Pelle, 2017 May 11,
#1685)

Add an argument to :mkvimrc (or add aother command) to skip mappings from
plugins (source is a Vim script). No need to put these in a .vimrc, they will
be defined when the plugin is loaded.
Expand All @@ -249,6 +212,7 @@ Also get E749 on exit.
Another example in #1309

Patch to change all use of &sw to shiftwidth(). (Tyru, 2017 Feb 19)
Takuya Fujiwara
Wait until maintainers integrate it.

When deleting a mark or register, leave a tombstone, so that it's also deleted
Expand Down Expand Up @@ -358,6 +322,8 @@ Patch for wrong cursor position on wrapped line, involving breakindent.
(Ozaki Kiichi, 2016 Nov 25)
Does this also fix #1408 ?

Patch to add "module" to quickfix entries. (Coot, 2017 Jun 8, #1757)

Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)

When 'completeopt' has "noselect" does not insert a newline. (Lifepillar, 2017
Expand Down Expand Up @@ -500,9 +466,6 @@ This does not work: :set cscopequickfix=a-

Possibly wrong value for seq_cur. (Florent Fayolle, 2016 May 15, #806)

Patch to add separate highlighting for quickfix current line.
(anishsane, 2016 Sep 16, #1080)

Filetype plugin for awk. (Doug Kearns, 2016 Sep 5)

Patch to improve map documentation. Issue #799.
Expand Down Expand Up @@ -539,6 +502,9 @@ Because of using the initial buffer? (Dun Peal, 2016 May 12)
Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
Updated 2016 Jun 10, #858 Update 2017 Mar 28: use <buffer>

Patch to fix that an encoding conversion failure results in a corrupted or
empty file. (Christian Brabandt, #1765, https://github.com/chrisbra/vim-mq-patches/blob/master/conversion_error)

Add redrawtabline command. (Naruhiko Nishino, 2016 Jun 11)

Neovim patch for utfc_ptr2char_len() https://github.com/neovim/neovim/pull/4574
Expand Down Expand Up @@ -1032,8 +998,6 @@ Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12)
Patch to add "ntab" item in 'listchars' to repeat first character. (Nathaniel
Braun, pragm, 2013 Oct 13) A better solution 2014 Mar 5.

/[b-a] gives error E16, should probably be E769.

7 Windows XP: When using "ClearType" for text smoothing, a column of yellow
pixels remains when typing spaces in front of a "D" ('guifont' set to
"lucida_console:h8").
Expand Down
4 changes: 3 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: 2017 Jun 04
" Last Change: 2017 Jun 12

" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
Expand Down Expand Up @@ -2253,6 +2253,8 @@ func! s:FTtex()
let format = tolower(matchstr(firstline, '\a\+'))
let format = substitute(format, 'pdf', '', '')
if format == 'tex'
let format = 'latex'
elseif format == 'plaintex'
let format = 'plain'
endif
else
Expand Down
20 changes: 10 additions & 10 deletions runtime/indent/ada.vim
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function s:MainBlockIndent (prev_indent, prev_lnum, blockstart, stop_at)
endwhile
endwhile
" Fallback - just move back one
return a:prev_indent - &sw
return a:prev_indent - shiftwidth()
endfunction MainBlockIndent

" Section: s:EndBlockIndent {{{1
Expand Down Expand Up @@ -131,7 +131,7 @@ function s:EndBlockIndent( prev_indent, prev_lnum, blockstart, blockend )
endwhile
endwhile
" Fallback - just move back one
return a:prev_indent - &sw
return a:prev_indent - shiftwidth()
endfunction EndBlockIndent

" Section: s:StatementIndent {{{1
Expand Down Expand Up @@ -213,15 +213,15 @@ function GetAdaIndent()
endif
" Move indent in
if ! false_match
let ind = ind + &sw
let ind = ind + shiftwidth()
endif
elseif line =~ '^\s*\(case\|exception\)\>'
" Move indent in twice (next 'when' will move back)
let ind = ind + 2 * &sw
let ind = ind + 2 * shiftwidth()
elseif line =~ '^\s*end\s*record\>'
" Move indent back to tallying 'type' preceeding the 'record'.
" Allow indent to be equal to 'end record's.
let ind = s:MainBlockIndent( ind+&sw, lnum, 'type\>', '' )
let ind = s:MainBlockIndent( ind+shiftwidth(), lnum, 'type\>', '' )
elseif line =~ '\(^\s*new\>.*\)\@<!)\s*[;,]\s*$'
" Revert to indent of line that started this parenthesis pair
exe lnum
Expand All @@ -235,10 +235,10 @@ function GetAdaIndent()
exe v:lnum
elseif line =~ '[.=(]\s*$'
" A statement continuation - move in one
let ind = ind + &sw
let ind = ind + shiftwidth()
elseif line =~ '^\s*new\>'
" Multiple line generic instantiation ('package blah is\nnew thingy')
let ind = s:StatementIndent( ind - &sw, lnum )
let ind = s:StatementIndent( ind - shiftwidth(), lnum )
elseif line =~ ';\s*$'
" Statement end (but not 'end' ) - try to find current statement-start indent
let ind = s:StatementIndent( ind, lnum )
Expand All @@ -256,17 +256,17 @@ function GetAdaIndent()
elseif continuation && line =~ '^\s*('
" Don't do this if we've already indented due to the previous line
if ind == initind
let ind = ind + &sw
let ind = ind + shiftwidth()
endif
elseif line =~ '^\s*\(begin\|is\)\>'
let ind = s:MainBlockIndent( ind, lnum, '\(procedure\|function\|declare\|package\|task\)\>', 'begin\>' )
elseif line =~ '^\s*record\>'
let ind = s:MainBlockIndent( ind, lnum, 'type\>\|for\>.*\<use\>', '' ) + &sw
let ind = s:MainBlockIndent( ind, lnum, 'type\>\|for\>.*\<use\>', '' ) + shiftwidth()
elseif line =~ '^\s*\(else\|elsif\)\>'
let ind = s:MainBlockIndent( ind, lnum, 'if\>', '' )
elseif line =~ '^\s*when\>'
" Align 'when' one /in/ from matching block start
let ind = s:MainBlockIndent( ind, lnum, '\(case\|exception\)\>', '' ) + &sw
let ind = s:MainBlockIndent( ind, lnum, '\(case\|exception\)\>', '' ) + shiftwidth()
elseif line =~ '^\s*end\>\s*\<if\>'
" End of if statements
let ind = s:EndBlockIndent( ind, lnum, 'if\>', 'end\>\s*\<if\>' )
Expand Down
6 changes: 3 additions & 3 deletions runtime/indent/awk.vim
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function! GetAwkIndent()
" 'pattern { action }' (simple check match on /{/ increases the indent then)

if s:Get_brace_balance( prev_data, '{', '}' ) > 0
return ind + &sw
return ind + shiftwidth()
endif

let brace_balance = s:Get_brace_balance( prev_data, '(', ')' )
Expand Down Expand Up @@ -99,7 +99,7 @@ function! GetAwkIndent()
return s:Safe_indent( ind, s:First_word_len(prev_data), getline(v:lnum))
else
" if/for/while without '{'
return ind + &sw
return ind + shiftwidth()
endif
endif
endif
Expand Down Expand Up @@ -140,7 +140,7 @@ function! GetAwkIndent()

" Decrease indent if this line contains a '}'.
if getline(v:lnum) =~ '^\s*}'
let ind = ind - &sw
let ind = ind - shiftwidth()
endif

return ind
Expand Down
4 changes: 2 additions & 2 deletions runtime/indent/bst.vim
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function! GetBstIndent(lnum) abort
endif
let fakeline = substitute(line,'^}','','').matchstr(cline,'^}')
let ind = indent(lnum)
let ind = ind + &sw * s:count(line,'{')
let ind = ind - &sw * s:count(fakeline,'}')
let ind = ind + shiftwidth() * s:count(line,'{')
let ind = ind - shiftwidth() * s:count(fakeline,'}')
return ind
endfunction
9 changes: 3 additions & 6 deletions runtime/indent/bzl.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Bazel (http://bazel.io)
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
" Last Change: 2015 Aug 11
" Last Change: 2017 Jun 13

if exists('b:did_indent')
finish
Expand Down Expand Up @@ -41,11 +41,8 @@ function GetBzlIndent(lnum) abort
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'
let g:pyindent_nested_paren = 'shiftwidth() * 2'
let g:pyindent_open_paren = 'shiftwidth() * 2'
endif

let l:indent = -1
Expand Down
Loading

0 comments on commit 3ec574f

Please sign in to comment.