Skip to content

Commit

Permalink
Merge remote-tracking branch 'vim/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ychin committed Jul 8, 2023
2 parents ab4a3e2 + 16abd99 commit 7203179
Show file tree
Hide file tree
Showing 99 changed files with 2,488 additions and 135 deletions.
10 changes: 10 additions & 0 deletions runtime/doc/builtin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ digraph_setlist({digraphlist}) Boolean register multiple |digraph|s
echoraw({expr}) none output {expr} as-is
empty({expr}) Number |TRUE| if {expr} is empty
environ() Dict return environment variables
err_teapot() Number produce error 418
escape({string}, {chars}) String escape {chars} in {string} with '\'
eval({string}) any evaluate {string} into its value
eventhandler() Number |TRUE| if inside an event handler
Expand Down Expand Up @@ -2203,6 +2204,15 @@ environ() *environ()*
use this: >
:echo index(keys(environ()), 'HOME', 0, 1) != -1
err_teapot([{expr}]) *err_teapot()*
Produce an error with number 418, needed for implementation of
RFC 2325.
If {expr} is present and it is TRUE error 503 is given,
indicating that coffee is temporarily not available.
If {expr} is present it must be a String.


escape({string}, {chars}) *escape()*
Escape the characters in {chars} that occur in {string} with a
backslash. Example: >
Expand Down
10 changes: 5 additions & 5 deletions runtime/doc/options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9054,11 +9054,11 @@ A jump table for the options with a short description can be found at |Q_op|.
displayed when 'verbosefile' is set.

*'viewdir'* *'vdir'*
'viewdir' 'vdir' string (default for Amiga and Win32:
"$VIM/vimfiles/view",
for Unix: "~/.vim/view",
for macOS: "$VIM:vimfiles:view"
for VMS: "sys$login:vimfiles/view")
'viewdir' 'vdir' string (default for Amiga "home:vimfiles/view",
for Win32: "$HOME/vimfiles/view",
for Unix: "$HOME/.vim/view",
for macOS: "$VIM/vimfiles/view"
for VMS: "sys$login:vimfiles/view")
global
{not available when compiled without the |+mksession|
feature}
Expand Down
16 changes: 15 additions & 1 deletion runtime/doc/terminal.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 9.0. Last change: 2023 Jun 09
*terminal.txt* For Vim version 9.0. Last change: 2023 Jun 28


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -1541,6 +1541,20 @@ If there is no g:termdebug_config you can use: >
let g:termdebug_popup = 0
Change default signs ~
*termdebug_signs*
Termdebug uses the last two characters of the breakpoint ID in the
signcolumn to represent breakpoints. For example, breakpoint ID 133
will be displayed as `33`.

If you want to customize the breakpoint signs: >
let g:termdebug_config['sign'] = '>>'
If there is no g:terminal_config yet you can use: >
let g:termdebug_config = {'sign': '>>'}
After this, breakpoints will be displayed as `>>` in the signcolumn.


Window toolbar ~
*termdebug_winbar*
By default the Termdebug plugin creates a window toolbar if the mouse is
Expand Down
1 change: 1 addition & 0 deletions runtime/doc/usr_41.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,7 @@ Inter-process communication: *channel-functions*
json_decode() decode a JSON string to Vim types
js_encode() encode an expression to a JSON string
js_decode() decode a JSON string to Vim types
err_teapot() give error 418 or 503

Jobs: *job-functions*
job_start() start a job
Expand Down
18 changes: 12 additions & 6 deletions runtime/filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-ol
\ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r"))
au BufNewFile,BufRead *~
\ let s:name = expand("<afile>") |
\ let s:short = substitute(s:name, '\~$', '', '') |
\ let s:short = substitute(s:name, '\~\+$', '', '') |
\ if s:name != s:short && s:short != "" |
\ exe "doau filetypedetect BufRead " . fnameescape(s:short) |
\ endif |
Expand Down Expand Up @@ -266,11 +266,11 @@ au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
" BSDL
au BufNewFile,BufRead *.bsd,*.bsdl setf bsdl

" Bazel (http://bazel.io)
" Bazel (https://bazel.build) and Buck2 (https://buck2.build/)
autocmd BufRead,BufNewFile *.bzl,*.bazel,WORKSPACE,WORKSPACE.bzlmod setf bzl
if has("fname_case")
" There is another check for BUILD further below.
autocmd BufRead,BufNewFile *.BUILD,BUILD setf bzl
" There is another check for BUILD and BUCK further below.
autocmd BufRead,BufNewFile *.BUILD,BUILD,BUCK setf bzl
endif

