Compare commits

...

7 Commits

Author SHA1 Message Date
Christian Brabandt
c9a4a8ab28 patch 9.0.1663: Termdebug on MS-Windows: some file names are not recognized
Problem:    Termdebug on MS-Windows: some file names are not recognized.
Solution:   Do not always change \t and \n. (Christian Brabandt,
            closes #12565, closes #12560, closes #12550)
2023-06-24 20:02:25 +01:00
Bram Moolenaar
4e2406c7a9 patch 9.0.1662: crash when using a class member twice
Problem:    Crash when using a class member twice. (Christian J. Robinson)
Solution:   Make a copy of the value.
2023-06-24 19:22:21 +01:00
Son Luong Ngoc
b46e0f3263 patch 9.0.1661: BUCK files are not recognized
Problem:    BUCK files are not recognized.
Solution:   Recognize BUCK files as "bzl". (Son Luong Ngoc, closes #12564)
2023-06-24 17:11:04 +01:00
Yegappan Lakshmanan
2d8e998544 patch 9.0.1660: error for using matchfuzzy() returning a list of dicts
Problem:    Error for using matchfuzzy() in Vim9 script returning a list of
            dicts.
Solution:   Make return type of matchfuzzy() list<any>. (Yegappan Lakshmanan,
            closes #12574)
2023-06-24 16:42:25 +01:00
Christian Brabandt
279de0cd1f patch 9.0.1659: Termdebug: default highlight cleared if changing colorscheme
Problem:    Termdebug: default highlight cleared when changing colorscheme.
Solution:   Use a ColorScheme autocommand. (Christian Brabandt, closes #12566,
            closes #12555)
2023-06-24 14:20:36 +01:00
Christian Brabandt
c8b6d4b378 patch 9.0.1658: autoload files for "zig" are not installed
Problem:    Autoload files for "zig" are not installed.
Solution:   Add install and uninstall rules in the makefile. (Christian
            Brabandt, closes #12577, closes #12567)
2023-06-24 13:30:04 +01:00
Bram Moolenaar
79186bee78 patch 9.0.1657: one more syntax test depends on the system
Problem:    One more syntax test depends on the system.
Solution:   Use "dash" instead of "sh".
2023-06-24 01:35:51 +01:00
11 changed files with 105 additions and 31 deletions

View File

@@ -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)
@@ -2605,9 +2605,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

View File

@@ -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
@@ -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'
@@ -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()
@@ -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
@@ -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')
@@ -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'
@@ -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')
@@ -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
@@ -1522,5 +1542,8 @@ func s:BufUnloaded()
endfor
endfunc
call s:InitHighlight()
call s:InitAutocmd()
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@@ -1,4 +1,4 @@
>#+0#0000e05#ffffff0|!|/|b|i|n|/|s|h| |-|x| +0#0000000&@62
>#+0#0000e05#ffffff0|!|/|b|i|n|/|d|a|s|h| |-|x| +0#0000000&@60
|#+0#0000e05&| |s|h|5| +0#0000000&@69
|#+0#0000e05&| |N|o|t|e| |t|h|a|t| |t|h|i|s| |i|s| |s|p|e|c|i|a|l| |f|o|r| |s|h|.| |k|s|h| |w|i|l@1| |b|e| |a|n| |e|x|t|r|a| |f|i|l|e| |l|a|t|e|r|.| +0#0000000&@6
|#+0#0000e05&| |N|o|t|e| |t|o@1|,| |t|h|a|t| |s|h| |a|n|d| |k|s|h| |a|l@1|o|w| |$|{|v|a|r|:|-|s|u|b|}| |a|s| |w|e|l@1| |a|s| |$|{|v|a|r|-|s|u|b|}|!| +0#0000000&@6

View File

@@ -1,4 +1,4 @@
#!/bin/sh -x
#!/bin/dash -x
# sh5
# Note that this is special for sh. ksh will be an extra file later.
# Note too, that sh and ksh allow ${var:-sub} as well as ${var-sub}!

View File

@@ -2332,8 +2332,8 @@ installruntime: installrtbase installmacros installpack installtutor installspel
# Also install most of the other runtime files.
installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(VIMTARGET) $(DEST_RT) \
$(DEST_HELP) $(DEST_PRINT) $(DEST_COL) \
$(DEST_SYN) $(DEST_SYN)/shared $(DEST_IND) \
$(DEST_FTP) $(DEST_AUTO) $(DEST_AUTO)/dist $(DEST_AUTO)/xml \
$(DEST_SYN) $(DEST_SYN)/shared $(DEST_IND) $(DEST_FTP) \
$(DEST_AUTO) $(DEST_AUTO)/dist $(DEST_AUTO)/xml $(DEST_AUTO)/zig \
$(DEST_IMPORT) $(DEST_IMPORT)/dist \
$(DEST_PLUG) $(DEST_TUTOR) $(DEST_SPELL) $(DEST_COMP)
-$(SHELL) ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS)
@@ -2417,6 +2417,8 @@ installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(VIMTARGET) $(DEST_RT) \
cd $(DEST_AUTO)/dist; chmod $(HELPMOD) *.vim
cd $(AUTOSOURCE)/xml; $(INSTALL_DATA) *.vim $(DEST_AUTO)/xml
cd $(DEST_AUTO)/xml; chmod $(HELPMOD) *.vim
cd $(AUTOSOURCE)/zig; $(INSTALL_DATA) *.vim $(DEST_AUTO)/zig
cd $(DEST_AUTO)/zig; chmod $(HELPMOD) *.vim
# install the standard import files
cd $(IMPORTSOURCE)/dist; $(INSTALL_DATA) *.vim $(DEST_IMPORT)/dist
cd $(DEST_IMPORT)/dist; chmod $(HELPMOD) *.vim
@@ -2656,7 +2658,7 @@ $(DESTDIR)$(exec_prefix) $(DEST_BIN) \
$(DEST_IND) $(DEST_FTP) \
$(DEST_LANG) $(DEST_KMAP) $(DEST_COMP) $(DEST_MACRO) \
$(DEST_PACK) $(DEST_TOOLS) $(DEST_TUTOR) $(DEST_SPELL) \
$(DEST_AUTO) $(DEST_AUTO)/dist $(DEST_AUTO)/xml \
$(DEST_AUTO) $(DEST_AUTO)/dist $(DEST_AUTO)/xml $(DEST_AUTO)/zig \
$(DEST_IMPORT) $(DEST_IMPORT)/dist $(DEST_PLUG):
$(MKDIR_P) $@
-chmod $(DIRMOD) $@
@@ -2845,10 +2847,10 @@ uninstall_runtime:
-rmdir $(DEST_SYN) $(DEST_IND)
-rm -rf $(DEST_FTP)/*.vim $(DEST_FTP)/README.txt $(DEST_FTP)/logtalk.dict
-rm -f $(DEST_AUTO)/*.vim $(DEST_AUTO)/README.txt
-rm -f $(DEST_AUTO)/dist/*.vim $(DEST_AUTO)/xml/*.vim
-rm -f $(DEST_AUTO)/dist/*.vim $(DEST_AUTO)/xml/*.vim $(DEST_AUTO)/zig/*.vim
-rm -f $(DEST_IMPORT)/dist/*.vim
-rm -f $(DEST_PLUG)/*.vim $(DEST_PLUG)/README.txt
-rmdir $(DEST_FTP) $(DEST_AUTO)/dist $(DEST_AUTO)/xml $(DEST_AUTO)
-rmdir $(DEST_FTP) $(DEST_AUTO)/dist $(DEST_AUTO)/xml $(DEST_AUTO)/zig $(DEST_AUTO)
-rmdir $(DEST_IMPORT)/dist $(DEST_IMPORT)
-rmdir $(DEST_PLUG) $(DEST_RT)
# This will fail when other Vim versions are installed, no worries.

View File

@@ -2224,7 +2224,7 @@ static funcentry_T global_functions[] =
{"matchend", 2, 4, FEARG_1, arg24_match_func,
ret_number, f_matchend},
{"matchfuzzy", 2, 3, FEARG_1, arg3_list_string_dict,
ret_list_string, f_matchfuzzy},
ret_list_any, f_matchfuzzy},
{"matchfuzzypos", 2, 3, FEARG_1, arg3_list_string_dict,
ret_list_any, f_matchfuzzypos},
{"matchlist", 2, 4, FEARG_1, arg24_match_func,

View File

@@ -814,7 +814,7 @@ enddef
def s:GetFilenameCaseChecks(): dict<list<string>>
return {
modula2: ['file.DEF'],
bzl: ['file.BUILD', 'BUILD'],
bzl: ['file.BUILD', 'BUILD', 'BUCK'],
}
enddef

View File

@@ -2821,6 +2821,15 @@ def Test_matchfuzzy()
v9.CheckDefAndScriptFailure(['matchfuzzy([], 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2'])
v9.CheckDefAndScriptFailure(['matchfuzzy([], "a", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<unknown>', 'E1206: Dictionary required for argument 3'])
matchfuzzy(['abc', 'xyz'], '')->assert_equal([])
var lines =<< trim END
var items = [{name: 'xyz', id: 1}, {name: 'def', id: 2},
{name: 'abc', id: 3}]
var l: list<dict<any>> = matchfuzzy(items, 'abc', {key: 'name'})
assert_equal([{name: 'abc', id: 3}], l)
var k: list<string> = matchfuzzy(['one', 'two', 'who'], 'o')
assert_equal(['one', 'two', 'who'], k)
END
v9.CheckDefAndScriptSuccess(lines)
enddef
def Test_matchfuzzypos()
@@ -2828,6 +2837,15 @@ def Test_matchfuzzypos()
v9.CheckDefAndScriptFailure(['matchfuzzypos([], 1)'], ['E1013: Argument 2: type mismatch, expected string but got number', 'E1174: String required for argument 2'])
v9.CheckDefAndScriptFailure(['matchfuzzypos([], "a", [])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<unknown>', 'E1206: Dictionary required for argument 3'])
matchfuzzypos(['abc', 'xyz'], '')->assert_equal([[], [], []])
var lines =<< trim END
var items = [{name: 'xyz', id: 1}, {name: 'def', id: 2},
{name: 'abc', id: 3}]
var l: list<dict<any>> = matchfuzzypos(items, 'abc', {key: 'name'})[0]
assert_equal([{name: 'abc', id: 3}], l)
var k: list<string> = matchfuzzypos(['one', 'two', 'who'], 'o')[0]
assert_equal(['one', 'two', 'who'], k)
END
v9.CheckDefAndScriptSuccess(lines)
enddef
def Test_matchlist()

View File

@@ -838,6 +838,23 @@ def Test_class_member()
END
v9.CheckScriptSuccess(lines)
# using static class member twice
lines =<< trim END
vim9script
class HTML
static author: string = 'John Doe'
static def MacroSubstitute(s: string): string
return substitute(s, '{{author}}', author, 'gi')
enddef
endclass
assert_equal('some text', HTML.MacroSubstitute('some text'))
assert_equal('some text', HTML.MacroSubstitute('some text'))
END
v9.CheckScriptSuccess(lines)
# access private member in lambda
lines =<< trim END
vim9script

View File

@@ -695,6 +695,20 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1663,
/**/
1662,
/**/
1661,
/**/
1660,
/**/
1659,
/**/
1658,
/**/
1657,
/**/
1656,
/**/

View File

@@ -3967,8 +3967,8 @@ exec_instructions(ectx_T *ectx)
if (GA_GROW_FAILS(&ectx->ec_stack, 1))
goto theend;
classmember_T *cm = &iptr->isn_arg.classmember;
*STACK_TV_BOT(0) =
cm->cm_class->class_members_tv[cm->cm_idx];
copy_tv(cm->cm_class->class_members_tv + cm->cm_idx,
STACK_TV_BOT(0));
++ectx->ec_stack.ga_len;
}
break;