Skip to content

Commit 7203179

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents ab4a3e2 + 16abd99 commit 7203179

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2488
-135
lines changed

runtime/doc/builtin.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ digraph_setlist({digraphlist}) Boolean register multiple |digraph|s
156156
echoraw({expr}) none output {expr} as-is
157157
empty({expr}) Number |TRUE| if {expr} is empty
158158
environ() Dict return environment variables
159+
err_teapot() Number produce error 418
159160
escape({string}, {chars}) String escape {chars} in {string} with '\'
160161
eval({string}) any evaluate {string} into its value
161162
eventhandler() Number |TRUE| if inside an event handler
@@ -2203,6 +2204,15 @@ environ() *environ()*
22032204
use this: >
22042205
:echo index(keys(environ()), 'HOME', 0, 1) != -1
22052206
2207+
2208+
err_teapot([{expr}]) *err_teapot()*
2209+
Produce an error with number 418, needed for implementation of
2210+
RFC 2325.
2211+
If {expr} is present and it is TRUE error 503 is given,
2212+
indicating that coffee is temporarily not available.
2213+
If {expr} is present it must be a String.
2214+
2215+
22062216
escape({string}, {chars}) *escape()*
22072217
Escape the characters in {chars} that occur in {string} with a
22082218
backslash. Example: >

runtime/doc/options.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9054,11 +9054,11 @@ A jump table for the options with a short description can be found at |Q_op|.
90549054
displayed when 'verbosefile' is set.
90559055

90569056
*'viewdir'* *'vdir'*
9057-
'viewdir' 'vdir' string (default for Amiga and Win32:
9058-
"$VIM/vimfiles/view",
9059-
for Unix: "~/.vim/view",
9060-
for macOS: "$VIM:vimfiles:view"
9061-
for VMS: "sys$login:vimfiles/view")
9057+
'viewdir' 'vdir' string (default for Amiga "home:vimfiles/view",
9058+
for Win32: "$HOME/vimfiles/view",
9059+
for Unix: "$HOME/.vim/view",
9060+
for macOS: "$VIM/vimfiles/view"
9061+
for VMS: "sys$login:vimfiles/view")
90629062
global
90639063
{not available when compiled without the |+mksession|
90649064
feature}

runtime/doc/terminal.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*terminal.txt* For Vim version 9.0. Last change: 2023 Jun 09
1+
*terminal.txt* For Vim version 9.0. Last change: 2023 Jun 28
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1541,6 +1541,20 @@ If there is no g:termdebug_config you can use: >
15411541
let g:termdebug_popup = 0
15421542
15431543
1544+
Change default signs ~
1545+
*termdebug_signs*
1546+
Termdebug uses the last two characters of the breakpoint ID in the
1547+
signcolumn to represent breakpoints. For example, breakpoint ID 133
1548+
will be displayed as `33`.
1549+
1550+
If you want to customize the breakpoint signs: >
1551+
let g:termdebug_config['sign'] = '>>'
1552+
If there is no g:terminal_config yet you can use: >
1553+
let g:termdebug_config = {'sign': '>>'}
1554+
1555+
After this, breakpoints will be displayed as `>>` in the signcolumn.
1556+
1557+
15441558
Window toolbar ~
15451559
*termdebug_winbar*
15461560
By default the Termdebug plugin creates a window toolbar if the mouse is

runtime/doc/usr_41.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,7 @@ Inter-process communication: *channel-functions*
12321232
json_decode() decode a JSON string to Vim types
12331233
js_encode() encode an expression to a JSON string
12341234
js_decode() decode a JSON string to Vim types
1235+
err_teapot() give error 418 or 503
12351236

12361237
Jobs: *job-functions*
12371238
job_start() start a job

runtime/filetype.vim

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-ol
2121
\ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r"))
2222
au BufNewFile,BufRead *~
2323
\ let s:name = expand("<afile>") |
24-
\ let s:short = substitute(s:name, '\~$', '', '') |
24+
\ let s:short = substitute(s:name, '\~\+$', '', '') |
2525
\ if s:name != s:short && s:short != "" |
2626
\ exe "doau filetypedetect BufRead " . fnameescape(s:short) |
2727
\ endif |
@@ -266,11 +266,11 @@ au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
266266
" BSDL
267267
au BufNewFile,BufRead *.bsd,*.bsdl setf bsdl
268268

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

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

