vim-patch:partial:b59ae59a5870 (#21170)

Update runtime files

b59ae59a58

- Omit `map()` lambda arg comment. Not worth mentioning for legacy script
  (and is already hinted at below).
- Cherry-pick latest `'thesaurusfunc'` example.
- Skip `optwin.vim` `'keyprotocol'` change.
- 🧜‍♀️

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Sean Dewar 2022-11-24 10:23:50 +00:00 committed by GitHub
parent c9adbcafae
commit 868d8d6962
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 3772 additions and 57 deletions

View File

@ -823,8 +823,8 @@ QuickFixCmdPre Before a quickfix command is run (|:make|,
QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
command is run, before jumping to the first
location. For |:cfile| and |:lfile| commands
it is run after error file is read and before
moving to the first error.
it is run after the error file is read and
before moving to the first error.
See |QuickFixCmdPost-example|.
*QuitPre*
QuitPre When using `:quit`, `:wq` or `:qall`, before
@ -1065,8 +1065,9 @@ VimResume After Nvim resumes from |suspend| state.
*VimSuspend*
VimSuspend Before Nvim enters |suspend| state.
*WinClosed*
WinClosed After closing a window. The pattern is
matched against the |window-ID|. Both
WinClosed When closing a window, just before it is
removed from the window layout. The pattern
is matched against the |window-ID|. Both
<amatch> and <afile> are set to the |window-ID|.
After WinLeave.
Non-recursive (event cannot trigger itself).

View File

@ -6921,29 +6921,38 @@ setbufvar({buf}, {varname}, {val}) *setbufvar()*
setcellwidths({list}) *setcellwidths()*
Specify overrides for cell widths of character ranges. This
tells Vim how wide characters are, counted in screen cells.
This overrides 'ambiwidth'. Example: >
setcellwidths([[0xad, 0xad, 1],
\ [0x2194, 0x2199, 2]])
tells Vim how wide characters are when displayed in the
terminal, counted in screen cells. The values override
'ambiwidth'. Example: >
call setcellwidths([
\ [0x111, 0x111, 1],
\ [0x2194, 0x2199, 2],
\ ])
< *E1109* *E1110* *E1111* *E1112* *E1113* *E1114*
The {list} argument is a list of lists with each three
numbers. These three numbers are [low, high, width]. "low"
and "high" can be the same, in which case this refers to one
character. Otherwise it is the range of characters from "low"
to "high" (inclusive). "width" is either 1 or 2, indicating
the character width in screen cells.
An error is given if the argument is invalid, also when a
range overlaps with another.
< The {list} argument is a List of Lists with each three
numbers: [{low}, {high}, {width}]. *E1109* *E1110*
{low} and {high} can be the same, in which case this refers to
one character. Otherwise it is the range of characters from
{low} to {high} (inclusive). *E1111* *E1114*
Only characters with value 0x100 and higher can be used.
{width} must be either 1 or 2, indicating the character width
in screen cells. *E1112*
An error is given if the argument is invalid, also when a
range overlaps with another. *E1113*
If the new value causes 'fillchars' or 'listchars' to become
invalid it is rejected and an error is given.
To clear the overrides pass an empty list: >
setcellwidths([]);
To clear the overrides pass an empty {list}: >
call setcellwidths([])
< You can use the script $VIMRUNTIME/tools/emoji_list.vim to see
the effect for known emoji characters.
the effect for known emoji characters. Move the cursor
through the text to check if the cell widths of your terminal
match with what Vim knows about each emoji. If it doesn't
look right you need to adjust the {list} argument.
setcharpos({expr}, {list}) *setcharpos()*
Same as |setpos()| but uses the specified column number as the

View File

@ -156,7 +156,7 @@ These are the RFC1345 digraphs for the one-byte characters. See the output of
":digraphs" for the others.
EURO
*euro* *euro-digraph*
Exception: RFC1345 doesn't specify the euro sign. In Vim the digraph =e was
added for this. Note the difference between latin1, where the digraph Cu is
used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is

View File

@ -857,29 +857,27 @@ invoked and what it should return.
Here is an example that uses the "aiksaurus" command (provided by Magnus
Groß): >
func Thesaur(findstart, base)
if a:findstart
let line = getline('.')
let start = col('.') - 1
while start > 0 && line[start - 1] =~ '\a'
let start -= 1
endwhile
return start
else
let res = []
let h = ''
for l in split(system('aiksaurus ' .. shellescape(a:base)), '\n')
if l[:3] == '=== '
let h = substitute(l[4:], ' =*$', '', '')
elseif l[0] =~ '\a'
call extend(res, map(split(l, ', '), {_, val -> {'word': val, 'menu': '('.h.')'}}))
endif
endfor
return res
endif
endfunc
func Thesaur(findstart, base)
if a:findstart
return searchpos('\<', 'bnW', line('.'))[1] - 1
endif
let res = []
let h = ''
for l in systemlist('aiksaurus ' .. shellescape(a:base))
if l[:3] == '=== '
let h = '(' .. substitute(l[4:], ' =*$', ')', '')
elseif l ==# 'Alphabetically similar known words are: '
let h = "\U0001f52e"
elseif l[0] =~ '\a' || (h ==# "\U0001f52e" && l[0] ==# "\t")
call extend(res, map(split(substitute(l, '^\t', '', ''), ', '), {_, val -> {'word': val, 'menu': h}}))
endif
endfor
return res
endfunc
set thesaurusfunc=Thesaur
if exists('+thesaurusfunc')
set thesaurusfunc=Thesaur
endif
Completing keywords in the current and included files *compl-keyword*

View File

@ -1713,7 +1713,7 @@ When executed as: >
This will invoke: >
:call Myfunc("arg1","arg2")
< *q-args-example*
< *q-args-example*
A more substantial example: >
:function Allargs(command)
: let i = 0

View File

@ -3349,9 +3349,13 @@ A jump table for the options with a short description can be found at |Q_op|.
local to buffer
Expression to be used to transform the string found with the 'include'
option to a file name. Mostly useful to change "." to "/" for Java: >
:set includeexpr=substitute(v:fname,'\\.','/','g')
:setlocal includeexpr=substitute(v:fname,'\\.','/','g')
< The "v:fname" variable will be set to the file name that was detected.
Note the double backslash: the `:set` command first halves them, then
one remains in the value, where "\." matches a dot literally. For
simple character replacements `tr()` avoids the need for escaping: >
:setlocal includeexpr=tr(v:fname,'.','/')
<
Also used for the |gf| command if an unmodified file name can't be
found. Allows doing "gf" on the name after an 'include' statement.
Also used for |<cfile>|.

View File

@ -454,7 +454,7 @@ the current window, try this custom `:HelpCurwin` command:
>
command -bar -nargs=? -complete=help HelpCurwin execute s:HelpCurwin(<q-args>)
let s:did_open_help = v:false
function s:HelpCurwin(subject) abort
let mods = 'silent noautocmd keepalt'
if !s:did_open_help

View File

@ -4,7 +4,7 @@
" Previous Maintainer: Max Ischenko <mfi@ukr.net>
" Contributor: Dorai Sitaram <ds26@gte.com>
" C.D. MacEachern <craig.daniel.maceachern@gmail.com>
" Last Change: 2022 Nov 16
" Last Change: 2022 Nov 19
if exists("b:did_ftplugin")
finish
@ -21,7 +21,7 @@ setlocal formatoptions-=t formatoptions+=croql
let &l:define = '\<function\|\<local\%(\s\+function\)\='
" TODO: handle init.lua
setlocal includeexpr=substitute(v:fname,'\.','/','g')
setlocal includeexpr=tr(v:fname,'.','/')
setlocal suffixesadd=.lua
let b:undo_ftplugin = "setlocal cms< com< def< fo< inex< sua<"

View File

@ -0,0 +1,49 @@
" Vim filetype plugin
" Language: Mermaid
" Maintainer: Craig MacEachern <https://github.com/craigmac/vim-mermaid>
" Last Change: 2022 Oct 13
if exists("b:did_ftplugin")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
" Use mermaid live editor's style
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=-1
setlocal tabstop=4
" TODO: comments, formatlist stuff, based on what?
setlocal comments=b:#,fb:-
setlocal commentstring=#\ %s
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\}
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= "|setl cms< com< fo< flp< et< ts< sts< sw<"
else
let b:undo_ftplugin = "setl cms< com< fo< flp< et< ts< sts< sw<"
endif
if !exists("g:no_plugin_maps") && !exists("g:no_markdown_maps")
nnoremap <silent><buffer> [[ :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR>
nnoremap <silent><buffer> ]] :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR>
xnoremap <silent><buffer> [[ :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR>
xnoremap <silent><buffer> ]] :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR>
let b:undo_ftplugin .= '|sil! nunmap <buffer> [[|sil! nunmap <buffer> ]]|sil! xunmap <buffer> [[|sil! xunmap <buffer> ]]'
endif
" if has("folding") && get(g:, "markdown_folding", 0)
" setlocal foldexpr=MarkdownFold()
" setlocal foldmethod=expr
" setlocal foldtext=MarkdownFoldText()
" let b:undo_ftplugin .= "|setl foldexpr< foldmethod< foldtext<"
" endif
let &cpo = s:keepcpo
unlet s:keepcpo
" vim:set sw=2:

70
runtime/ftplugin/obse.vim Normal file
View File

@ -0,0 +1,70 @@
" Vim filetype plugin file
" Language: Oblivion Language (obl)
" Original Creator: Kat <katisntgood@gmail.com>
" Maintainer: Kat <katisntgood@gmail.com>
" Created: August 08, 2021
" Last Change: 13 November 2022
if exists("b:did_ftplugin")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms<"
noremap <script> <buffer> <silent> [[ <nop>
noremap <script> <buffer> <silent> ]] <nop>
noremap <script> <buffer> <silent> [] <nop>
noremap <script> <buffer> <silent> ][ <nop>
setlocal commentstring=;%s
setlocal comments=:;
function s:NextSection(type, backwards, visual)
if a:visual
normal! gv
endif
if a:type == 1
let pattern = '\v(\n\n^\S|%^)'
let flags = 'e'
elseif a:type == 2
let pattern = '\v^\S.*'
let flags = ''
endif
if a:backwards
let dir = '?'
else
let dir = '/'
endif
execute 'silent normal! ' . dir . pattern . dir . flags . "\r"
endfunction
noremap <script> <buffer> <silent> ]]
\ :call <SID>NextSection(1, 0, 0)<cr>
noremap <script> <buffer> <silent> [[
\ :call <SID>NextSection(1, 1, 0)<cr>
noremap <script> <buffer> <silent> ][
\ :call <SID>NextSection(2, 0, 0)<cr>
noremap <script> <buffer> <silent> []
\ :call <SID>NextSection(2, 1, 0)<cr>
vnoremap <script> <buffer> <silent> ]]
\ :<c-u>call <SID>NextSection(1, 0, 1)<cr>
vnoremap <script> <buffer> <silent> [[
\ :<c-u>call <SID>NextSection(1, 1, 1)<cr>
vnoremap <script> <buffer> <silent> ][
\ :<c-u>call <SID>NextSection(2, 0, 1)<cr>
vnoremap <script> <buffer> <silent> []
\ :<c-u>call <SID>NextSection(2, 1, 1)<cr>
let &cpo = s:cpo_save
unlet s:cpo_save

55
runtime/indent/obse.vim Normal file
View File

@ -0,0 +1,55 @@
" Vim indent file
" Language: Oblivion Language (obl)
" Original Creator: Kat <katisntgood@gmail.com>
" Maintainer: Kat <katisntgood@gmail.com>
" Created: 01 November 2021
" Last Change: 13 November 2022
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
let b:undo_indent = 'setlocal indentkeys< indentexpr<'
setlocal indentexpr=GetOblIndent()
setlocal indentkeys+==~endif,=~else,=~loop,=~end
if exists("*GetOblIndent")
finish
endif
let s:keepcpo = &cpo
set cpo&vim
let s:SKIP_LINES = '^\s*\(;.*\)'
function! GetOblIndent()
let lnum = prevnonblank(v:lnum - 1)
let cur_text = getline(v:lnum)
if lnum == 0
return 0
endif
let prev_text = getline(lnum)
let found_cont = 0
let ind = indent(lnum)
" indent next line on start terms
let i = match(prev_text, '\c^\s*\(\s\+\)\?\(\(if\|while\|foreach\|begin\|else\%[if]\)\>\)')
if i >= 0
let ind += shiftwidth()
if strpart(prev_text, i, 1) == '|' && has('syntax_items')
\ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$'
let ind -= shiftwidth()
endif
endif
" indent current line on end/else terms
if cur_text =~ '\c^\s*\(\s\+\)\?\(\(loop\|endif\|else\%[if]\)\>\)'
let ind = ind - shiftwidth()
" if we are at a begin block just go to column 0
elseif cur_text =~ '\c^\s*\(\s\+\)\?\(\(begin\|end\)\>\)'
let ind = 0
endif
return ind
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2022 Oct 28
" Last Change: 2022 Nov 23
" If there already is an option window, jump to that one.
let buf = bufnr('option-window')

155
runtime/syntax/mermaid.vim Normal file
View File

@ -0,0 +1,155 @@
" Vim syntax file
" Language: Mermaid
" Maintainer: Craig MacEahern <https://github.com/craigmac/vim-mermaid>
" Filenames: *.mmd
" Last Change: 2022 Nov 22
if exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syntax iskeyword @,48-57,192-255,$,_,-,:
syntax keyword mermaidKeyword
\ _blank
\ _self
\ _parent
\ _top
\ ::icon
\ accDescr
\ accTitle
\ actor
\ activate
\ alt
\ and
\ as
\ autonumber
\ branch
\ break
\ callback
\ checkout
\ class
\ classDef
\ classDiagram
\ click
\ commit
\ commitgitGraph
\ critical
\ dataFormat
\ dateFormat
\ deactivate
\ direction
\ element
\ else
\ end
\ erDiagram
\ flowchart
\ gantt
\ gitGraph
\ graph
\ journey
\ link
\ LR
\ TD
\ TB
\ RL
\ loop
\ merge
\ mindmap root
\ Note
\ Note right of
\ Note left of
\ Note over
\ note
\ note right of
\ note left of
\ note over
\ opt
\ option
\ par
\ participant
\ pie
\ rect
\ requirement
\ rgb
\ section
\ sequenceDiagram
\ state
\ stateDiagram
\ stateDiagram-v2
\ style
\ subgraph
\ title
highlight link mermaidKeyword Keyword
syntax match mermaidStatement "|"
syntax match mermaidStatement "--\?[>x)]>\?+\?-\?"
syntax match mermaidStatement "\~\~\~"
syntax match mermaidStatement "--"
syntax match mermaidStatement "---"
syntax match mermaidStatement "-->"
syntax match mermaidStatement "-\."
syntax match mermaidStatement "\.->"
syntax match mermaidStatement "-\.-"
syntax match mermaidStatement "-\.\.-"
syntax match mermaidStatement "-\.\.\.-"
syntax match mermaidStatement "=="
syntax match mermaidStatement "==>"
syntax match mermaidStatement "===>"
syntax match mermaidStatement "====>"
syntax match mermaidStatement "&"
syntax match mermaidStatement "--o"
syntax match mermaidStatement "--x"
syntax match mermaidStatement "x--x"
syntax match mermaidStatement "-----"
syntax match mermaidStatement "---->"
syntax match mermaidStatement "==="
syntax match mermaidStatement "===="
syntax match mermaidStatement "====="
syntax match mermaidStatement ":::"
syntax match mermaidStatement "<|--"
syntax match mermaidStatement "\*--"
syntax match mermaidStatement "o--"
syntax match mermaidStatement "o--o"
syntax match mermaidStatement "<--"
syntax match mermaidStatement "<-->"
syntax match mermaidStatement "\.\."
syntax match mermaidStatement "<\.\."
syntax match mermaidStatement "<|\.\."
syntax match mermaidStatement "--|>"
syntax match mermaidStatement "--\*"
syntax match mermaidStatement "--o"
syntax match mermaidStatement "\.\.>"
syntax match mermaidStatement "\.\.|>"
syntax match mermaidStatement "<|--|>"
syntax match mermaidStatement "||--o{"
highlight link mermaidStatement Statement
syntax match mermaidIdentifier "[\+-]\?\w\+(.*)[\$\*]\?"
highlight link mermaidIdentifier Identifier
syntax match mermaidType "[\+-\#\~]\?\cint\>"
syntax match mermaidType "[\+-\#\~]\?\cString\>"
syntax match mermaidType "[\+-\#\~]\?\cbool\>"
syntax match mermaidType "[\+-\#\~]\?\cBigDecimal\>"
syntax match mermaidType "[\+-\#\~]\?\cList\~.\+\~"
syntax match mermaidType "<<\w\+>>"
highlight link mermaidType Type
syntax match mermaidComment "%%.*$"
highlight link mermaidComment Comment
syntax region mermaidDirective start="%%{" end="\}%%"
highlight link mermaidDirective PreProc
syntax region mermaidString start=/"/ skip=/\\"/ end=/"/
highlight link mermaidString String
let b:current_syntax = "mermaid"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim:set sw=2:

3360
runtime/syntax/obse.vim Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,8 @@
" Language: sway window manager config
" Original Author: James Eapen <james.eapen@vai.org>
" Maintainer: James Eapen <james.eapen@vai.org>
" Version: 0.11.1
" Version: 0.1.6
" Reference version (jamespeapen/swayconfig.vim): 0.11.6
" Last Change: 2022 Aug 08
" References:
@ -23,10 +24,6 @@ scriptencoding utf-8
" Error
"syn match swayConfigError /.*/
" Group mode/bar
syn keyword swayConfigBlockKeyword set input contained
syn region swayConfigBlock start=+.*s\?{$+ end=+^}$+ contains=i3ConfigBlockKeyword,swayConfigBlockKeyword,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigFont,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
" binding
syn keyword swayConfigBindKeyword bindswitch bindgesture contained
syn match swayConfigBind /^\s*\(bindswitch\)\s\+.*$/ contains=i3ConfigVariable,i3ConfigBindKeyword,swayConfigBindKeyword,i3ConfigVariableAndModifier,i3ConfigNumber,i3ConfigUnit,i3ConfigUnitOr,i3ConfigBindArgument,i3ConfigModifier,i3ConfigAction,i3ConfigString,i3ConfigGapStyleKeyword,i3ConfigBorderStyleKeyword
@ -45,7 +42,7 @@ syn match swayConfigFloating /^\s*floating\s\+\(enable\|disable\|toggle\)\s*$/ c
syn clear i3ConfigFloatingModifier
syn keyword swayConfigFloatingModifier floating_modifier contained
syn match swayConfigFloatingMouseAction /^\s\?.*floating_modifier\s.*\(normal\|inverted\)$/ contains=swayConfigFloatingModifier,i3ConfigVariable
syn match swayConfigFloatingMouseAction /^\s\?.*floating_modifier\s\S\+\s\?\(normal\|inverted\|none\)\?$/ contains=swayConfigFloatingModifier,i3ConfigVariable
" Gaps
syn clear i3ConfigSmartBorderKeyword
@ -57,6 +54,10 @@ syn match swayConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\|off\)\s\?$/
syn keyword swayConfigClientColorKeyword focused_tab_title contained
syn match swayConfigClientColor /^\s*client.\w\+\s\+.*$/ contains=i3ConfigClientColorKeyword,i3ConfigColor,i3ConfigVariable,i3ConfigClientColorKeyword,swayConfigClientColorKeyword
" Input config
syn keyword swayConfigInputKeyword input contained
syn match swayConfigInput /^\s*input\s\+.*$/ contains=swayConfigInputKeyword
" set display outputs
syn match swayConfigOutput /^\s*output\s\+.*$/ contains=i3ConfigOutput
@ -65,21 +66,34 @@ syn keyword swayConfigFocusKeyword focus contained
syn keyword swayConfigFocusType output contained
syn match swayConfigFocus /^\s*focus\soutput\s.*$/ contains=swayConfigFocusKeyword,swayConfigFocusType
" focus follows mouse
syn clear i3ConfigFocusFollowsMouseType
syn clear i3ConfigFocusFollowsMouse
syn keyword swayConfigFocusFollowsMouseType yes no always contained
syn match swayConfigFocusFollowsMouse /^\s*focus_follows_mouse\s\+\(yes\|no\|always\)\s\?$/ contains=i3ConfigFocusFollowsMouseKeyword,swayConfigFocusFollowsMouseType
" xwayland
syn keyword swayConfigXwaylandKeyword xwayland contained
syn match swayConfigXwaylandModifier /^\s*xwayland\s\+\(enable\|disable\|force\)\s\?$/ contains=swayConfigXwaylandKeyword
" Group mode/bar
syn clear i3ConfigBlock
syn region swayConfigBlock start=+.*s\?{$+ end=+^}$+ contains=i3ConfigBlockKeyword,i3ConfigString,i3ConfigBind,i3ConfigInitializeKeyword,i3ConfigComment,i3ConfigFont,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable,swayConfigInputKeyword,i3ConfigOutput transparent keepend extend
"hi def link swayConfigError Error
hi def link i3ConfigFloating Error
hi def link swayConfigFloating Type
hi def link swayConfigFloatingMouseAction Type
hi def link swayConfigFocusKeyword Type
hi def link swayConfigSmartBorderKeyword Type
hi def link swayConfigInputKeyword Type
hi def link swayConfigFocusFollowsMouseType Type
hi def link swayConfigBindGestureCommand Identifier
hi def link swayConfigBindGestureDirection Constant
hi def link swayConfigBindGesturePinchDirection Constant
hi def link swayConfigBindKeyword Identifier
hi def link swayConfigBlockKeyword Identifier
hi def link swayConfigClientColorKeyword Identifier
hi def link swayConfigFloatingKeyword Identifier
hi def link swayConfigFloatingModifier Identifier