" Busted (Lua unit testing framework - configuration files)
Expand Down Expand Up @@ -1511,6 +1511,9 @@ au BufNewFile,BufRead *.pdf setf pdf
" PCMK - HAE - crm configure edit
au BufNewFile,BufRead *.pcmk setf pcmk

" PEM (Privacy-Enhanced Mail)
au BufNewFile,BufRead *.pem,*.cer,*.crt,*.csr setf pem

" Perl
if has("fname_case")
au BufNewFile,BufRead *.pl,*.PL call dist#ft#FTpl()
Expand Down Expand Up @@ -1961,6 +1964,9 @@ au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias
au BufNewFile,BufRead *.zig setf zig
au BufNewFile,BufRead *.zir setf zir

" Zserio
au BufNewFile,BufRead *.zs setf zserio

" Z-Shell script (patterns ending in a star further below)
au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh
au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump setf zsh
Expand Down Expand Up @@ -2602,9 +2608,9 @@ au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
" Bazaar version control
au BufNewFile,BufRead bzr_log.* setf bzr

" Bazel build file
" Bazel and Buck2 build file
if !has("fname_case")
au BufNewFile,BufRead *.BUILD,BUILD setf bzl
au BufNewFile,BufRead *.BUILD,BUILD,BUCK setf bzl
endif

" BIND zone
Expand Down
67 changes: 50 additions & 17 deletions runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"
" Author: Bram Moolenaar
" Copyright: Vim license applies, see ":help license"
" Last Change: 2022 Nov 10
" Last Change: 2023 Jun 24
"
" WORK IN PROGRESS - The basics works stable, more to come
" Note: In general you need at least GDB 7.12 because this provides the
Expand Down Expand Up @@ -81,6 +81,8 @@ func s:Breakpoint2SignNumber(id, subid)
return s:break_id + a:id * 1000 + a:subid
endfunction

" Define or adjust the default highlighting, using background "new".
" When the 'background' option is set then "old" has the old value.
func s:Highlight(init, old, new)
let default = a:init ? 'default ' : ''
if a:new ==# 'light' && a:old !=# 'light'
Expand All @@ -90,9 +92,21 @@ func s:Highlight(init, old, new)
endif
endfunc

call s:Highlight(1, '', &background)
hi default debugBreakpoint term=reverse ctermbg=red guibg=red
hi default debugBreakpointDisabled term=reverse ctermbg=gray guibg=gray
" Define the default highlighting, using the current 'background' value.
func s:InitHighlight()
call s:Highlight(1, '', &background)
hi default debugBreakpoint term=reverse ctermbg=red guibg=red
hi default debugBreakpointDisabled term=reverse ctermbg=gray guibg=gray
endfunc

" Setup an autocommand to redefine the default highlight when the colorscheme
" is changed.
func s:InitAutocmd()
augroup TermDebug
autocmd!
autocmd ColorScheme * call s:InitHighlight()
augroup END
endfunc

" Get the command to execute the debugger as a list, defaults to ["gdb"].
func s:GetCommand()
Expand Down Expand Up @@ -588,14 +602,14 @@ func s:GdbOutCallback(channel, text)
return
endif
if a:text =~ '^\^error,msg='
let text = s:DecodeMessage(a:text[11:])
let text = s:DecodeMessage(a:text[11:], v:false)
if exists('s:evalexpr') && text =~ 'A syntax error in expression, near\|No symbol .* in current context'
" Silently drop evaluation errors.
unlet s:evalexpr
return
endif
elseif a:text[0] == '~'
let text = s:DecodeMessage(a:text[1:])
let text = s:DecodeMessage(a:text[1:], v:false)
else
call s:CommOutput(a:channel, a:text)
return
Expand All @@ -611,21 +625,20 @@ func s:GdbOutCallback(channel, text)
call win_gotoid(curwinid)
endfunc

