aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/news.txt2
-rw-r--r--runtime/doc/treesitter.txt4
-rw-r--r--runtime/ftplugin/debchangelog.vim2
-rw-r--r--runtime/ftplugin/gpg.vim17
-rw-r--r--runtime/ftplugin/modconf.vim16
-rw-r--r--runtime/ftplugin/muttrc.vim16
-rw-r--r--runtime/ftplugin/readline.vim18
-rw-r--r--runtime/ftplugin/rst.vim2
-rw-r--r--runtime/ftplugin/sh.vim13
-rw-r--r--runtime/ftplugin/solidity.vim15
-rw-r--r--runtime/ftplugin/sql.vim4
-rw-r--r--runtime/ftplugin/sshconfig.vim25
-rw-r--r--runtime/ftplugin/sudoers.vim16
-rw-r--r--runtime/ftplugin/systemd.vim53
-rw-r--r--runtime/ftplugin/tidy.vim2
-rw-r--r--runtime/ftplugin/udevrules.vim16
-rw-r--r--runtime/ftplugin/zig.vim2
-rw-r--r--runtime/indent/nsis.vim2
-rw-r--r--runtime/indent/php.vim16
-rw-r--r--runtime/indent/rapid.vim12
-rw-r--r--runtime/indent/solidity.vim14
-rw-r--r--runtime/lua/vim/treesitter/languagetree.lua11
-rw-r--r--runtime/menu.vim2
-rw-r--r--runtime/syntax/8th.vim2
-rw-r--r--runtime/syntax/a65.vim2
-rw-r--r--runtime/syntax/bindzone.vim4
-rw-r--r--runtime/syntax/chaiscript.vim2
-rw-r--r--runtime/syntax/cmake.vim2
-rw-r--r--runtime/syntax/crontab.vim14
-rw-r--r--runtime/syntax/euphoria4.vim2
-rw-r--r--runtime/syntax/flexwiki.vim4
-rw-r--r--runtime/syntax/gdb.vim2
-rw-r--r--runtime/syntax/go.vim6
-rw-r--r--runtime/syntax/gp.vim47
-rw-r--r--runtime/syntax/groovy.vim2
-rw-r--r--runtime/syntax/lite.vim2
-rw-r--r--runtime/syntax/logtalk.vim2
-rw-r--r--runtime/syntax/lss.vim2
-rw-r--r--runtime/syntax/pymanifest.vim2
-rw-r--r--runtime/syntax/rmd.vim2
-rw-r--r--runtime/syntax/sgml.vim2
-rw-r--r--runtime/syntax/slrnrc.vim2
-rw-r--r--runtime/syntax/solidity.vim10
-rw-r--r--runtime/syntax/spec.vim4
-rw-r--r--runtime/syntax/sqlinformix.vim2
-rw-r--r--runtime/syntax/sqlj.vim2
-rw-r--r--runtime/syntax/squid.vim2
-rw-r--r--runtime/syntax/tasm.vim2
-rw-r--r--runtime/syntax/tf.vim2
-rw-r--r--runtime/syntax/tsalt.vim6
-rw-r--r--src/nvim/drawline.c7
-rw-r--r--src/nvim/move.c2
-rw-r--r--src/nvim/plines.c71
-rw-r--r--test/functional/legacy/breakindent_spec.lua27
-rw-r--r--test/functional/treesitter/parser_spec.lua33
-rw-r--r--test/functional/ui/decorations_spec.lua28
-rw-r--r--test/old/testdir/test_breakindent.vim12
57 files changed, 413 insertions, 180 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 483e829770..82b390853c 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -131,6 +131,8 @@ The following new APIs and features were added.
• `@injection.language` now has smarter resolution and will now fallback to language aliases and/or attempt lower case variants of the text.
language via aliases (e.g., filetype) registered via
`vim.treesitter.language.register`.
+ • The `#set!` directive now supports `injection.self` and `injection.parent` for injecting either the current node's language
+ or the parent LanguageTree's language, respectively.
• |vim.ui.open()| opens URIs using the system default handler (macOS `open`,
Windows `explorer`, Linux `xdg-open`, etc.)
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index f3e697807f..139b986786 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -523,6 +523,10 @@ associated with patterns:
node's entire text should be re-parsed, including the text of its child
nodes. By default, child nodes' text will be excluded from the injected
document.
+ • `injection.self` - indicates that the node's text should be parsed with
+ the same language as the node's LanguageTree.
+ • `injection.parent` - indicates that the captured node’s text should
+ be parsed with the same language as the node's parent LanguageTree.
==============================================================================
VIM.TREESITTER *lua-treesitter*
diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim
index 062fc054c8..dca7f7355a 100644
--- a/runtime/ftplugin/debchangelog.vim
+++ b/runtime/ftplugin/debchangelog.vim
@@ -122,7 +122,7 @@ function NewVersion()
normal! 1G0
call search(')')
normal! h
- " ':normal' doens't support key annotation (<c-a>) directly.
+ " ':normal' doesn't support key annotation (<c-a>) directly.
" Vim's manual recommends using ':exe' to use key annotation indirectly (backslash-escaping needed though).
exe "normal! \<c-a>"
call setline(1, substitute(getline(1), '-\$\$', '-', ''))
diff --git a/runtime/ftplugin/gpg.vim b/runtime/ftplugin/gpg.vim
index 3f890e58f6..9e00daed6a 100644
--- a/runtime/ftplugin/gpg.vim
+++ b/runtime/ftplugin/gpg.vim
@@ -15,5 +15,22 @@ let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
+if has('unix') && executable('less')
+ if !has('gui_running')
+ command -buffer -nargs=1 Sman
+ \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+--' . <q-args> . '\b'' --hilite-search" man ' . 'gpg' |
+ \ redraw!
+ elseif has('terminal')
+ command -buffer -nargs=1 Sman
+ \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'gpg'
+ endif
+ if exists(':Sman') == 2
+ setlocal iskeyword+=-
+ setlocal keywordprg=:Sman
+ let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
+ endif
+endif
+
let &cpo = s:cpo_save
unlet s:cpo_save
+
diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim
index c8e76b538b..09ad54b64a 100644
--- a/runtime/ftplugin/modconf.vim
+++ b/runtime/ftplugin/modconf.vim
@@ -16,5 +16,21 @@ let b:undo_ftplugin = "setl com< cms< inc< fo<"
setlocal comments=:# commentstring=#\ %s include=^\\s*include
setlocal formatoptions-=t formatoptions+=croql
+if has('unix') && executable('less')
+ if !has('gui_running')
+ command -buffer -nargs=1 Sman
+ \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'modprobe.d' |
+ \ redraw!
+ elseif has('terminal')
+ command -buffer -nargs=1 Sman
+ \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d'
+ endif
+ if exists(':Sman') == 2
+ setlocal iskeyword+=-
+ setlocal keywordprg=:Sman
+ let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
+ endif
+endif
+
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/runtime/ftplugin/muttrc.vim b/runtime/ftplugin/muttrc.vim
index c8ad0f2ec5..bd01367158 100644
--- a/runtime/ftplugin/muttrc.vim
+++ b/runtime/ftplugin/muttrc.vim
@@ -18,5 +18,21 @@ setlocal formatoptions-=t formatoptions+=croql
let &l:include = '^\s*source\>'
+if has('unix') && executable('less')
+ if !has('gui_running')
+ command -buffer -nargs=1 Sman
+ \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . 'muttrc' |
+ \ redraw!
+ elseif has('terminal')
+ command -buffer -nargs=1 Sman
+ \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'muttrc'
+ endif
+ if exists(':Sman') == 2
+ setlocal iskeyword+=-
+ setlocal keywordprg=:Sman
+ let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
+ endif
+endif
+
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/runtime/ftplugin/readline.vim b/runtime/ftplugin/readline.vim
index eba7122347..c81d0f2f65 100644
--- a/runtime/ftplugin/readline.vim
+++ b/runtime/ftplugin/readline.vim
@@ -25,11 +25,27 @@ if exists("loaded_matchit") && !exists("b:match_words")
endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
- let b:browsefilter = "Readline Intialization Files (inputrc .inputrc)\tinputrc;*.inputrc\n" ..
+ let b:browsefilter = "Readline Initialization Files (inputrc .inputrc)\tinputrc;*.inputrc\n" ..
\ "All Files (*.*)\t*.*\n"
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
endif
+if has('unix') && executable('less')
+ if !has('gui_running')
+ command -buffer -nargs=1 Sman
+ \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . '3 readline' |
+ \ redraw!
+ elseif has('terminal')
+ command -buffer -nargs=1 Sman
+ \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline'
+ endif
+ if exists(':Sman') == 2
+ setlocal iskeyword+=-
+ setlocal keywordprg=:Sman
+ let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
+ endif
+endif
+
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/runtime/ftplugin/rst.vim b/runtime/ftplugin/rst.vim
index ff7a402d10..c88e8f2580 100644
--- a/runtime/ftplugin/rst.vim
+++ b/runtime/ftplugin/rst.vim
@@ -28,7 +28,7 @@ setlocal formatoptions+=tcroql
" directives (..) and ordered lists (1.), although it can cause problems for
" many other cases.
"
-" More sophisticated indentation rules should be revisted in the future.
+" More sophisticated indentation rules should be revisited in the future.
if exists("g:rst_style") && g:rst_style != 0
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim
index b6fdb8f3e2..7106bf9155 100644
--- a/runtime/ftplugin/sh.vim
+++ b/runtime/ftplugin/sh.vim
@@ -41,6 +41,19 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
endif
+if (exists('b:is_bash') && (b:is_bash == 1)) ||
+ \ (exists('b:is_sh') && (b:is_sh == 1))
+ if !has('gui_running') && executable('less')
+ command! -buffer -nargs=1 Help silent exe '!bash -c "{ help "<args>" 2>/dev/null || man "<args>"; } | LESS= less"' | redraw!
+ elseif has('terminal')
+ command! -buffer -nargs=1 Help silent exe ':term bash -c "help "<args>" 2>/dev/null || man "<args>""'
+ else
+ command! -buffer -nargs=1 Help echo system('bash -c "help <args>" 2>/dev/null || man "<args>"')
+ endif
+ setlocal keywordprg=:Help
+ let b:undo_ftplugin .= '| setlocal keywordprg<'
+endif
+
" Restore the saved compatibility options.
let &cpo = s:save_cpo
unlet s:save_cpo
diff --git a/runtime/ftplugin/solidity.vim b/runtime/ftplugin/solidity.vim
new file mode 100644
index 0000000000..abe9f2ff26
--- /dev/null
+++ b/runtime/ftplugin/solidity.vim
@@ -0,0 +1,15 @@
+" Vim filetype plugin file
+" Language: Solidity
+" Maintainer: Cothi (jiungdev@gmail.com)
+" Original Author: tomlion (https://github.com/tomlion/vim-solidity)
+" Last Change: 2022 Sep 27
+" 2023 Aug 22 Vim Project (did_ftplugin, undo_ftplugin)
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal commentstring=//\ %s
+
+let b:undo_ftplugin = "setlocal commentstring<"
diff --git a/runtime/ftplugin/sql.vim b/runtime/ftplugin/sql.vim
index 1c02a98c7c..7a29d39f8e 100644
--- a/runtime/ftplugin/sql.vim
+++ b/runtime/ftplugin/sql.vim
@@ -140,7 +140,7 @@ if !exists("*SQL_SetType")
\ )
" Remove duplicates, since sqlanywhere.vim can exist in the
- " sytax, indent and ftplugin directory, yet we only want
+ " syntax, indent and ftplugin directory, yet we only want
" to display the option once
let index = match(sqls, '.\{-}\ze\n')
while index > -1
@@ -204,7 +204,7 @@ if !exists("*SQL_SetType")
endif
let b:sql_type_override = new_sql_type
- " Remove any cached SQL since a new sytax will have different
+ " Remove any cached SQL since a new syntax will have different
" items and groups
if !exists('g:loaded_sql_completion') || g:loaded_sql_completion >= 100
call sqlcomplete#ResetCacheSyntax()
diff --git a/runtime/ftplugin/sshconfig.vim b/runtime/ftplugin/sshconfig.vim
index d933ce0527..214e4928a0 100644
--- a/runtime/ftplugin/sshconfig.vim
+++ b/runtime/ftplugin/sshconfig.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
-" Language: OpenSSH client configuration file
-" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2008-07-09
+" Language: OpenSSH client configuration file
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
@@ -11,9 +11,24 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
-let b:undo_ftplugin = "setl com< cms< fo<"
-
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
+let b:undo_ftplugin = 'setlocal com< cms< fo<'
+
+if has('unix') && executable('less')
+ if !has('gui_running')
+ command -buffer -nargs=1 Sman
+ \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '$'' --hilite-search" man ' . 'ssh_config' |
+ \ redraw!
+ elseif has('terminal')
+ command -buffer -nargs=1 Sman
+ \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
+ endif
+ if exists(':Sman') == 2
+ setlocal iskeyword+=-
+ setlocal keywordprg=:Sman
+ let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
+ endif
+endif
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/runtime/ftplugin/sudoers.vim b/runtime/ftplugin/sudoers.vim
index 38dbf559ee..65cf2d8203 100644
--- a/runtime/ftplugin/sudoers.vim
+++ b/runtime/ftplugin/sudoers.vim
@@ -15,5 +15,21 @@ let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
+if has('unix') && executable('less')
+ if !has('gui_running')
+ command -buffer -nargs=1 Sman
+ \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''\b' . <q-args> . '\b'' --hilite-search" man ' . 'sudoers' |
+ \ redraw!
+ elseif has('terminal')
+ command -buffer -nargs=1 Sman
+ \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'sudoers'
+ endif
+ if exists(':Sman') == 2
+ setlocal iskeyword+=-
+ setlocal keywordprg=:Sman
+ let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
+ endif
+endif
+
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/runtime/ftplugin/systemd.vim b/runtime/ftplugin/systemd.vim
index 4c5c9a1dc1..c0bc6302f2 100644
--- a/runtime/ftplugin/systemd.vim
+++ b/runtime/ftplugin/systemd.vim
@@ -7,35 +7,30 @@ if !exists('b:did_ftplugin')
runtime! ftplugin/dosini.vim
endif
-if !has('unix')
- finish
-endif
-
-if !has('gui_running')
- command! -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw!
-elseif has('terminal')
- command! -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd(<q-args>)
-else
- finish
-endif
-
-if !exists('*KeywordLookup_systemd')
- function KeywordLookup_systemd(keyword) abort
- let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$')
- if len(matches) > 1
- let section = matches[1]
- return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section
+if has('unix') && executable('less')
+ if !has('gui_running')
+ command -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw!
+ elseif has('terminal')
+ command -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd(<q-args>)
+ endif
+ if exists(':Sman') == 2
+ if !exists('*KeywordLookup_systemd')
+ function KeywordLookup_systemd(keyword) abort
+ let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$')
+ if len(matches) > 1
+ let section = matches[1]
+ return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section
+ else
+ return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd'
+ endif
+ endfunction
+ endif
+ setlocal iskeyword+=-
+ setlocal keywordprg=:Sman
+ if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin)
+ let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<'
else
- return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd'
+ let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
endif
- endfunction
-endif
-
-setlocal iskeyword+=-
-setlocal keywordprg=:Sman
-
-if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin)
- let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<'
-else
- let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
+ endif
endif
diff --git a/runtime/ftplugin/tidy.vim b/runtime/ftplugin/tidy.vim
index 470548d83a..b81b66db4a 100644
--- a/runtime/ftplugin/tidy.vim
+++ b/runtime/ftplugin/tidy.vim
@@ -1,5 +1,5 @@
" Vim filetype plugin file
-" Language: HMTL Tidy Configuration
+" Language: HTML Tidy Configuration
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2020 Sep 4
diff --git a/runtime/ftplugin/udevrules.vim b/runtime/ftplugin/udevrules.vim
index 6404f6c85e..bde9c5dfa0 100644
--- a/runtime/ftplugin/udevrules.vim
+++ b/runtime/ftplugin/udevrules.vim
@@ -15,5 +15,21 @@ let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
+if has('unix') && executable('less')
+ if !has('gui_running')
+ command -buffer -nargs=1 Sman
+ \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'udev' |
+ \ redraw!
+ elseif has('terminal')
+ command -buffer -nargs=1 Sman
+ \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev'
+ endif
+ if exists(':Sman') == 2
+ setlocal iskeyword+=-
+ setlocal keywordprg=:Sman
+ let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
+ endif
+endif
+
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim
index e740a52849..5f453fc8d1 100644
--- a/runtime/ftplugin/zig.vim
+++ b/runtime/ftplugin/zig.vim
@@ -17,7 +17,7 @@ compiler zig_build
" Match Zig builtin fns
setlocal iskeyword+=@-@
-" Recomended code style, no tabs and 4-space indentation
+" Recommended code style, no tabs and 4-space indentation
setlocal expandtab
setlocal tabstop=8
setlocal softtabstop=4
diff --git a/runtime/indent/nsis.vim b/runtime/indent/nsis.vim
index 5d3decca37..3731781201 100644
--- a/runtime/indent/nsis.vim
+++ b/runtime/indent/nsis.vim
@@ -15,7 +15,7 @@ setlocal nosmartindent
setlocal noautoindent
setlocal indentexpr=GetNsisIndent(v:lnum)
setlocal indentkeys=!^F,o,O
-setlocal indentkeys+==~${Else,=~${EndIf,=~${EndUnless,=~${AndIf,=~${AndUnless,=~${OrIf,=~${OrUnless,=~${Case,=~${Default,=~${EndSelect,=~${EndSwith,=~${Loop,=~${Next,=~${MementoSectionEnd,=~FunctionEnd,=~SectionEnd,=~SectionGroupEnd,=~PageExEnd,0=~!macroend,0=~!if,0=~!else,0=~!endif
+setlocal indentkeys+==~${Else,=~${EndIf,=~${EndUnless,=~${AndIf,=~${AndUnless,=~${OrIf,=~${OrUnless,=~${Case,=~${Default,=~${EndSelect,=~${EndSwitch,=~${Loop,=~${Next,=~${MementoSectionEnd,=~FunctionEnd,=~SectionEnd,=~SectionGroupEnd,=~PageExEnd,0=~!macroend,0=~!if,0=~!else,0=~!endif
let b:undo_indent = "setl ai< inde< indk< si<"
diff --git a/runtime/indent/php.vim b/runtime/indent/php.vim
index 0e623689d5..6b3d700059 100644
--- a/runtime/indent/php.vim
+++ b/runtime/indent/php.vim
@@ -327,13 +327,13 @@ endfun
function! FindArrowIndent (lnum) " {{{
- let parrentArrowPos = -1
+ let parentArrowPos = -1
let cursorPos = -1
let lnum = a:lnum
while lnum > 1
let last_line = getline(lnum)
if last_line =~ '^\s*->'
- let parrentArrowPos = indent(a:lnum)
+ let parentArrowPos = indent(a:lnum)
break
else
@@ -355,28 +355,28 @@ function! FindArrowIndent (lnum) " {{{
else
endif
else
- let parrentArrowPos = -1
+ let parentArrowPos = -1
break
end
endif
if cleanedLnum =~ '->'
call cursor(lnum, cursorPos == -1 ? strwidth(cleanedLnum) : cursorPos)
- let parrentArrowPos = searchpos('->', 'cWb', lnum)[1] - 1
+ let parentArrowPos = searchpos('->', 'cWb', lnum)[1] - 1
break
else
- let parrentArrowPos = -1
+ let parentArrowPos = -1
break
endif
endif
endwhile
- if parrentArrowPos == -1
- let parrentArrowPos = indent(lnum) + shiftwidth()
+ if parentArrowPos == -1
+ let parentArrowPos = indent(lnum) + shiftwidth()
end
- return parrentArrowPos
+ return parentArrowPos
endfun "}}}
function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{
diff --git a/runtime/indent/rapid.vim b/runtime/indent/rapid.vim
index f97ebf84db..2c99bb2491 100644
--- a/runtime/indent/rapid.vim
+++ b/runtime/indent/rapid.vim
@@ -146,7 +146,7 @@ endfunction
" Returns the length of the line until a:str occur outside a string or
" comment. Search starts at string index a:startIdx.
-" If a:str is a word also add word bounderies and case insesitivity.
+" If a:str is a word also add word boundaries and case insensitivity.
" Note: rapidTodoComment and rapidDebugComment are not taken into account.
function s:RapidLenTilStr(lnum, str, startIdx) abort
@@ -179,8 +179,8 @@ function s:RapidLenTilStr(lnum, str, startIdx) abort
return -1
endfunction
-" a:lchar shoud be one of (, ), [, ], { or }
-" returns the number of opening/closing parenthesise which have no
+" a:lchar should be one of (, ), [, ], { or }
+" returns the number of opening/closing parentheses which have no
" closing/opening match in getline(a:lnum)
function s:RapidLoneParen(lnum,lchar) abort
if a:lchar == "(" || a:lchar == ")"
@@ -205,7 +205,7 @@ function s:RapidLoneParen(lnum,lchar) abort
endif
let l:opnParen = 0
- " count opening brakets
+ " count opening brackets
let l:i = 0
while l:i >= 0
let l:i = s:RapidLenTilStr(a:lnum, l:opnParChar, l:i)
@@ -216,7 +216,7 @@ function s:RapidLoneParen(lnum,lchar) abort
endwhile
let l:clsParen = 0
- " count closing brakets
+ " count closing brackets
let l:i = 0
while l:i >= 0
let l:i = s:RapidLenTilStr(a:lnum, l:clsParChar, l:i)
@@ -242,7 +242,7 @@ function s:RapidPreNoneBlank(lnum) abort
let nPreNoneBlank = prevnonblank(a:lnum)
while nPreNoneBlank>0 && getline(nPreNoneBlank) =~ '\v\c^\s*(\%\%\%|!)'
- " Previouse none blank line irrelevant. Look further aback.
+ " Previous none blank line irrelevant. Look further aback.
let nPreNoneBlank = prevnonblank(nPreNoneBlank - 1)
endwhile
diff --git a/runtime/indent/solidity.vim b/runtime/indent/solidity.vim
index caed726c0a..55a07c015a 100644
--- a/runtime/indent/solidity.vim
+++ b/runtime/indent/solidity.vim
@@ -1,9 +1,11 @@
" Vim indent file
-" Language: Solidity
-" Acknowledgement: Based off of vim-javascript
-" Maintainer: Cothi (jiungdev@gmail.com)
-" Original Author: tomlion (https://github.com/tomlion/vim-solidity)
-" Last Changed: 2022 Sep 27
+" Language: Solidity
+" Maintainer: Cothi (jiungdev@gmail.com)
+" Original Author: tomlion (https://github.com/tomlion/vim-solidity)
+" Last Change: 2022 Sep 27
+" 2023 Aug 22 Vim Project (undo_indent)
+"
+" Acknowledgement: Based off of vim-javascript
"
" 0. Initialization {{{1
" =================
@@ -20,6 +22,8 @@ setlocal nosmartindent
setlocal indentexpr=GetSolidityIndent()
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
+let b:undo_indent = "setlocal indentexpr< indentkeys< smartindent<"
+
" Only define the function once.
if exists("*GetSolidityIndent")
finish
diff --git a/runtime/lua/vim/treesitter/languagetree.lua b/runtime/lua/vim/treesitter/languagetree.lua
index 4b419c4744..e81778b269 100644
--- a/runtime/lua/vim/treesitter/languagetree.lua
+++ b/runtime/lua/vim/treesitter/languagetree.lua
@@ -82,6 +82,7 @@ local TSCallbackNames = {
---List of regions this tree should manage and parse. If nil then regions are
---taken from _trees. This is mostly a short-lived cache for included_regions()
---@field private _lang string Language name
+---@field private _parent_lang? string Parent language name
---@field private _source (integer|string) Buffer or string to parse
---@field private _trees TSTree[] Reference to parsed tree (one for each language)
---@field private _valid boolean|table<integer,boolean> If the parsed tree is valid
@@ -105,8 +106,9 @@ LanguageTree.__index = LanguageTree
---@param opts (table|nil) Optional arguments:
--- - injections table Map of language to injection query strings. Overrides the
--- built-in runtime file searching for language injections.
+---@param parent_lang? string Parent language name of this tree
---@return LanguageTree parser object
-function LanguageTree.new(source, lang, opts)
+function LanguageTree.new(source, lang, opts, parent_lang)
language.add(lang)
---@type LanguageTreeOpts
opts = opts or {}
@@ -121,6 +123,7 @@ function LanguageTree.new(source, lang, opts)
local self = {
_source = source,
_lang = lang,
+ _parent_lang = parent_lang,
_children = {},
_trees = {},
_opts = opts,
@@ -489,7 +492,7 @@ function LanguageTree:add_child(lang)
self:remove_child(lang)
end
- local child = LanguageTree.new(self._source, lang, self._opts)
+ local child = LanguageTree.new(self._source, lang, self._opts, self:lang())
-- Inherit recursive callbacks
for nm, cb in pairs(self._callbacks_rec) do
@@ -752,7 +755,9 @@ end
function LanguageTree:_get_injection(match, metadata)
local ranges = {} ---@type Range6[]
local combined = metadata['injection.combined'] ~= nil
- local lang = metadata['injection.language'] --[[@as string?]]
+ local lang = metadata['injection.self'] ~= nil and self:lang()
+ or metadata['injection.parent'] ~= nil and self._parent_lang
+ or metadata['injection.language'] --[[@as string?]]
local include_children = metadata['injection.include-children'] ~= nil
for id, node in pairs(match) do
diff --git a/runtime/menu.vim b/runtime/menu.vim
index 20a2611aa5..4576ca0ab7 100644
--- a/runtime/menu.vim
+++ b/runtime/menu.vim
@@ -122,7 +122,7 @@ endfun
" File menu
an 10.310 &File.&Open\.\.\.<Tab>:e :browse confirm e<CR>
an 10.320 &File.Sp&lit-Open\.\.\.<Tab>:sp :browse sp<CR>
-an 10.320 &File.Open\ Tab\.\.\.<Tab>:tabnew :browse tabnew<CR>
+an 10.320 &File.Open\ &Tab\.\.\.<Tab>:tabnew :browse tabnew<CR>
an 10.325 &File.&New<Tab>:enew :confirm enew<CR>
an <silent> 10.330 &File.&Close<Tab>:close
\ :if winheight(2) < 0 && tabpagewinnr(2) == 0 <Bar>
diff --git a/runtime/syntax/8th.vim b/runtime/syntax/8th.vim
index ce27d10a44..643c9cb095 100644
--- a/runtime/syntax/8th.vim
+++ b/runtime/syntax/8th.vim
@@ -363,7 +363,7 @@ syn region eighthComment start="\zs\\" end="$" contains=eighthTodo
if !exists("did_eighth_syntax_inits")
let did_eighth_syntax_inits=1
- " The default methods for highlighting. Can be overriden later.
+ " The default methods for highlighting. Can be overridden later.
hi def link eighthTodo Todo
hi def link eighthOperators Operator
hi def link eighthMath Number
diff --git a/runtime/syntax/a65.vim b/runtime/syntax/a65.vim
index b232e826cd..6445b9438b 100644
--- a/runtime/syntax/a65.vim
+++ b/runtime/syntax/a65.vim
@@ -118,7 +118,7 @@ syn match a65Section "\(^\|\s\)\.)\($\|\s\)"
" Strings
syn match a65String "\".*\""
-" Programm Counter
+" Program Counter
syn region a65PC start="\*=" end="\>" keepend
" HI/LO Byte
diff --git a/runtime/syntax/bindzone.vim b/runtime/syntax/bindzone.vim
index fede3d97d5..dce9974903 100644
--- a/runtime/syntax/bindzone.vim
+++ b/runtime/syntax/bindzone.vim
@@ -33,7 +33,7 @@ syn match zoneDomain contained /[^[:space:]!"#$%&'()*+,\/:;<=>?@[\]\
syn match zoneSpecial contained /^[@*.]\s/
syn match zoneTTL contained /\s\@<=\d[0-9WwDdHhMmSs]*\(\s\|$\)\@=/ nextgroup=zoneClass,zoneRRType skipwhite
syn keyword zoneClass contained IN CHAOS CH HS HESIOD nextgroup=zoneRRType,zoneTTL skipwhite
-syn keyword zoneRRType contained A AAAA CAA CERT CNAME DNAME DNSKEY DS HINFO LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM OPENPGPKEY PTR RP RRSIG SMIMEA SOA SPF SRV SSHFP TLSA TXT nextgroup=zoneRData skipwhite
+syn keyword zoneRRType contained A AAAA APL CAA CERT CNAME DNAME DNSKEY DS HINFO LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM OPENPGPKEY PTR RP RRSIG SMIMEA SOA SPF SRV SSHFP TLSA TXT nextgroup=zoneRData skipwhite
syn match zoneRData contained /[^;]*/ contains=zoneDomain,zoneIPAddr,zoneIP6Addr,zoneText,zoneNumber,zoneParen,zoneUnknown
syn match zoneIPAddr contained /\<[0-9]\{1,3}\(\.[0-9]\{1,3}\)\{,3}\>/
@@ -60,7 +60,7 @@ syn match zoneIP6Addr contained /\<\(\x\{1,4}:\)\{1,7}:\(\s\|;\|$\)\@=
syn match zoneText contained /"\([^"\\]\|\\.\)*"\(\s\|;\|$\)\@=/
syn match zoneNumber contained /\<[0-9]\+\(\s\|;\|$\)\@=/
-syn match zoneSerial contained /\<[0-9]\{9,10}\(\s\|;\|$\)\@=/
+syn match zoneSerial contained /\<[0-9]\{1,10}\(\s\|;\|$\)\@=/
syn match zoneErrParen /)/
syn region zoneParen contained start="(" end=")" contains=zoneSerial,zoneTTL,zoneNumber,zoneComment
diff --git a/runtime/syntax/chaiscript.vim b/runtime/syntax/chaiscript.vim
index 5a64bdb556..9925ba5138 100644
--- a/runtime/syntax/chaiscript.vim
+++ b/runtime/syntax/chaiscript.vim
@@ -61,7 +61,7 @@ syn region chaiscriptFunc matchgroup=chaiscriptFunc start="`" end="`"
" Intentionally leaving out all of the normal, well known operators
syn match chaiscriptOperator "\.\."
-" Guard seperator as an operator
+" Guard separator as an operator
syn match chaiscriptOperator ":"
" Comments
diff --git a/runtime/syntax/cmake.vim b/runtime/syntax/cmake.vim
index f7616e4c6d..7340ac238e 100644
--- a/runtime/syntax/cmake.vim
+++ b/runtime/syntax/cmake.vim
@@ -335,7 +335,7 @@ syn keyword cmakeGeneratorExpressions contained
syn case ignore
syn keyword cmakeCommand
- \ add_compile_options add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue create_test_sourcelist ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload define_property enable_language enable_testing endfunction endmacro execute_process export file find_file find_library find_package find_path find_program fltk_wrap_ui function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property include include_directories include_external_msproject include_guard include_regular_expression install link_directories list load_cache load_command macro mark_as_advanced math message option project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_libraries target_sources try_compile try_run unset variable_watch
+ \ add_compile_options add_compile_definitions add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue create_test_sourcelist ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload define_property enable_language enable_testing endfunction endmacro execute_process export file find_file find_library find_package find_path find_program fltk_wrap_ui function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property include include_directories include_external_msproject include_guard include_regular_expression install link_directories list load_cache load_command macro mark_as_advanced math message option project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_libraries target_sources try_compile try_run unset variable_watch
\ nextgroup=cmakeArguments
syn keyword cmakeCommandConditional
diff --git a/runtime/syntax/crontab.vim b/runtime/syntax/crontab.vim
index 5e38ffaafe..12daa9b7b8 100644
--- a/runtime/syntax/crontab.vim
+++ b/runtime/syntax/crontab.vim
@@ -5,7 +5,7 @@
" License: This file can be redistribued and/or modified under the same terms
" as Vim itself.
" Filenames: /tmp/crontab.* used by "crontab -e"
-" Last Change: 2015-01-20
+" Last Change: 2022-09-22
"
" crontab line format:
" Minutes Hours Days Months Days_of_Week Commands # comments
@@ -15,20 +15,20 @@ if exists("b:current_syntax")
finish
endif
-syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
+syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\|every_minute\|every_second\)\>" nextgroup=crontabCmd skipwhite
syntax match crontabVar "^\s*\k\w*\s*="me=e-1
syntax case ignore
-syntax match crontabMin "^\s*[-0-9/,.*]\+" nextgroup=crontabHr skipwhite
-syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained
-syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained
+syntax match crontabMin "^\s*[-~0-9/,.*]\+" nextgroup=crontabHr skipwhite
+syntax match crontabHr "\s[-~0-9/,.*]\+" nextgroup=crontabDay skipwhite contained
+syntax match crontabDay "\s[-~0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained
-syntax match crontabMnth "\s[-a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained
+syntax match crontabMnth "\s[-~a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained
syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec
-syntax match crontabDow "\s[-a-z0-9/,.*]\+" nextgroup=crontabCmd skipwhite contained
+syntax match crontabDow "\s[-~a-z0-9/,.*]\+" nextgroup=crontabCmd skipwhite contained
syntax keyword crontabDow7 contained sun mon tue wed thu fri sat
syntax region crontabCmd start="\S" end="$" skipwhite contained keepend contains=crontabPercent
diff --git a/runtime/syntax/euphoria4.vim b/runtime/syntax/euphoria4.vim
index 5e668a7d67..baa0e8e7b9 100644
--- a/runtime/syntax/euphoria4.vim
+++ b/runtime/syntax/euphoria4.vim
@@ -27,7 +27,7 @@ syn keyword euphoria4Debug includes inline warning define
" Keywords for conditional compilation - from $EUDIR/include/euphoria/keywords.e:
syn keyword euphoria4PreProc elsedef elsifdef ifdef
-" Keywords (Statments) - from $EUDIR/include/euphoria/keywords.e:
+" Keywords (Statements) - from $EUDIR/include/euphoria/keywords.e:
syn keyword euphoria4Keyword and as break by case constant continue do else
syn keyword euphoria4Keyword elsif end entry enum exit export
syn keyword euphoria4Keyword fallthru for function global goto if include
diff --git a/runtime/syntax/flexwiki.vim b/runtime/syntax/flexwiki.vim
index 6b15ab2d90..3b5f7ff573 100644
--- a/runtime/syntax/flexwiki.vim
+++ b/runtime/syntax/flexwiki.vim
@@ -67,10 +67,10 @@ syntax match flexwikiEmoticons /\((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)
" Aggregate all the regular text highlighting into flexwikiText
syntax cluster flexwikiText contains=flexwikiItalic,flexwikiBold,flexwikiCode,flexwikiDeEmphasis,flexwikiDelText,flexwikiInsText,flexwikiSuperScript,flexwikiSubScript,flexwikiCitation,flexwikiLink,flexwikiWord,flexwikiEmoticons
-" single-line WikiPropertys
+" single-line WikiProperties
syntax match flexwikiSingleLineProperty /^:\?[A-Z_][_a-zA-Z0-9]\+:/
-" TODO: multi-line WikiPropertys
+" TODO: multi-line WikiProperties
" Header levels, 1-6
syntax match flexwikiH1 /^!.*$/
diff --git a/runtime/syntax/gdb.vim b/runtime/syntax/gdb.vim
index c820ba40a9..c15b96de6f 100644
--- a/runtime/syntax/gdb.vim
+++ b/runtime/syntax/gdb.vim
@@ -30,7 +30,7 @@ syn keyword gdbStatement contained search section set sharedlibrary shell show s
syn keyword gdbStatement contained stop target tbreak tdump tfind thbreak thread tp trace tstart tstatus tstop
syn keyword gdbStatement contained tty und[isplay] unset until up watch whatis where while ws x
syn match gdbFuncDef "\<define\>.*"
-syn match gdbStatmentContainer "^\s*\S\+" contains=gdbStatement,gdbFuncDef
+syn match gdbStatementContainer "^\s*\S\+" contains=gdbStatement,gdbFuncDef
syn match gdbStatement "^\s*info" nextgroup=gdbInfo skipwhite skipempty
" some commonly used abbreviations
diff --git a/runtime/syntax/go.vim b/runtime/syntax/go.vim
index bf967fdcd9..4272e807f3 100644
--- a/runtime/syntax/go.vim
+++ b/runtime/syntax/go.vim
@@ -5,7 +5,7 @@
" go.vim: Vim syntax file for Go.
" Language: Go
" Maintainer: Billie Cleek <bhcleek@gmail.com>
-" Latest Revision: 2023-02-19
+" Latest Revision: 2023-08-21
" License: BSD-style. See LICENSE file in source repository.
" Repository: https://github.com/fatih/vim-go
@@ -130,8 +130,8 @@ hi def link goFloats Type
hi def link goComplexes Type
" Predefined functions and values
-syn keyword goBuiltins append cap close complex copy delete imag len
-syn keyword goBuiltins make new panic print println real recover
+syn keyword goBuiltins append cap clear close complex copy delete imag len
+syn keyword goBuiltins make max min new panic print println real recover
syn keyword goBoolean true false
syn keyword goPredefinedIdentifiers nil iota
diff --git a/runtime/syntax/gp.vim b/runtime/syntax/gp.vim
index aecf7df48b..89f2d3f0ff 100644
--- a/runtime/syntax/gp.vim
+++ b/runtime/syntax/gp.vim
@@ -1,7 +1,7 @@
" Vim syntax file
-" Language: gp (version 2.5)
+" Language: gp (version 2.15)
" Maintainer: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
-" Last change: 2012 Jan 08
+" Last change: 2023 Aug 22
" URL: http://pari.math.u-bordeaux.fr
" quit when a syntax file was already loaded
@@ -14,23 +14,29 @@ set cpo&vim
" control statements
syntax keyword gpStatement break return next
-syntax keyword gpConditional if
-syntax keyword gpRepeat until while for fordiv forell forprime
-syntax keyword gpRepeat forsubgroup forstep forvec
+syntax keyword gpConditional if iferr
+syntax keyword gpRepeat until while for forcomposite fordiv
+syntax keyword gpRepeat fordivfactored foreach forell forfactored
+syntax keyword gpRepeat forpart forperm forprime forprimestep forqfvec
+syntax keyword gpRepeat forsquarefree forstep forsubgroup forsubset
+syntax keyword gpRepeat forvec
+syntax keyword gpRepeat parfor parforeach parforprime parforprimestep
+syntax keyword gpRepeat parforvec
" storage class
-syntax keyword gpScope my local global
+syntax keyword gpScope my local global export exportall
" defaults
syntax keyword gpInterfaceKey breakloop colors compatible
-syntax keyword gpInterfaceKey datadir debug debugfiles debugmem
-syntax keyword gpInterfaceKey echo factor_add_primes factor_proven format
+syntax keyword gpInterfaceKey datadir debug debugfiles debugmem
+syntax keyword gpInterfaceKey echo factor_add_primes factor_proven format
syntax keyword gpInterfaceKey graphcolormap graphcolors
-syntax keyword gpInterfaceKey help histfile histsize
-syntax keyword gpInterfaceKey lines linewrap log logfile new_galois_format
-syntax keyword gpInterfaceKey output parisize path prettyprinter primelimit
-syntax keyword gpInterfaceKey prompt prompt_cont psfile
-syntax keyword gpInterfaceKey readline realprecision recover
-syntax keyword gpInterfaceKey secure seriesprecision simplify strictmatch
-syntax keyword gpInterfaceKey TeXstyle timer
+syntax keyword gpInterfaceKey help histfile histsize
+syntax keyword gpInterfaceKey lines linewrap log logfile nbthreads
+syntax keyword gpInterfaceKey new_galois_format output parisize parisizemax
+syntax keyword gpInterfaceKey path plothsizes prettyprinter primelimit prompt
+syntax keyword gpInterfaceKey prompt_cont psfile readline realbitprecision
+syntax keyword gpInterfaceKey realprecision recover secure seriesprecision
+syntax keyword gpInterfaceKey simplify sopath strictmatch TeXstyle
+syntax keyword gpInterfaceKey threadsize threadsizemax timer
syntax match gpInterface "^\s*\\[a-z].*"
syntax keyword gpInterface default
@@ -58,24 +64,23 @@ syntax region gpParen transparent start='(' end=')' contains=ALLBUT,gpParenErro
syntax match gpParenError ")"
syntax match gpInParen contained "[{}]"
-
-hi def link gpConditional Conditional
+hi def link gpConditional Conditional
hi def link gpRepeat Repeat
hi def link gpError Error
-hi def link gpParenError gpError
+hi def link gpParenError gpError
hi def link gpInParen gpError
hi def link gpStatement Statement
hi def link gpString String
hi def link gpComment Comment
hi def link gpInterface Type
hi def link gpInput Type
-hi def link gpInterfaceKey Statement
+hi def link gpInterfaceKey Statement
hi def link gpFunction Function
hi def link gpScope Type
" contained ones
hi def link gpSpecial Special
-hi def link gpTodo Todo
-hi def link gpArgs Type
+hi def link gpTodo Todo
+hi def link gpArgs Type
let b:current_syntax = "gp"
let &cpo = s:cpo_save
diff --git a/runtime/syntax/groovy.vim b/runtime/syntax/groovy.vim
index 41495e6682..e48279bd1a 100644
--- a/runtime/syntax/groovy.vim
+++ b/runtime/syntax/groovy.vim
@@ -362,7 +362,7 @@ exec "syn sync ccomment groovyComment minlines=" . groovy_minlines
" Mark these as operators
-" Hightlight brackets
+" Highlight brackets
" syn match groovyBraces "[{}]"
" syn match groovyBraces "[\[\]]"
" syn match groovyBraces "[\|]"
diff --git a/runtime/syntax/lite.vim b/runtime/syntax/lite.vim
index a8d26892d4..f6e41e7e18 100644
--- a/runtime/syntax/lite.vim
+++ b/runtime/syntax/lite.vim
@@ -5,7 +5,7 @@
" Email: Subject: send syntax_vim.tgz
" Last Change: 2001 Mai 01
"
-" Options lite_sql_query = 1 for SQL syntax highligthing inside strings
+" Options lite_sql_query = 1 for SQL syntax highlighting inside strings
" lite_minlines = x to sync at least x lines backwards
" quit when a syntax file was already loaded
diff --git a/runtime/syntax/logtalk.vim b/runtime/syntax/logtalk.vim
index a7fe9ce925..bc70ef41b4 100644
--- a/runtime/syntax/logtalk.vim
+++ b/runtime/syntax/logtalk.vim
@@ -330,7 +330,7 @@ syn match logtalkKeyword "\<t\(an\|runcate\)\ze("
syn match logtalkKeyword "\<ceiling\ze("
-" Other arithemtic functors
+" Other arithmetic functors
syn match logtalkOperator "\*\*"
syn match logtalkKeyword "\<s\(in\|qrt\)\ze("
diff --git a/runtime/syntax/lss.vim b/runtime/syntax/lss.vim
index 6ee717bcb4..eceaf75674 100644
--- a/runtime/syntax/lss.vim
+++ b/runtime/syntax/lss.vim
@@ -9,7 +9,7 @@ if exists("b:current_syntax")
endif
" This setup is probably atypical for a syntax highlighting file, because
-" most of it is not really intended to be overrideable. Instead, the
+" most of it is not really intended to be overridable. Instead, the
" highlighting is supposed to correspond to the highlighting specified by
" the .lss file entries themselves; ie. the "bold" keyword should be bold,
" the "red" keyword should be red, and so forth. The exceptions to this
diff --git a/runtime/syntax/pymanifest.vim b/runtime/syntax/pymanifest.vim
index 54295c45dc..26bdf797e0 100644
--- a/runtime/syntax/pymanifest.vim
+++ b/runtime/syntax/pymanifest.vim
@@ -20,7 +20,7 @@ syn match pymanifestComment /\\\@1<!#.*/ contains=pymanifestTodo
" Commands
syn keyword pymanifestCommand
\ include exclude
- \ recursive-include resursive-exclude
+ \ recursive-include recursive-exclude
\ global-include global-exclude
\ graft prune
diff --git a/runtime/syntax/rmd.vim b/runtime/syntax/rmd.vim
index f849af97d2..0eab0e6fab 100644
--- a/runtime/syntax/rmd.vim
+++ b/runtime/syntax/rmd.vim
@@ -81,7 +81,7 @@ else
syn match yamlEscape contained '\\\%([\\"abefnrtv\^0_ NLP\n]\|x\x\x\|u\x\{4}\|U\x\{8}\)'
syn match yamlSingleEscape contained "''"
syn match yamlComment /#.*/ contained
- " A second colon is a syntax error, unles within a string or following !expr
+ " A second colon is a syntax error, unless within a string or following !expr
syn match yamlColonError /:\s*[^'^"^!]*:/ contained
if &filetype == 'quarto'
syn region pandocYAMLHeader matchgroup=rmdYamlBlockDelim start=/\%(\%^\|\_^\s*\n\)\@<=\_^-\{3}\ze\n.\+/ end=/^---$/ keepend contains=rmdYamlFieldTtl,yamlFlowString,yamlComment,yamlColonError
diff --git a/runtime/syntax/sgml.vim b/runtime/syntax/sgml.vim
index 00d58d11f2..ed8fa8cf12 100644
--- a/runtime/syntax/sgml.vim
+++ b/runtime/syntax/sgml.vim
@@ -294,7 +294,7 @@ syn sync minlines=100
hi def link sgmlTodo Todo
hi def link sgmlTag Function
hi def link sgmlEndTag Identifier
-" SGML specifig
+" SGML specific
hi def link sgmlAbbrEndTag Identifier
hi def link sgmlEmptyTag Function
hi def link sgmlEntity Statement
diff --git a/runtime/syntax/slrnrc.vim b/runtime/syntax/slrnrc.vim
index cf0734ae85..004bdd1bb1 100644
--- a/runtime/syntax/slrnrc.vim
+++ b/runtime/syntax/slrnrc.vim
@@ -94,7 +94,7 @@ syn region slrnrcColorObjStr contained matchgroup=slrnrcColorObj start=+"+ end=
syn keyword slrnrcColorVal contained default
syn keyword slrnrcColorVal contained black blue brightblue brightcyan brightgreen brightmagenta brightred brown cyan gray green lightgray magenta red white yellow
syn region slrnrcColorValStr contained matchgroup=slrnrcColorVal start=+"+ end=+"+ oneline contains=slrnrcColorVal,slrnrcSpaceError
-" Mathcing a function with three arguments
+" Matching a function with three arguments
syn keyword slrnrcColor contained color
syn match slrnrcColorInit contained "^\s*color\s\+\S\+" skipwhite nextgroup=slrnrcColorVal\(Str\)\= contains=slrnrcColor\(Obj\|ObjStr\)\=
syn match slrnrcColorLine "^\s*color\s\+\S\+\s\+\S\+" skipwhite nextgroup=slrnrcColorVal\(Str\)\= contains=slrnrcColor\(Init\|Val\|ValStr\)
diff --git a/runtime/syntax/solidity.vim b/runtime/syntax/solidity.vim
index e552446e10..a46d041a10 100644
--- a/runtime/syntax/solidity.vim
+++ b/runtime/syntax/solidity.vim
@@ -1,10 +1,10 @@
" Vim syntax file
-" Language: Solidity
-" Maintainer: Cothi (jiungdev@gmail.com)
-" Original Author: tomlion (https://github.com/tomlion/vim-solidity/blob/master/syntax/solidity.vim)
-" Last Changed: 2022 Sep 27
+" Language: Solidity
+" Maintainer: Cothi (jiungdev@gmail.com)
+" Original Author: tomlion (https://github.com/tomlion/vim-solidity/blob/master/syntax/solidity.vim)
+" Last Change: 2022 Sep 27
"
-" Additional contributors:
+" Contributors:
" Modified by thesis (https://github.com/thesis/vim-solidity/blob/main/indent/solidity.vim)
if exists("b:current_syntax")
diff --git a/runtime/syntax/spec.vim b/runtime/syntax/spec.vim
index d7d5877943..aed04bc900 100644
--- a/runtime/syntax/spec.vim
+++ b/runtime/syntax/spec.vim
@@ -56,7 +56,7 @@ syn match specListedFilesEtc contained '/etc/'me=e-1
syn match specListedFilesShare contained '/share/'me=e-1
syn cluster specListedFiles contains=specListedFilesBin,specListedFilesLib,specListedFilesDoc,specListedFilesEtc,specListedFilesShare,specListedFilesPrefix,specVariables,specSpecialChar
-"specComands
+"specCommands
syn match specConfigure contained '\./configure'
syn match specTarCommand contained '\<tar\s\+[cxvpzIf]\{,5}\s*'
syn keyword specCommandSpecial contained root
@@ -87,7 +87,7 @@ syn region specSectionMacroBracketArea oneline matchgroup=specSectionMacro start
"TODO %config valid parameters: missingok\|noreplace
"TODO %verify valid parameters: \(not\)\= \(md5\|atime\|...\)
syn region specFilesArea matchgroup=specSection start='^%[Ff][Ii][Ll][Ee][Ss]\>' skip='%\(attrib\|defattr\|attr\|dir\|config\|docdir\|doc\|lang\|license\|verify\|ghost\|exclude\)\>' end='^%[a-zA-Z]'me=e-2 contains=specFilesOpts,specFilesDirective,@specListedFiles,specComment,specCommandSpecial,specMacroIdentifier
-"tip: remember to include new itens in specFilesArea above
+"tip: remember to include new items in specFilesArea above
syn match specFilesDirective contained '%\(attrib\|defattr\|attr\|dir\|config\|docdir\|doc\|lang\|license\|verify\|ghost\|exclude\)\>'
"valid options for certain section headers
diff --git a/runtime/syntax/sqlinformix.vim b/runtime/syntax/sqlinformix.vim
index e01912bc40..71418c556f 100644
--- a/runtime/syntax/sqlinformix.vim
+++ b/runtime/syntax/sqlinformix.vim
@@ -162,7 +162,7 @@ hi def link sqlNumber Number
hi def link sqlBoolean Boolean
hi def link sqlString String
-" === Statment syntax group ===
+" === Statement syntax group ===
hi def link sqlStatement Statement
hi def link sqlConditional Conditional
hi def link sqlRepeat Repeat
diff --git a/runtime/syntax/sqlj.vim b/runtime/syntax/sqlj.vim
index c901145c3c..fd0f8f3d76 100644
--- a/runtime/syntax/sqlj.vim
+++ b/runtime/syntax/sqlj.vim
@@ -16,7 +16,7 @@ endif
" Read the Java syntax to start with
source <sfile>:p:h/java.vim
-" SQLJ extentions
+" SQLJ extensions
" The SQL reserved words, defined as keywords.
syn case ignore
diff --git a/runtime/syntax/squid.vim b/runtime/syntax/squid.vim
index a8abd180a0..186be91e61 100644
--- a/runtime/syntax/squid.vim
+++ b/runtime/syntax/squid.vim
@@ -31,7 +31,7 @@ syn keyword squidConf cache_effective_user cache_host cache_host_acl
syn keyword squidConf cache_host_domain cache_log cache_mem
syn keyword squidConf cache_mem_high cache_mem_low cache_mgr
syn keyword squidConf cachemgr_passwd cache_peer cache_peer_access
-syn keyword squidConf cahce_replacement_policy cache_stoplist
+syn keyword squidConf cache_replacement_policy cache_stoplist
syn keyword squidConf cache_stoplist_pattern cache_store_log cache_swap
syn keyword squidConf cache_swap_high cache_swap_log cache_swap_low
syn keyword squidConf client_db client_lifetime client_netmask
diff --git a/runtime/syntax/tasm.vim b/runtime/syntax/tasm.vim
index 1d6e570752..b8b5e6992b 100644
--- a/runtime/syntax/tasm.vim
+++ b/runtime/syntax/tasm.vim
@@ -1,6 +1,6 @@
" Vim syntax file
" Language: TASM: turbo assembler by Borland
-" Maintaner: FooLman of United Force <foolman@bigfoot.com>
+" Maintainer: FooLman of United Force <foolman@bigfoot.com>
" Last Change: 2012 Feb 03 by Thilo Six, and 2018 Nov 27.
" quit when a syntax file was already loaded
diff --git a/runtime/syntax/tf.vim b/runtime/syntax/tf.vim
index 47775b8637..df6adcf819 100644
--- a/runtime/syntax/tf.vim
+++ b/runtime/syntax/tf.vim
@@ -27,7 +27,7 @@ syn keyword tfVar bamf bg_output borg clearfull cleardone clock connect contai
syn keyword tfVar emulation end_color gag gethostbyname gpri hook hilite contained
syn keyword tfVar hiliteattr histsize hpri insert isize istrip kecho contained
syn keyword tfVar kprefix login lp lpquote maildelay matching max_iter contained
-syn keyword tfVar max_recur mecho more mprefix oldslash promt_sec contained
+syn keyword tfVar max_recur mecho more mprefix oldslash prompt_sec contained
syn keyword tfVar prompt_usec proxy_host proxy_port ptime qecho qprefix contained
syn keyword tfVar quite quitdone redef refreshtime scroll shpause snarf sockmload contained
syn keyword tfVar start_color tabsize telopt sub time_format visual contained
diff --git a/runtime/syntax/tsalt.vim b/runtime/syntax/tsalt.vim
index 8dd2a24df9..6f74ad2eb3 100644
--- a/runtime/syntax/tsalt.vim
+++ b/runtime/syntax/tsalt.vim
@@ -83,11 +83,11 @@ syn keyword tsaltFunction vGetChrs vGetChrsA vPutChr vPutChrs
syn keyword tsaltFunction vPutChrsA vRstrArea vSaveArea
" Dynamic Data Exchange (DDE) Operations
-syn keyword tsaltFunction DDEExecute DDEInitate DDEPoke DDERequest
+syn keyword tsaltFunction DDEExecute DDEInitiate DDEPoke DDERequest
syn keyword tsaltFunction DDETerminate DDETerminateAll
"END FUNCTIONS
-"PREDEFINED VARAIABLES
+"PREDEFINED VARIABLES
syn keyword tsaltSysVar _add_lf _alarm_on _answerback_str _asc_rcrtrans
syn keyword tsaltSysVar _asc_remabort _asc_rlftrans _asc_scpacing
syn keyword tsaltSysVar _asc_scrtrans _asc_secho _asc_slpacing
@@ -106,7 +106,7 @@ syn keyword tsaltSysVar _scr_chk_key _script_dir _sound_on
syn keyword tsaltSysVar _strip_high _swap_bs _telix_dir _up_dir
syn keyword tsaltSysVar _usage_fname _zmodauto _zmod_rcrash
syn keyword tsaltSysVar _zmod_scrash
-"END PREDEFINED VARAIABLES
+"END PREDEFINED VARIABLES
"TYPE
syn keyword tsaltType str int
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index fa2aecff86..3638ea19f4 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -877,7 +877,8 @@ static bool has_more_inline_virt(winlinevars_T *wlv, ptrdiff_t v)
DecorRange *item = &kv_A(state->active, i);
if (item->start_row != state->row
|| !kv_size(item->decor.virt_text)
- || item->decor.virt_text_pos != kVTInline) {
+ || item->decor.virt_text_pos != kVTInline
+ || item->decor.virt_text_width == 0) {
continue;
}
if (item->draw_col >= -1 && item->start_col >= v) {
@@ -899,7 +900,8 @@ static void handle_inline_virtual_text(win_T *wp, winlinevars_T *wlv, ptrdiff_t
DecorRange *item = &kv_A(state->active, i);
if (item->start_row != state->row
|| !kv_size(item->decor.virt_text)
- || item->decor.virt_text_pos != kVTInline) {
+ || item->decor.virt_text_pos != kVTInline
+ || item->decor.virt_text_width == 0) {
continue;
}
if (item->draw_col >= -1 && item->start_col == v) {
@@ -935,6 +937,7 @@ static void handle_inline_virtual_text(win_T *wp, winlinevars_T *wlv, ptrdiff_t
// If the text didn't reach until the first window
// column we need to skip cells.
if (wlv->skip_cells > 0) {
+ // FIXME: this should use virt_text_width instead
int virt_text_len = wlv->n_attr;
if (virt_text_len > wlv->skip_cells) {
int len = mb_charlen2bytelen(wlv->p_extra, wlv->skip_cells);
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 3f4ba3c811..993e5bf495 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -879,7 +879,7 @@ void curs_columns(win_T *wp, int may_scroll)
// column
char *const sbr = get_showbreak_value(wp);
if (*sbr && *get_cursor_pos_ptr() == NUL
- && wp->w_wcol == vim_strsize(sbr)) {
+ && wp->w_wcol == (wp->w_width_inner - width2) + vim_strsize(sbr)) {
wp->w_wcol = 0;
}
}
diff --git a/src/nvim/plines.c b/src/nvim/plines.c
index c2447103dc..526c2f8e08 100644
--- a/src/nvim/plines.c
+++ b/src/nvim/plines.c
@@ -319,6 +319,7 @@ void init_chartabsize_arg(chartabsize_T *cts, win_T *wp, linenr_T lnum, colnr_T
cts->cts_vcol = col;
cts->cts_line = line;
cts->cts_ptr = ptr;
+ cts->cts_max_head_vcol = 0;
cts->cts_cur_text_width_left = 0;
cts->cts_cur_text_width_right = 0;
cts->cts_has_virt_text = false;
@@ -404,8 +405,13 @@ int win_lbr_chartabsize(chartabsize_T *cts, int *headp)
return win_chartabsize(wp, s, vcol);
}
+ bool has_lcs_eol = wp->w_p_list && wp->w_p_lcs_chars.eol != NUL;
+
// First get normal size, without 'linebreak' or inline virtual text
int size = win_chartabsize(wp, s, vcol);
+ if (*s == NUL && !has_lcs_eol) {
+ size = 0; // NUL is not displayed
+ }
if (cts->cts_has_virt_text) {
int tab_size = size;
@@ -491,14 +497,11 @@ int win_lbr_chartabsize(chartabsize_T *cts, int *headp)
}
// May have to add something for 'breakindent' and/or 'showbreak'
- // string at start of line.
- // Do not use 'showbreak' at the NUL after the text.
+ // string at the start of a screen line.
int head = mb_added;
- char *const sbr
- // XXX: there should be a better check deeper below
- = ((c == NUL && cts->cts_cur_text_width_left + cts->cts_cur_text_width_right == 0)
- ? empty_option : get_showbreak_value(wp));
- if ((*sbr != NUL || wp->w_p_bri) && wp->w_p_wrap) {
+ char *const sbr = get_showbreak_value(wp);
+ // When "size" is 0, no new screen line is started.
+ if (size > 0 && wp->w_p_wrap && (*sbr != NUL || wp->w_p_bri)) {
int col_off_prev = win_col_off(wp);
int width2 = wp->w_width_inner - col_off_prev + win_col_off2(wp);
colnr_T wcol = vcol + col_off_prev;
@@ -542,35 +545,33 @@ int win_lbr_chartabsize(chartabsize_T *cts, int *headp)
if (wp->w_p_bri) {
head_mid += get_breakindent_win(wp, line);
}
- if (head_mid > 0) {
- if (wcol + size > wp->w_width_inner) {
- // Calculate effective window width.
- int prev_rem = wp->w_width_inner - wcol;
- int width = width2 - head_mid;
-
- if (width <= 0) {
- width = 1;
+ if (head_mid > 0 && wcol + size > wp->w_width_inner) {
+ // Calculate effective window width.
+ int prev_rem = wp->w_width_inner - wcol;
+ int width = width2 - head_mid;
+
+ if (width <= 0) {
+ width = 1;
+ }
+ // divide "size - prev_width" by "width", rounding up
+ int cnt = (size - prev_rem + width - 1) / width;
+ added += cnt * head_mid;
+
+ if (max_head_vcol == 0 || vcol + size + added < max_head_vcol) {
+ head += cnt * head_mid;
+ } else if (max_head_vcol > vcol + head_prev + prev_rem) {
+ head += (max_head_vcol - (vcol + head_prev + prev_rem)
+ + width2 - 1) / width2 * head_mid;
+ } else if (max_head_vcol < 0) {
+ int off = 0;
+ if (c != NUL || !(State & MODE_NORMAL)) {
+ off += cts->cts_cur_text_width_left;
}
- // divide "size - prev_width" by "width", rounding up
- int cnt = (size - prev_rem + width - 1) / width;
- added += cnt * head_mid;
-
- if (max_head_vcol == 0 || vcol + size + added < max_head_vcol) {
- head += cnt * head_mid;
- } else if (max_head_vcol > vcol + head_prev + prev_rem) {
- head += (max_head_vcol - (vcol + head_prev + prev_rem)
- + width2 - 1) / width2 * head_mid;
- } else if (max_head_vcol < 0) {
- int off = 0;
- if (c != NUL || !(State & MODE_NORMAL)) {
- off += cts->cts_cur_text_width_left;
- }
- if (c != NUL && (State & MODE_NORMAL)) {
- off += cts->cts_cur_text_width_right;
- }
- if (off >= prev_rem) {
- head += (1 + (off - prev_rem) / width) * head_mid;
- }
+ if (c != NUL && (State & MODE_NORMAL)) {
+ off += cts->cts_cur_text_width_right;
+ }
+ if (off >= prev_rem) {
+ head += (1 + (off - prev_rem) / width) * head_mid;
}
}
}
diff --git a/test/functional/legacy/breakindent_spec.lua b/test/functional/legacy/breakindent_spec.lua
index d7779684a4..ecd2d47f47 100644
--- a/test/functional/legacy/breakindent_spec.lua
+++ b/test/functional/legacy/breakindent_spec.lua
@@ -1,6 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
+local command = helpers.command
local exec = helpers.exec
local feed = helpers.feed
@@ -17,20 +18,15 @@ describe('breakindent', function()
})
screen:attach()
exec([[
+ set listchars=eol:$
let &signcolumn = 'yes'
- let &showbreak = '+'
+ let &showbreak = '++'
+ let &breakindent = v:true
+ let &breakindentopt = 'shift:2'
let leftcol = win_getid()->getwininfo()->get(0, {})->get('textoff')
eval repeat('x', &columns - leftcol - 1)->setline(1)
eval 'second line'->setline(2)
]])
- screen:expect([[
- {1: }^xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
- {1: }second line |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
feed('AX')
screen:expect([[
{1: }xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX|
@@ -40,5 +36,18 @@ describe('breakindent', function()
{0:~ }|
{2:-- INSERT --} |
]])
+ -- No line wraps, so changing 'showbreak' should lead to the same screen.
+ command('setlocal showbreak=+')
+ screen:expect_unchanged()
+ -- The first line now wraps because of "eol" in 'listchars'.
+ command('setlocal list')
+ screen:expect{grid=[[
+ {1: }xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX|
+ {1: } {0:+^$} |
+ {1: }second line{0:$} |
+ {0:~ }|
+ {0:~ }|
+ {2:-- INSERT --} |
+ ]]}
end)
end)
diff --git a/test/functional/treesitter/parser_spec.lua b/test/functional/treesitter/parser_spec.lua
index ae7cf58293..56af0c8738 100644
--- a/test/functional/treesitter/parser_spec.lua
+++ b/test/functional/treesitter/parser_spec.lua
@@ -696,6 +696,39 @@ int x = INT_MAX;
end)
end)
+ describe("when using injection.self", function()
+ it("should inject the source language", function()
+ exec_lua([[
+ parser = vim.treesitter.get_parser(0, "c", {
+ injections = {
+ c = '(preproc_def (preproc_arg) @injection.content (#set! injection.self)) (preproc_function_def value: (preproc_arg) @injection.content (#set! injection.self))'}})
+ parser:parse(true)
+ ]])
+
+ eq("table", exec_lua("return type(parser:children().c)"))
+ eq(5, exec_lua("return #parser:children().c:trees()"))
+ eq({
+ {0, 0, 7, 0}, -- root tree
+ {3, 14, 3, 17}, -- VALUE 123
+ {4, 15, 4, 18}, -- VALUE1 123
+ {5, 15, 5, 18}, -- VALUE2 123
+ {1, 26, 1, 63}, -- READ_STRING(x, y) (char *)read_string((x), (size_t)(y))
+ {2, 29, 2, 66} -- READ_STRING_OK(x, y) (char *)read_string((x), (size_t)(y))
+ }, get_ranges())
+
+ helpers.feed('ggo<esc>')
+ eq(5, exec_lua("return #parser:children().c:trees()"))
+ eq({
+ {0, 0, 8, 0}, -- root tree
+ {4, 14, 4, 17}, -- VALUE 123
+ {5, 15, 5, 18}, -- VALUE1 123
+ {6, 15, 6, 18}, -- VALUE2 123
+ {2, 26, 2, 63}, -- READ_STRING(x, y) (char *)read_string((x), (size_t)(y))
+ {3, 29, 3, 66} -- READ_STRING_OK(x, y) (char *)read_string((x), (size_t)(y))
+ }, get_ranges())
+ end)
+ end)
+
describe("when using the offset directive", function()
it("should shift the range by the directive amount", function()
exec_lua([[
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index 4e3214da71..0a3a2e4e29 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -1748,7 +1748,7 @@ describe('decorations: inline virtual text', function()
]]}
end)
- it('works with empty chunk', function()
+ it('works with 0-width chunk', function()
screen:try_resize(50, 10)
insert(example_text)
feed 'gg'
@@ -1766,7 +1766,22 @@ describe('decorations: inline virtual text', function()
]]}
meths.buf_set_extmark(0, ns, 0, 5, {virt_text={{''}, {''}}, virt_text_pos='inline'})
- meths.buf_set_extmark(0, ns, 1, 14, {virt_text={{''}, {': ', 'Special'}, {'string', 'Type'}}, virt_text_pos='inline'})
+ meths.buf_set_extmark(0, ns, 1, 14, {virt_text={{''}, {': ', 'Special'}}, virt_text_pos='inline'})
+ meths.buf_set_extmark(0, ns, 1, 48, {virt_text={{''}, {''}}, virt_text_pos='inline'})
+ screen:expect{grid=[[
+ ^for _,item in ipairs(items) do |
+ local text{10:: }, hl_id_cell, count = unpack(item)|
+ if hl_id_cell ~= nil then |
+ hl_id = hl_id_cell |
+ end |
+ for _ = 1, (count or 1) do |
+ local cell = line[colpos] |
+ cell.text = text |
+ cell.hl_id = hl_id |
+ |
+ ]]}
+
+ meths.buf_set_extmark(0, ns, 1, 14, {virt_text={{''}, {'string', 'Type'}}, virt_text_pos='inline'})
feed('V')
screen:expect{grid=[[
^f{7:or _,item in ipairs(items) do} |
@@ -2886,6 +2901,15 @@ bbbbbbb]])
{1:~ }|
|
]]}
+ feed('zbx')
+ screen:expect{grid=[[
+ 1 ^12312312312312312312312312|
+ {1:+}31231231231231231231231|
+ {1:+}23123123123123123123 |
+ {1:~ }|
+ {1:~ }|
+ |
+ ]]}
end
describe('with showbreak, smoothscroll', function()
diff --git a/test/old/testdir/test_breakindent.vim b/test/old/testdir/test_breakindent.vim
index 8d64c0dc90..3ce7d1386b 100644
--- a/test/old/testdir/test_breakindent.vim
+++ b/test/old/testdir/test_breakindent.vim
@@ -937,7 +937,9 @@ func Test_cursor_position_with_showbreak()
let lines =<< trim END
vim9script
&signcolumn = 'yes'
- &showbreak = '+ '
+ &showbreak = '++'
+ &breakindent = true
+ &breakindentopt = 'shift:2'
var leftcol: number = win_getid()->getwininfo()->get(0, {})->get('textoff')
repeat('x', &columns - leftcol - 1)->setline(1)
'second line'->setline(2)
@@ -946,7 +948,13 @@ func Test_cursor_position_with_showbreak()
let buf = RunVimInTerminal('-S XscriptShowbreak', #{rows: 6})
call term_sendkeys(buf, "AX")
- call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak', {})
+ call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_1', {})
+ " No line wraps, so changing 'showbreak' should lead to the same screen.
+ call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal showbreak=+\<CR>")
+ call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_1', {})
+ " The first line now wraps because of "eol" in 'listchars'.
+ call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal list\<CR>")
+ call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_2', {})
call StopVimInTerminal(buf)
endfunc