1514+
" PEM (Privacy-Enhanced Mail)
1515+
au BufNewFile,BufRead *.pem,*.cer,*.crt,*.csr setf pem
1516+
15141517
" Perl
15151518
if has("fname_case")
15161519
au BufNewFile,BufRead *.pl,*.PL call dist#ft#FTpl()
@@ -1961,6 +1964,9 @@ au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias
19611964
au BufNewFile,BufRead *.zig setf zig
19621965
au BufNewFile,BufRead *.zir setf zir
19631966

1967+
" Zserio
1968+
au BufNewFile,BufRead *.zs setf zserio
1969+
19641970
" Z-Shell script (patterns ending in a star further below)
19651971
au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh
19661972
au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump setf zsh
@@ -2602,9 +2608,9 @@ au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
26022608
" Bazaar version control
26032609
au BufNewFile,BufRead bzr_log.* setf bzr
26042610

2605-
" Bazel build file
2611+
" Bazel and Buck2 build file
26062612
if !has("fname_case")
2607-
au BufNewFile,BufRead *.BUILD,BUILD setf bzl
2613+
au BufNewFile,BufRead *.BUILD,BUILD,BUCK setf bzl
26082614
endif
26092615

26102616
" BIND zone

runtime/pack/dist/opt/termdebug/plugin/termdebug.vim

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"
33
" Author: Bram Moolenaar
44
" Copyright: Vim license applies, see ":help license"
5-
" Last Change: 2022 Nov 10
5+
" Last Change: 2023 Jun 24
66
"
77
" WORK IN PROGRESS - The basics works stable, more to come
88
" Note: In general you need at least GDB 7.12 because this provides the
@@ -81,6 +81,8 @@ func s:Breakpoint2SignNumber(id, subid)
8181
return s:break_id + a:id * 1000 + a:subid
8282
endfunction
8383

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

93-
call s:Highlight(1, '', &background)
94-
hi default debugBreakpoint term=reverse ctermbg=red guibg=red
95-
hi default debugBreakpointDisabled term=reverse ctermbg=gray guibg=gray
95+
" Define the default highlighting, using the current 'background' value.
96+
func s:InitHighlight()
97+
call s:Highlight(1, '', &background)
98+
hi default debugBreakpoint term=reverse ctermbg=red guibg=red
99+
hi default debugBreakpointDisabled term=reverse ctermbg=gray guibg=gray
100+
endfunc
101+
102+
" Setup an autocommand to redefine the default highlight when the colorscheme
103+
" is changed.
104+
func s:InitAutocmd()
105+
augroup TermDebug
106+
autocmd!
107+
autocmd ColorScheme * call s:InitHighlight()
108+
augroup END
109+
endfunc
96110

97111
" Get the command to execute the debugger as a list, defaults to ["gdb"].
98112
func s:GetCommand()
@@ -588,14 +602,14 @@ func s:GdbOutCallback(channel, text)
588602
return
589603
endif
590604
if a:text =~ '^\^error,msg='
591-
let text = s:DecodeMessage(a:text[11:])
605+
let text = s:DecodeMessage(a:text[11:], v:false)
592606
if exists('s:evalexpr') && text =~ 'A syntax error in expression, near\|No symbol .* in current context'
593607
" Silently drop evaluation errors.
594608
unlet s:evalexpr
595609
return
596610
endif
597611
elseif a:text[0] == '~'
598-
let text = s:DecodeMessage(a:text[1:])
612+
let text = s:DecodeMessage(a:text[1:], v:false)
599613
else
600614
call s:CommOutput(a:channel, a:text)
601615
return
@@ -611,21 +625,20 @@ func s:GdbOutCallback(channel, text)
611625
call win_gotoid(curwinid)
612626
endfunc
613627

