diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/options.txt | 8 | ||||
-rw-r--r-- | runtime/doc/usr_40.txt | 11 | ||||
-rw-r--r-- | runtime/doc/usr_41.txt | 32 | ||||
-rw-r--r-- | runtime/indent/testdir/vim.in | 6 | ||||
-rw-r--r-- | runtime/indent/testdir/vim.ok | 6 | ||||
-rw-r--r-- | runtime/indent/vim.vim | 13 | ||||
-rw-r--r-- | runtime/lua/vim/filetype.lua | 2 | ||||
-rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/doxygen.vim | 16 |
9 files changed, 69 insertions, 29 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 5d227a702c..20805377d8 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2475,8 +2475,9 @@ A jump table for the options with a short description can be found at |Q_op|. < This is similar to the default, except that these characters will also be used when there is highlighting. - For "stl" and "stlnc" single-byte and multibyte characters are - supported. But double-width characters are not supported. + For the "stl", "stlnc", "foldopen", "foldclose" and "foldsep" items + single-byte and multibyte characters are supported. But double-width + characters are not supported. The highlighting used for these items: item highlight group ~ @@ -3667,6 +3668,9 @@ A jump table for the options with a short description can be found at |Q_op|. executing macros, registers and other commands that have not been typed. Also, updating the window title is postponed. To force an update use |:redraw|. + This may occasionally cause display errors. It is only meant to be set + temporarily when performing an operation where redrawing may cause + flickering or cause a slow down. *'linebreak'* *'lbr'* *'nolinebreak'* *'nolbr'* 'linebreak' 'lbr' boolean (default off) diff --git a/runtime/doc/usr_40.txt b/runtime/doc/usr_40.txt index 5b1254e2ae..f47c933124 100644 --- a/runtime/doc/usr_40.txt +++ b/runtime/doc/usr_40.txt @@ -463,6 +463,17 @@ separated) that trigger the command. The optional [++nested] flag allows for nesting of autocommands (see below), and finally, {command} is the command to be executed. +When adding an autocommand the already existing ones remain. To avoid adding +the autocommand several times you should use this form: > + + :augroup updateDate + : autocmd! + : autocmd BufWritePre * call DateInsert() + :augroup END + +This will delete any previously defined autocommand with `:autocmd!` before +defining the new one. Groups are explained later. + EVENTS diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 9af65343ef..5acef2f352 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1636,27 +1636,29 @@ manual: |exception-handling|. Here is a summary of items that apply to Vim scripts. They are also mentioned elsewhere, but form a nice checklist. -The end-of-line character depends on the system. For Unix a single <NL> -character is used. For Windows <CR><NL> is used. This is important when -using mappings that end in a <CR>. See |:source_crnl|. +The end-of-line character depends on the system. For Vim scripts it is +recommended to always use the Unix fileformat. Lines are then separated with +the Newline character. This also works on any other system. That way you can +copy your Vim scripts from MS-Windows to Unix and they still work. See +|:source_crnl|. To be sure it is set right, do this before writing the file: + > + :setlocal fileformat=unix +When using "dos" fileformat, lines are separated with CR-NL, two characters. +The CR character causes various problems, better avoid this. -WHITE SPACE - -Blank lines are allowed and ignored. -Leading whitespace characters (blanks and TABs) are always ignored. The -whitespaces between parameters (e.g. between the "set" and the "cpoptions" in -the example below) are reduced to one blank character and plays the role of a -separator, the whitespaces after the last (visible) character may or may not -be ignored depending on the situation, see below. +WHITE SPACE -For a ":set" command involving the "=" (equal) sign, such as in: > +Blank lines are allowed in a script and ignored. - :set cpoptions =aABceFst +Leading whitespace characters (blanks and TABs) are ignored, except when using +|:let-heredoc| without "trim". -the whitespace immediately before the "=" sign is ignored. But there can be -no whitespace after the "=" sign! +Trailing whitespace is often ignored, but not always. One command that +includes it is `map`. You have to watch out for that, it can cause hard to +understand mistakes. A generic solution is to never use trailing white space, +unless you really need it. To include a whitespace character in the value of an option, it must be escaped by a "\" (backslash) as in the following example: > diff --git a/runtime/indent/testdir/vim.in b/runtime/indent/testdir/vim.in index 699e4c243d..873045bc2c 100644 --- a/runtime/indent/testdir/vim.in +++ b/runtime/indent/testdir/vim.in @@ -30,6 +30,12 @@ for x in [ eval 0 endfor +let t = [ +\ { +\ 'k': 'val', +\ }, +\ ] + " END_INDENT " START_INDENT diff --git a/runtime/indent/testdir/vim.ok b/runtime/indent/testdir/vim.ok index f597d97e80..8e70abe619 100644 --- a/runtime/indent/testdir/vim.ok +++ b/runtime/indent/testdir/vim.ok @@ -30,6 +30,12 @@ for x in [ eval 0 endfor +let t = [ + \ { + \ 'k': 'val', + \ }, + \ ] + " END_INDENT " START_INDENT diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim index cd2d4982d8..8076b2df07 100644 --- a/runtime/indent/vim.vim +++ b/runtime/indent/vim.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Vim script " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2022 Mar 01 +" Last Change: 2022 Jun 24 " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -36,6 +36,14 @@ endfunc let s:lineContPat = '^\s*\(\\\|"\\ \)' function GetVimIndentIntern() + " If the current line has line continuation and the previous one too, use + " the same indent. This does not skip empty lines. + let cur_text = getline(v:lnum) + let cur_has_linecont = cur_text =~ s:lineContPat + if cur_has_linecont && v:lnum > 1 && getline(v:lnum - 1) =~ s:lineContPat + return indent(v:lnum - 1) + endif + " Find a non-blank line above the current line. let lnum = prevnonblank(v:lnum - 1) @@ -44,8 +52,7 @@ function GetVimIndentIntern() " If the current line doesn't start with '\' or '"\ ' and below a line that " starts with '\' or '"\ ', use the indent of the line above it. - let cur_text = getline(v:lnum) - if cur_text !~ s:lineContPat + if !cur_has_linecont while lnum > 0 && getline(lnum) =~ s:lineContPat let lnum = lnum - 1 endwhile diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 320d6a2a5b..6c4894208f 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -33,7 +33,7 @@ end function M.getlines(bufnr, start_lnum, end_lnum) if not end_lnum then -- Return a single line as a string - return api.nvim_buf_get_lines(bufnr, start_lnum - 1, start_lnum, false)[1] + return api.nvim_buf_get_lines(bufnr, start_lnum - 1, start_lnum, false)[1] or '' end return api.nvim_buf_get_lines(bufnr, start_lnum - 1, end_lnum, false) end diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 4cd4a200dd..f76bdebe9b 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -2,7 +2,7 @@ " " Author: Bram Moolenaar " Copyright: Vim license applies, see ":help license" -" Last Change: 2022 May 23 +" Last Change: 2022 Jun 22 " " WORK IN PROGRESS - The basics works stable, more to come " Note: In general you need at least GDB 7.12 because this provides the @@ -1406,7 +1406,7 @@ func s:HandleCursor(msg) echomsg 'different fname: "' .. expand('%:p') .. '" vs "' .. fnamemodify(fname, ':p') .. '"' augroup Termdebug " Always open a file read-only instead of showing the ATTENTION - " prompt, since we are unlikely to want to edit the file. + " prompt, since it is unlikely we want to edit the file. " The file may be changed but not saved, warn for that. au SwapExists * echohl WarningMsg \ | echo 'Warning: file is being edited elsewhere' diff --git a/runtime/syntax/doxygen.vim b/runtime/syntax/doxygen.vim index 167b17cd0f..36d527b551 100644 --- a/runtime/syntax/doxygen.vim +++ b/runtime/syntax/doxygen.vim @@ -498,12 +498,16 @@ endif syn match doxygenLeadingWhite +\(^\s*\*\)\@<=\s*+ contained - " This is still a proposal, but won't do any harm. - aug doxygengroup - au! - au Syntax UserColor_reset nested call s:Doxygen_Hilights_Base() - au Syntax UserColor_{on,reset,enable} nested call s:Doxygen_Hilights() - aug END + " This is still a proposal, but it is probably fine. However, it doesn't + " work when 'syntax' is set in a modeline, catch the security error. + try + aug doxygengroup + au! + au Syntax UserColor_reset nested call s:Doxygen_Hilights_Base() + au Syntax UserColor_{on,reset,enable} nested call s:Doxygen_Hilights() + aug END + catch /E12:/ + endtry SynLink doxygenBody Comment |