" Decode a message from gdb. quotedText starts with a ", return the text up
" Decode a message from gdb. "quotedText" starts with a ", return the text up
" to the next ", unescaping characters:
" - remove line breaks
" - change \\t to \t
" - remove line breaks (unless "literal" is v:true)
" - change \\t to \t (unless "literal" is v:true)
" - change \0xhh to \xhh (disabled for now)
" - change \ooo to octal
" - change \\ to \
func s:DecodeMessage(quotedText)
func s:DecodeMessage(quotedText, literal)
if a:quotedText[0] != '"'
echoerr 'DecodeMessage(): missing quote in ' . a:quotedText
return
endif
return a:quotedText
\ ->substitute('^"\|".*\|\\n', '', 'g')
\ ->substitute('\\t', "\t", 'g')
let msg = a:quotedText
\ ->substitute('^"\|".*', '', 'g')
" multi-byte characters arrive in octal form
" NULL-values must be kept encoded as those break the string otherwise
\ ->substitute('\\000', s:NullRepl, 'g')
Expand All @@ -637,6 +650,13 @@ func s:DecodeMessage(quotedText)
" \ ->substitute('\\0x00', s:NullRepl, 'g')
\ ->substitute('\\\\', '\', 'g')
\ ->substitute(s:NullRepl, '\\000', 'g')
if !a:literal
return msg
\ ->substitute('\\t', "\t", 'g')
\ ->substitute('\\n', '', 'g')
else
return msg
endif
endfunc
const s:NullRepl = 'XXXNULLXXX'

Expand All @@ -645,7 +665,7 @@ func s:GetFullname(msg)
if a:msg !~ 'fullname'
return ''
endif
let name = s:DecodeMessage(substitute(a:msg, '.*fullname=', '', ''))
let name = s:DecodeMessage(substitute(a:msg, '.*fullname=', '', ''), v:true)
if has('win32') && name =~ ':\\\\'
" sometimes the name arrives double-escaped
let name = substitute(name, '\\\\', '\\', 'g')
Expand All @@ -658,7 +678,7 @@ func s:GetAsmAddr(msg)
if a:msg !~ 'addr='
return ''
endif
let addr = s:DecodeMessage(substitute(a:msg, '.*addr=', '', ''))
let addr = s:DecodeMessage(substitute(a:msg, '.*addr=', '', ''), v:false)
return addr
endfunc

Expand Down Expand Up @@ -1381,9 +1401,19 @@ func s:CreateBreakpoint(id, subid, enabled)
else
let hiName = "debugBreakpoint"
endif
let label = ''
if exists('g:termdebug_config')
let label = get(g:termdebug_config, 'sign', '')
endif
if label == ''
let label = substitute(nr, '\..*', '', '')
if strlen(label) > 2
let label = strpart(label, strlen(label) - 2)
endif
endif
call sign_define('debugBreakpoint' .. nr,
\ #{text: substitute(nr, '\..*', '', ''),
\ texthl: hiName})
\ #{text: strpart(label, 0, 2),
\ texthl: hiName})
endif
endfunc

Expand Down Expand Up @@ -1522,5 +1552,8 @@ func s:BufUnloaded()
endfor
endfunc

call s:InitHighlight()
call s:InitAutocmd()

let &cpo = s:keepcpo
unlet s:keepcpo
16 changes: 12 additions & 4 deletions runtime/syntax/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Portable Makefile for running syntax tests.

# Override this if needed, e.g. with ../../src/vim
VIMPROG = vim
# Override this if needed, the default assumes Vim was build in the src dir.
#VIMPROG = vim
VIMPROG = ../../src/vim

# "runtime" relative to "runtime/syntax/testdir"
VIMRUNTIME = ../..
Expand All @@ -13,15 +14,22 @@ VIMRUNTIME = ../..

RUN_VIMTEST = VIMRUNTIME=$(VIMRUNTIME) $(VALGRIND) $(ENVVARS) ../$(VIMPROG) -f $(GUI_FLAG)

# Uncomment this line for debugging
# DEBUGLOG = --log testlog

# Run the tests that didn't run yet or failed previously.
# If a test succeeds a testdir/done/{name} file will be written.
# If a test fails a testdir/failed/{name}.dump file will be written.
# Progress and error messages can be found in "testdir/messages".
test:
@# the "vimcmd" file is used by the screendump utils
@echo "../$(VIMPROG)" > testdir/vimcmd
@echo "$(RUN_VIMTEST)" >> testdir/vimcmd
VIMRUNTIME=$(VIMRUNTIME) $(VIMPROG) --clean --not-a-term -u testdir/runtest.vim
VIMRUNTIME=$(VIMRUNTIME) $(VIMPROG) --clean --not-a-term $(DEBUGLOG) -u testdir/runtest.vim
@# FIXME: Temporarily show the whole file to find out what goes wrong
@#tail -n 6 testdir/messages
@cat testdir/messages