614-
" Decode a message from gdb. quotedText starts with a ", return the text up
628+
" Decode a message from gdb. "quotedText" starts with a ", return the text up
615629
" to the next ", unescaping characters:
616-
" - remove line breaks
617-
" - change \\t to \t
630+
" - remove line breaks (unless "literal" is v:true)
631+
" - change \\t to \t (unless "literal" is v:true)
618632
" - change \0xhh to \xhh (disabled for now)
619633
" - change \ooo to octal
620634
" - change \\ to \
621-
func s:DecodeMessage(quotedText)
635+
func s:DecodeMessage(quotedText, literal)
622636
if a:quotedText[0] != '"'
623637
echoerr 'DecodeMessage(): missing quote in ' . a:quotedText
624638
return
625639
endif
626-
return a:quotedText
627-
\ ->substitute('^"\|".*\|\\n', '', 'g')
628-
\ ->substitute('\\t', "\t", 'g')
640+
let msg = a:quotedText
641+
\ ->substitute('^"\|".*', '', 'g')
629642
" multi-byte characters arrive in octal form
630643
" NULL-values must be kept encoded as those break the string otherwise
631644
\ ->substitute('\\000', s:NullRepl, 'g')
@@ -637,6 +650,13 @@ func s:DecodeMessage(quotedText)
637650
" \ ->substitute('\\0x00', s:NullRepl, 'g')
638651
\ ->substitute('\\\\', '\', 'g')
639652
\ ->substitute(s:NullRepl, '\\000', 'g')
653+
if !a:literal
654+
return msg
655+
\ ->substitute('\\t', "\t", 'g')
656+
\ ->substitute('\\n', '', 'g')
657+
else
658+
return msg
659+
endif
640660
endfunc
641661
const s:NullRepl = 'XXXNULLXXX'
642662

@@ -645,7 +665,7 @@ func s:GetFullname(msg)
645665
if a:msg !~ 'fullname'
646666
return ''
647667
endif
648-
let name = s:DecodeMessage(substitute(a:msg, '.*fullname=', '', ''))
668+
let name = s:DecodeMessage(substitute(a:msg, '.*fullname=', '', ''), v:true)
649669
if has('win32') && name =~ ':\\\\'
650670
" sometimes the name arrives double-escaped
651671
let name = substitute(name, '\\\\', '\\', 'g')
@@ -658,7 +678,7 @@ func s:GetAsmAddr(msg)
658678
if a:msg !~ 'addr='
659679
return ''
660680
endif
661-
let addr = s:DecodeMessage(substitute(a:msg, '.*addr=', '', ''))
681+
let addr = s:DecodeMessage(substitute(a:msg, '.*addr=', '', ''), v:false)
662682
return addr
663683
endfunc
664684

@@ -1381,9 +1401,19 @@ func s:CreateBreakpoint(id, subid, enabled)
13811401
else
13821402
let hiName = "debugBreakpoint"
13831403
endif
1404+
let label = ''
1405+
if exists('g:termdebug_config')
1406+
let label = get(g:termdebug_config, 'sign', '')
1407+
endif
1408+
if label == ''
1409+
let label = substitute(nr, '\..*', '', '')
1410+
if strlen(label) > 2
1411+
let label = strpart(label, strlen(label) - 2)
1412+
endif
1413+
endif
13841414
call sign_define('debugBreakpoint' .. nr,
1385-
\ #{text: substitute(nr, '\..*', '', ''),
1386-
\ texthl: hiName})
1415+
\ #{text: strpart(label, 0, 2),
1416+
\ texthl: hiName})
13871417
endif
13881418
endfunc
13891419

@@ -1522,5 +1552,8 @@ func s:BufUnloaded()
15221552
endfor
15231553
endfunc
15241554

1555+
call s:InitHighlight()
1556+
call s:InitAutocmd()
1557+
15251558
let &cpo = s:keepcpo
15261559
unlet s:keepcpo

runtime/syntax/Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Portable Makefile for running syntax tests.
22

3-
# Override this if needed, e.g. with ../../src/vim
4-
VIMPROG = vim
3+
# Override this if needed, the default assumes Vim was build in the src dir.
4+
#VIMPROG = vim
5+
VIMPROG = ../../src/vim
56

