diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-06-13 18:12:01 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-06-13 18:12:01 +0200 |
commit | 3ec574f2b549f456f664f689d6da36dc5719aeb9 (patch) | |
tree | 8aa7d766ebc0eb3919fdc678e6f48dd0a2b36673 | |
parent | 2102035488e80ef6fd5038ed15d21672712ba0f6 (diff) |
Update runtime files.
Includes changing &sw to shiftwidth() for all indent scripts.
65 files changed, 345 insertions, 422 deletions
diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index 3078d31acb..39cd912ad5 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -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 @@ -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(). diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 701fd39853..dec960bb78 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -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 @@ -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 diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index d6764096a7..89b24c6477 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -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 @@ -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: diff --git a/runtime/doc/tags b/runtime/doc/tags index af843e3135..224007c7ca 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -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* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index ac8026ba83..c833312201 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -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 @@ -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) @@ -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) @@ -168,16 +163,6 @@ 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. @@ -185,18 +170,8 @@ 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 @@ -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. @@ -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 @@ -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 @@ -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. @@ -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 @@ -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"). diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 9878236b62..635e1c3ce7 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -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") @@ -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 diff --git a/runtime/indent/ada.vim b/runtime/indent/ada.vim index 5019f0b736..1ca7fbacbe 100644 --- a/runtime/indent/ada.vim +++ b/runtime/indent/ada.vim @@ -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 @@ -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 @@ -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 @@ -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 ) @@ -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\>' ) diff --git a/runtime/indent/awk.vim b/runtime/indent/awk.vim index 6f6b70cc4e..aad73ee71f 100644 --- a/runtime/indent/awk.vim +++ b/runtime/indent/awk.vim @@ -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, '(', ')' ) @@ -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 @@ -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 diff --git a/runtime/indent/bst.vim b/runtime/indent/bst.vim index be1f63e8e9..47e3058810 100644 --- a/runtime/indent/bst.vim +++ b/runtime/indent/bst.vim @@ -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 diff --git a/runtime/indent/bzl.vim b/runtime/indent/bzl.vim index 24e5b870cd..6904bfdedb 100644 --- a/runtime/indent/bzl.vim +++ b/runtime/indent/bzl.vim @@ -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 @@ -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 diff --git a/runtime/indent/cdl.vim b/runtime/indent/cdl.vim index 5ec2a7b21a..5fae7b9046 100644 --- a/runtime/indent/cdl.vim +++ b/runtime/indent/cdl.vim @@ -47,7 +47,7 @@ fun! CdlGetIndent(lnum) let thisline = getline(a:lnum) if match(thisline, '^\s*\(\k\+\|\[[^]]*]\)\s*\(,\|;\s*$\)') >= 0 " it's an attributes line - return &sw + return shiftwidth() elseif match(thisline, '^\c\s*\([{}]\|\/[*/]\|dimension\|schedule\|group\|hierarchy\|class\)') >= 0 " it's a header or '{' or '}' or a comment return 0 @@ -71,13 +71,13 @@ fun! CdlGetIndent(lnum) let c = line[inicio-1] " ')' and '=' don't change indent and are useless to set 'f' if c == '{' - return &sw + return shiftwidth() elseif c != ')' && c != '=' let f = 1 " all but 'elseif' are followed by a formula if c ==? 'n' || c ==? 'e' " 'then', 'else' - let ind = ind + &sw + let ind = ind + shiftwidth() elseif strpart(line, inicio-6, 6) ==? 'elseif' " elseif, set f to conditional - let ind = ind + &sw + let ind = ind + shiftwidth() let f = 0 end end @@ -98,16 +98,16 @@ fun! CdlGetIndent(lnum) let ind = 0 let f = 1 elseif c == ')' || c== ';' || strpart(line, inicio-5, 5) ==? 'endif' - let ind = ind - &sw + let ind = ind - shiftwidth() elseif c == '(' || c ==? 'f' " '(' or 'if' - let ind = ind + &sw + let ind = ind + shiftwidth() else " c == '=' " if it is an asignment increase indent if f == -1 " we don't know yet, find out let f = CdlAsignment(lnum, strpart(line, 0, inicio)) end if f == 1 " formula increase it - let ind = ind + &sw + let ind = ind + shiftwidth() end end endw @@ -115,13 +115,13 @@ fun! CdlGetIndent(lnum) " CURRENT LINE, if it starts with a closing element, decrease indent " or if it starts with '=' (asignment), increase indent if match(thisline, '^\c\s*\(else\|then\|endif\|[);]\)') >= 0 - let ind = ind - &sw + let ind = ind - shiftwidth() elseif match(thisline, '^\s*=') >= 0 if f == -1 " we don't know yet if is an asignment, find out let f = CdlAsignment(lnum, "") end if f == 1 " formula increase it - let ind = ind + &sw + let ind = ind + shiftwidth() end end diff --git a/runtime/indent/chaiscript.vim b/runtime/indent/chaiscript.vim index 247e1a6e4c..445281cc46 100644 --- a/runtime/indent/chaiscript.vim +++ b/runtime/indent/chaiscript.vim @@ -31,19 +31,19 @@ function! GetChaiScriptIndent() let flag = 0 let prevline = getline(lnum) if prevline =~ '^.*{.*' - let ind = ind + &shiftwidth + let ind = ind + shiftwidth() let flag = 1 endif " Subtract a 'shiftwidth' after lines containing a { followed by a } " to keep it balanced if flag == 1 && prevline =~ '.*{.*}.*' - let ind = ind - &shiftwidth + let ind = ind - shiftwidth() endif " Subtract a 'shiftwidth' on lines ending with } if getline(v:lnum) =~ '^\s*\%(}\)' - let ind = ind - &shiftwidth + let ind = ind - shiftwidth() endif return ind diff --git a/runtime/indent/clojure.vim b/runtime/indent/clojure.vim index 7592b10d7d..7c4186e29b 100644 --- a/runtime/indent/clojure.vim +++ b/runtime/indent/clojure.vim @@ -261,7 +261,7 @@ if exists("*searchpairpos") call cursor(paren) if s:is_method_special_case(paren) - return [paren[0], paren[1] + &shiftwidth - 1] + return [paren[0], paren[1] + shiftwidth() - 1] endif if s:is_reader_conditional_special_case(paren) @@ -299,19 +299,19 @@ if exists("*searchpairpos") |