clean testclean:
rm -f testdir/failed/* testdir/done/* testdir/vimcmd
rm -f testdir/failed/* testdir/done/* testdir/vimcmd testdir/messages
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/sh_01_00.dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
>#+0#0000e05#ffffff0|!| |/|b|i|n|/|d|a|s|h| +0#0000000&@62
|e+0#af5f00255&|x|p|o|r|t| +0#0000000&|`+0#e000e06&|e+0#af5f00255&|c|h|o| +0#e000002&|'+0#af5f00255&|A+0#e000002&|=|B|'+0#af5f00255&|`+0#e000e06&| +0#0000000&@55
|p+0#af5f00255&|r|i|n|t|e|n|v| +0#0000000&|A| @64
|e+0#af5f00255&|c|h|o| +0#e000002&|a| |`+0#e000e06&|#+0#0000e05&|f|o@1|`+0#e000e06&| +0#0000000&|b| @59
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|i+0#0000000&|s|_|d|a|s|h|:| |1|,| |i|s|_|p|o|s|i|x|:| |1|,| |i|s|_|s|h|:| |1|,| @22|1|,|1| @10|A|l@1|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/sh_01_99.dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
|#+0#0000e05#ffffff0|!| |/|b|i|n|/|d|a|s|h| +0#0000000&@62
|e+0#af5f00255&|x|p|o|r|t| +0#0000000&|`+0#e000e06&|e+0#af5f00255&|c|h|o| +0#e000002&|'+0#af5f00255&|A+0#e000002&|=|B|'+0#af5f00255&|`+0#e000e06&| +0#0000000&@55
|p+0#af5f00255&|r|i|n|t|e|n|v| +0#0000000&|A| @64
>e+0#af5f00255&|c|h|o| +0#e000002&|a| |`+0#e000e06&|#+0#0000e05&|f|o@1|`+0#e000e06&| +0#0000000&|b| @59
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|:+0#0000000&|r|e|d|r|a|w| @49|4|,|1| @10|A|l@1|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/sh_02_00.dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
>#+0#0000e05#ffffff0|!| |/|b|i|n|/|k|s|h| +0#0000000&@63
|#+0#0000e05&| |s|h|2| +0#0000000&@69
|#+0#0000e05&| @1|J|u|l| |2|8|,| |2|0|1|8|:| |i|n|t|r|o|d|u|c|e|d| |s|h|C|o|m@1|a|n|d|S|u|b|B|Q|,| |w|h|i|c|h| |i|s| |*|n|o|t|*| |i|n|c|l|u|d|e|d| |i|n| |a| |s|h
|S|u|b|C|o|m@1|a|n|d|L|i|s|t| |(|s|o| |i|t|s| |n|o|t| |r|e|c|u|r|s|i|v|e|)| +0#0000000&@37
|c+0#00e0e07&@2|=+0#0000000&|`+0#e000e06&|e+0#af5f00255&|c|h|o| +0#e000002&|"+0#af5f00255&|t+0#e000002&|e|s|t|"+0#af5f00255&|`+0#e000e06&| +0#0000000&@57
@8|c+0#00e0e07&@2|=+0#0000000&|`+0#e000e06&|e+0#af5f00255&|c|h|o| +0#e000002&|"+0#af5f00255&|t+0#e000002&|e|s|t|"+0#af5f00255&|`+0#e000e06&| +0#0000000&@49
@75
|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
|c+0#af5f00255&|a|s|e| +0#0000000&|$+0#e000e06&|V|A|R| +0#0000000&|i+0#af5f00255&|n| +0#0000000&@62
|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
@8|x|||y|||z|)+0#af5f00255&| +0#0000000&|e+0#af5f00255&|c|h|o| +0#e000002&|x|y|z| |;+0#af5f00255&@1| +0#0000000&@48
|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
@8|a|||b|||c|)+0#af5f00255&| +0#0000000&|e+0#af5f00255&|c|h|o| +0#e000002&|a|b|c| |;+0#af5f00255&@1| +0#0000000&@48
|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
|e+0#af5f00255&|s|a|c| +0#0000000&@70
@75
|#+0#0000e05&| |J|u|l| |2|6|,| |2|0|1|8|:| |w|h|y| |i|s|n|'|t| |`|.@1|`| |b|e|i|n|g| |t|e|r|m|i|n|a|t|e|d| |p|r|o|p|e|r|l|y|?| +0#0000000&@17
|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
|c+0#af5f00255&|a|s|e| +0#0000000&|"+0#af5f00255&|$+0#e000e06&|a@2|"+0#af5f00255&| +0#0000000&|i+0#af5f00255&|n| +0#0000000&@60
|i|s|_|k|o|r|n|s|h|e|l@1|:| |1|,| @40|1|,|1| @10|T|o|p|
Loading

0 comments on commit 7203179

Please sign in to comment.