67
# "runtime" relative to "runtime/syntax/testdir"
78
VIMRUNTIME = ../..
@@ -13,15 +14,22 @@ VIMRUNTIME = ../..
1314

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

17+
# Uncomment this line for debugging
18+
# DEBUGLOG = --log testlog
19+
1620
# Run the tests that didn't run yet or failed previously.
1721
# If a test succeeds a testdir/done/{name} file will be written.
1822
# If a test fails a testdir/failed/{name}.dump file will be written.
23+
# Progress and error messages can be found in "testdir/messages".
1924
test:
2025
@# the "vimcmd" file is used by the screendump utils
2126
@echo "../$(VIMPROG)" > testdir/vimcmd
2227
@echo "$(RUN_VIMTEST)" >> testdir/vimcmd
23-
VIMRUNTIME=$(VIMRUNTIME) $(VIMPROG) --clean --not-a-term -u testdir/runtest.vim
28+
VIMRUNTIME=$(VIMRUNTIME) $(VIMPROG) --clean --not-a-term $(DEBUGLOG) -u testdir/runtest.vim
29+
@# FIXME: Temporarily show the whole file to find out what goes wrong
30+
@#tail -n 6 testdir/messages
31+
@cat testdir/messages
2432

2533

2634
clean testclean:
27-
rm -f testdir/failed/* testdir/done/* testdir/vimcmd
35+
rm -f testdir/failed/* testdir/done/* testdir/vimcmd testdir/messages
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
>#+0#0000e05#ffffff0|!| |/|b|i|n|/|d|a|s|h| +0#0000000&@62
2+
|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
3+
|p+0#af5f00255&|r|i|n|t|e|n|v| +0#0000000&|A| @64
4+
|e+0#af5f00255&|c|h|o| +0#e000002&|a| |`+0#e000e06&|#+0#0000e05&|f|o@1|`+0#e000e06&| +0#0000000&|b| @59
5+
|~+0#4040ff13&| @73
6+
|~| @73
7+
|~| @73
8+
|~| @73
9+
|~| @73
10+
|~| @73
11+
|~| @73
12+
|~| @73
13+
|~| @73
14+
|~| @73
15+
|~| @73
16+
|~| @73
17+
|~| @73
18+
|~| @73
19+
|~| @73
20+
|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|
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
|#+0#0000e05#ffffff0|!| |/|b|i|n|/|d|a|s|h| +0#0000000&@62
2+
|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
3+
|p+0#af5f00255&|r|i|n|t|e|n|v| +0#0000000&|A| @64
4+
>e+0#af5f00255&|c|h|o| +0#e000002&|a| |`+0#e000e06&|#+0#0000e05&|f|o@1|`+0#e000e06&| +0#0000000&|b| @59
5+
|~+0#4040ff13&| @73
6+
|~| @73
7+
|~| @73
8+
|~| @73
9+
|~| @73
10+
|~| @73
11+
|~| @73
12+
|~| @73
13+
|~| @73
14+
|~| @73
15+
|~| @73
16+
|~| @73
17+
|~| @73
18+
|~| @73
19+
|~| @73
20+
|:+0#0000000&|r|e|d|r|a|w| @49|4|,|1| @10|A|l@1|
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
>#+0#0000e05#ffffff0|!| |/|b|i|n|/|k|s|h| +0#0000000&@63
2+
|#+0#0000e05&| |s|h|2| +0#0000000&@69
3+
|#+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
4+
|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
5+
|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
6+
@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
7+
@75
8+
|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
9+
|c+0#af5f00255&|a|s|e| +0#0000000&|$+0#e000e06&|V|A|R| +0#0000000&|i+0#af5f00255&|n| +0#0000000&@62
10+
|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
11+
@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
12+
|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
13+
@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
14+
|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
15+
|e+0#af5f00255&|s|a|c| +0#0000000&@70
16+
@75
17+
|#+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
18+
|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
19+
|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
20+
|i|s|_|k|o|r|n|s|h|e|l@1|:| |1|,| @40|1|,|1| @10|T|o|p|

0 commit comments

Comments
 (0)