From 51754c8a498c39592250a077f56db89dd261995d Mon Sep 17 00:00:00 2001 From: Yochem van Rosmalen Date: Fri, 10 Jan 2025 19:54:13 +0100 Subject: [PATCH 01/93] runtime(editorconfig): set omnifunc to syntaxcomplete func closes: #16419 Signed-off-by: Yochem van Rosmalen Signed-off-by: Riley Bruins Signed-off-by: Christian Brabandt --- runtime/ftplugin/editorconfig.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/ftplugin/editorconfig.vim b/runtime/ftplugin/editorconfig.vim index 6d437351eb..1693a95c0b 100644 --- a/runtime/ftplugin/editorconfig.vim +++ b/runtime/ftplugin/editorconfig.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: EditorConfig " Maintainer: Riley Bruins -" Last Change: 2024 Jul 06 +" Last Change: 2025 Jan 10 if exists('b:did_ftplugin') finish @@ -10,4 +10,6 @@ let b:did_ftplugin = 1 setl comments=:#,:; commentstring=#\ %s -let b:undo_ftplugin = 'setl com< cms<' +setl omnifunc=syntaxcomplete#Complete + +let b:undo_ftplugin = 'setl com< cms< ofu<' From 695522dea3703cf1b4cd4a894ca9a745a0d2756f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 10 Jan 2025 20:02:17 +0100 Subject: [PATCH 02/93] runtime(vim): Update base-syntax, highlight literal string quote escape Match the '' escape sequence in literal strings. These were previously ending the current string and starting another concatenated literal string. closes: #16415 Signed-off-by: Christian Brabandt Signed-off-by: Doug Kearns --- runtime/syntax/generator/vim.vim.base | 11 +++--- runtime/syntax/testdir/dumps/vim_expr_00.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_01.dump | 10 +++--- runtime/syntax/testdir/dumps/vim_expr_02.dump | 32 ++++++++--------- runtime/syntax/testdir/dumps/vim_expr_03.dump | 34 +++++++++---------- runtime/syntax/testdir/dumps/vim_expr_04.dump | 34 +++++++++---------- runtime/syntax/testdir/dumps/vim_expr_05.dump | 20 +++++++++++ runtime/syntax/testdir/input/vim_expr.vim | 14 ++++++++ runtime/syntax/vim.vim | 11 +++--- 9 files changed, 104 insertions(+), 64 deletions(-) create mode 100644 runtime/syntax/testdir/dumps/vim_expr_05.dump diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index 28342680db..b3bc5ca6f7 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -558,19 +558,21 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ extend +syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend +syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ contains=vimQuoteEscape extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ + syn match vimEscape contained "\\." " syn match vimEscape contained +\\[befnrt\"]+ syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}" syn match vimEscape contained "\\<" contains=vimNotation syn match vimEscape contained "\\<\*[^>]*>\=>" +syn match vimQuoteEscape contained "''" -syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=@vimStringInterpolation extend -syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ contains=vimQuoteEscape,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList syn match vimStringInterpolationBrace contained "{{" syn match vimStringInterpolationBrace contained "}}" @@ -1392,6 +1394,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimPattern Type hi def link vimPlainMark vimMark hi def link vimPlainRegister vimRegister + hi def link vimQuoteEscape vimEscape hi def link vimRegister SpecialChar hi def link vimScriptDelim Comment hi def link vimSearchDelim Statement diff --git a/runtime/syntax/testdir/dumps/vim_expr_00.dump b/runtime/syntax/testdir/dumps/vim_expr_00.dump index 899b73cd91..b8ea410bc4 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_00.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_00.dump @@ -1,6 +1,6 @@ >"+0#0000e05#ffffff0| |S|t|r|i|n|g| +0#0000000&@66 @75 -|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|I|t|'@1|s| |a| |s|t|r|i|n|g|'| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|I|t|'+0#e000e06&@1|s+0#e000002&| |a| |s|t|r|i|n|g|'| +0#0000000&@53 |e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|t|a|b|:| |\|t|,| |n|e|w| |l|i|n|e|:| |\|n|,| |b|a|c|k|s|l|a|s|h|:| |\@1|'| +0#0000000&@31 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|t|a|b|:| |\+0#e000e06&|t|,+0#e000002&| |n|e|w| |l|i|n|e|:| |\+0#e000e06&|n|,+0#e000002&| |b|a|c|k|s|l|a|s|h|:| |\+0#e000e06&@1|"+0#e000002&| +0#0000000&@31 @75 diff --git a/runtime/syntax/testdir/dumps/vim_expr_01.dump b/runtime/syntax/testdir/dumps/vim_expr_01.dump index 81a4e21566..7dfc6d4ecb 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_01.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_01.dump @@ -12,9 +12,9 @@ |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|C|-|>@1|>+0#e000002&|"| +0#0000000&@60 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|*|C|-|>@1|>+0#e000002&|"| +0#0000000&@59 @75 -|"+0#0000e05&| |S|t|r|i|n|g| |i|n|t|e|r|p|o|l|a|t|i|o|n| +0#0000000&@52 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|'+0#e000e06&@1|f+0#e000002&|o@1|'| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|f|o@1|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@59 @75 -|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|D|o|n|'@1|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|'| +0#0000000&@22 -|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|D|o|n|'|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|"| +0#0000000&@23 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 -@57|1|5|,|1| @9|1|8|%| +@57|1|5|,|1| @9|1|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_02.dump b/runtime/syntax/testdir/dumps/vim_expr_02.dump index d1d443ec4c..37e5b04119 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_02.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_02.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 +| +0&#ffffff0@74 +|"+0#0000e05&| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|i|n|c|o|r@1|e|c|t|l|y| |m|a|t|c|h|e|s| |a|s| |v|i|m|S|t|r|i|n|g| |v|i|m|M|a|r|k| |v|i|m|O|p|e|r| |N|O|N|E|)| +0#0000000& +|"+0#0000e05&| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|t|p|o|p|e|/|v|i|m|-|u|n|i|m|p|a|i|r|e|d|/|b|l|o|b|/|6|d|4@1|a|6|d|c|2|e|c|3|4|6|0|7|c|4|1|e|c|7|8|a|c|f|8|1 +|6|5|7|2|4|8|5|8|0|b|f|1|/|p|l|u|g|i|n|/|u|n|i|m|p|a|i|r|e|d|.|v|i|m|#|L|2|3|2| +0#0000000&@35 +|l+0#af5f00255&|e|t| +0#0000000&|c+0#00e0e07&|m|d| +0#0000000&|=+0#af5f00255&| +0#0000000&|'+0#e000002&|p|u|t|!|=|r|e|p|e|a|t|(|n|r|2|c|h|a|r|(|1|0|)|,| |v|:|c|o|u|n|t|1|)|||s|i|l|e|n|t| |'+0#e000e06&@1|]+0#e000002&|+|'| +0#0000000&@16 +> @74 +|"+0#0000e05&| |S|t|r|i|n|g| |i|n|t|e|r|p|o|l|a|t|i|o|n| +0#0000000&@52 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|D|o|n|'+0#e000e06&@1|t+0#e000002&| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|'| +0#0000000&@22 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|D|o|n|'|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|"| +0#0000000&@23 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|'|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@6 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|"+0#e000002&|f|o@1|"|:+0#0000000&| |"+0#e000002&|b|a|r|"|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@8 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|"|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@6 @75 ->"+0#0000e05&| |N|u|m|b|e|r| +0#0000000&@66 -@75 -|"+0#0000e05&| |H|e|x|a|d|e|c|i|m|a|l| +0#0000000&@61 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|x|F@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|X|F@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|x|F@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|X|F@1| +0#0000000&@64 -@75 -|"+0#0000e05&| |D|e|c|i|m|a|l| +0#0000000&@65 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|2+0#e000002&|5@1| +0#0000000&@65 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|2+0#e000002&|5@1| +0#0000000&@65 -@75 -|"+0#0000e05&| |O|c|t|a|l| +0#0000000&@67 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64 -@57|3@1|,|1| @9|4|6|%| +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|'+0#e000e06&@1|f+0#e000002&|o@1|'| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@58 +@57|3|2|,|0|-|1| @7|3|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_03.dump b/runtime/syntax/testdir/dumps/vim_expr_03.dump index 90cd8c8655..178468d477 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_03.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_03.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64 +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@58 +@75 +|"+0#0000e05&| |N|u|m|b|e|r| +0#0000000&@66 +@75 +|"+0#0000e05&| |H|e|x|a|d|e|c|i|m|a|l| +0#0000000&@61 +>e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|x|F@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|X|F@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|x|F@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|X|F@1| +0#0000000&@64 +@75 +|"+0#0000e05&| |D|e|c|i|m|a|l| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|2+0#e000002&|5@1| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|2+0#e000002&|5@1| +0#0000000&@65 +@75 +|"+0#0000e05&| |O|c|t|a|l| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64 |e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|o|3|7@1| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|O|3|7@1| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|3|7@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|o|3|7@1| +0#0000000&@63 ->e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|O|3|7@1| +0#0000000&@63 -@75 -|"+0#0000e05&| |B|i|n|a|r|y| +0#0000000&@66 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|b|1@7| +0#0000000&@58 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|B|1@7| +0#0000000&@58 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|b|1@7| +0#0000000&@58 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|B|1@7| +0#0000000&@58 -@75 -|"+0#0000e05&| |F|l|o|a|t| +0#0000000&@67 -|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@62 -|e+0#af5f00255&|c|h|o| +0#0000000&|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@62 -|e+0#af5f00255&|c|h|o| +0#0000000&|5+0#e000002&@1|.|0| +0#0000000&@65 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@63 -|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61 -@57|5|1|,|1| @9|7@1|%| +@57|5|0|,|1| @9|6|1|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_04.dump b/runtime/syntax/testdir/dumps/vim_expr_04.dump index b7737c6420..1a054e6cda 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_04.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_04.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61 -|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|0|E|-|6| +0#0000000&@63 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@58 -@75 -|"+0#0000e05&| |B|l|o|b| +0#0000000&@68 ->e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z| +0#0000000&@67 -|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55 -|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50 +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|3|7@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|o|3|7@1| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|O|3|7@1| +0#0000000&@63 @75 +|"+0#0000e05&| |B|i|n|a|r|y| +0#0000000&@66 +>e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|b|1@7| +0#0000000&@58 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|B|1@7| +0#0000000&@58 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|b|1@7| +0#0000000&@58 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|B|1@7| +0#0000000&@58 @75 -|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 -|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 +|"+0#0000e05&| |F|l|o|a|t| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|5+0#e000002&@1|.|0| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|0|E|-|6| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@58 @75 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|6|9|,|1| @9|B|o|t| +@57|6|8|,|1| @9|8|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_05.dump b/runtime/syntax/testdir/dumps/vim_expr_05.dump new file mode 100644 index 0000000000..2c0a189bba --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_05.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|"+0#0000e05&| |B|l|o|b| +0#0000000&@68 +|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53 +>e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50 +@75 +@75 +|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 +|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|8|6|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim index 8d30656ec1..316f462cae 100644 --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -21,6 +21,15 @@ echo "\<*C->>" echo "\>>" echo "\<*C->>>" +echo '''' +echo '''foo' +echo 'foo''' +echo 'foo''bar' + +" Unreported issue (incorrectly matches as vimString vimMark vimOper NONE) +" https://github.com/tpope/vim-unimpaired/blob/6d44a6dc2ec34607c41ec78acf81657248580bf1/plugin/unimpaired.vim#L232 +let cmd = 'put!=repeat(nr2char(10), v:count1)|silent '']+' + " String interpolation echo 'Don''t highlight interpolation: {{ {1 + 2} }}' @@ -30,6 +39,11 @@ echo $'Highlight interpolation:\t{{ { $'nested: {{ {1 + 2} }}' } }}' echo $"Highlight interpolation:\t{{ { string({"foo": "bar"}) } }}" echo $"Highlight interpolation:\t{{ { $"nested: {{ {1 + 2} }}" } }}" +echo $'''' +echo $'''foo' +echo $'foo''' +echo $'foo''bar' + " Number " Hexadecimal diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 1a2aa6eb6a..04fc8c1fad 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -598,19 +598,21 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ extend +syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend +syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ contains=vimQuoteEscape extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ + syn match vimEscape contained "\\." " syn match vimEscape contained +\\[befnrt\"]+ syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}" syn match vimEscape contained "\\<" contains=vimNotation syn match vimEscape contained "\\<\*[^>]*>\=>" +syn match vimQuoteEscape contained "''" -syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=@vimStringInterpolation extend -syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ contains=vimQuoteEscape,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList syn match vimStringInterpolationBrace contained "{{" syn match vimStringInterpolationBrace contained "}}" @@ -1438,6 +1440,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimPattern Type hi def link vimPlainMark vimMark hi def link vimPlainRegister vimRegister + hi def link vimQuoteEscape vimEscape hi def link vimRegister SpecialChar hi def link vimScriptDelim Comment hi def link vimSearchDelim Statement From ad409876d9cf7e565f99c5e21b9e2e400a83a4d4 Mon Sep 17 00:00:00 2001 From: glepnir Date: Fri, 10 Jan 2025 20:08:20 +0100 Subject: [PATCH 03/93] patch 9.1.1001: ComplMatchIns highlight hard to read on light background Problem: ComplMatchIns highlight hard to read on light background (after v9.1.0996) Solution: define the highlighting group cleared, it should be configured in colorschemes separately (glepnir) closes: #16414 Signed-off-by: glepnir Signed-off-by: Christian Brabandt --- runtime/doc/options.txt | 5 +++-- src/highlight.c | 2 -- src/optiondefs.h | 2 +- src/version.c | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 489415c780..780db60aba 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2024 Dec 28 +*options.txt* For Vim version 9.1. Last change: 2025 Jan 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4348,7 +4348,7 @@ A jump table for the options with a short description can be found at |Q_op|. #:TabLineSel,_:TabLineFill,!:CursorColumn, .:CursorLine,o:ColorColumn,q:QuickFixLine, z:StatusLineTerm,Z:StatusLineTermNC, - g:MsgArea") + g:MsgArea,h:ComplMatchIns") global This option can be used to set highlighting mode for various occasions. It is a comma-separated list of character pairs. The @@ -4368,6 +4368,7 @@ A jump table for the options with a short description can be found at |Q_op|. |hl-MoreMsg| m |more-prompt| |hl-ModeMsg| M Mode (e.g., "-- INSERT --") |hl-MsgArea| g |Command-line| and message area + |hl-ComplMatchIns| h matched text of currently inserted completion |hl-LineNr| n line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. |hl-LineNrAbove| a line number above the cursor for when the diff --git a/src/highlight.c b/src/highlight.c index f38abd86b6..1a4c76d943 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -262,8 +262,6 @@ static char *(highlight_init_both[]) = { "default link PmenuMatchSel PmenuSel", "default link PmenuExtra Pmenu", "default link PmenuExtraSel PmenuSel", - CENT("ComplMatchIns ctermfg=DarkGrey cterm=NONE", - "ComplMatchIns guifg=DarkGrey gui=NONE"), CENT("Normal cterm=NONE", "Normal gui=NONE"), NULL }; diff --git a/src/optiondefs.h b/src/optiondefs.h index f9b7eae1ff..c7c96de298 100644 --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -302,7 +302,7 @@ struct vimoption # define ISP_LATIN1 (char_u *)"@,161-255" #endif -# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea" +# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea,h:ComplMatchIns" // Default python version for pyx* commands #if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3) diff --git a/src/version.c b/src/version.c index baebd2b1c5..77128722bd 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1001, /**/ 1000, /**/ From 668e9f24037fc7c362ffdf5fc1d5c5b1a8b0e855 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 11 Jan 2025 09:19:12 +0100 Subject: [PATCH 04/93] runtime(filetype): don't detect string interpolation as angular fixes: #16375 Signed-off-by: Christian Brabandt --- runtime/autoload/dist/ft.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index f1e6ee272b..47b2fede17 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -3,7 +3,7 @@ vim9script # Vim functions for file type detection # # Maintainer: The Vim Project -# Last Change: 2025 Jan 08 +# Last Change: 2025 Jan 11 # Former Maintainer: Bram Moolenaar # These functions are moved here from runtime/filetype.vim to make startup @@ -437,7 +437,7 @@ export def FThtml() while n < 40 && n <= line("$") # Check for Angular - if getline(n) =~ '@\(if\|for\|defer\|switch\)\|\*\(ngIf\|ngFor\|ngSwitch\|ngTemplateOutlet\)\|ng-template\|ng-content\|{{.*}}' + if getline(n) =~ '@\(if\|for\|defer\|switch\)\|\*\(ngIf\|ngFor\|ngSwitch\|ngTemplateOutlet\)\|ng-template\|ng-content' setf htmlangular return endif From c10342da449155b874ddc4b4a5beb92159ee96b7 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sat, 11 Jan 2025 09:39:01 +0100 Subject: [PATCH 05/93] patch 9.1.1002: Vim9: unknown func error with interface declaring func var Problem: Vim9: unknown function error with interface declaring a function variable (lifepillar) Solution: Use correct instruction for getting interface member variables (Yegappan Lakshmanan) fixes: #16345 closes: #16421 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_vim9_class.vim | 25 +++++++++++++++++++++++++ src/testdir/test_vim9_disassemble.vim | 25 +++++++++++++++++++++++++ src/version.c | 2 ++ src/vim9expr.c | 11 +++++++++-- 4 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index 799230a98b..c20de25337 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -7257,6 +7257,31 @@ def Test_interface_extends_with_dup_members() v9.CheckSourceSuccess(lines) enddef +" Test for implementing an interface with different ordering for the interface +" member variables. +def Test_implement_interface_with_different_variable_order() + var lines =<< trim END + vim9script + + interface IX + var F: func(): string + endinterface + + class X implements IX + var x: number + var F: func(): string = () => 'ok' + endclass + + def Foo(ix: IX): string + return ix.F() + enddef + + var x0 = X.new(0) + assert_equal('ok', Foo(x0)) + END + v9.CheckSourceSuccess(lines) +enddef + " Test for using "any" type for a variable in a sub-class while it has a " concrete type in the interface def Test_implements_using_var_type_any() diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim index 7746b23b41..2dc925a353 100644 --- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -3586,4 +3586,29 @@ def Test_disassemble_member_initializer() unlet g:instr enddef +" Disassemble the code generated for accessing a interface member variable +def Test_disassemble_interface_variable_access() + var lines =<< trim END + vim9script + interface IX + var F: func(): string + endinterface + + def Foo(ix: IX): string + return ix.F() + enddef + + g:instr = execute('disassemble Foo') + END + v9.CheckScriptSuccess(lines) + assert_match('\d\+_Foo\_s*' .. + 'return ix.F()\_s*' .. + '0 LOAD arg\[-1\]\_s*' .. + '1 ITF_MEMBER 0 on IX\_s*' .. + '2 PCALL top (argc 0)\_s*' .. + '3 PCALL end\_s*' .. + '4 RETURN', g:instr) + unlet g:instr +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/version.c b/src/version.c index 77128722bd..f79eb15f84 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1002, /**/ 1001, /**/ diff --git a/src/vim9expr.c b/src/vim9expr.c index cfdea7bc41..9a96034543 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -392,8 +392,15 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) } else { - if (generate_GET_OBJ_MEMBER(cctx, m_idx, ocm->ocm_type) == - FAIL) + int status; + + if (IS_INTERFACE(cl)) + status = generate_GET_ITF_MEMBER(cctx, cl, m_idx, + ocm->ocm_type); + else + status = generate_GET_OBJ_MEMBER(cctx, m_idx, + ocm->ocm_type); + if (status == FAIL) return FAIL; } } From 9598a6369bce32d3da831e8968caf4625985ac3c Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 11 Jan 2025 10:14:24 +0100 Subject: [PATCH 06/93] runtime(doc): add package- helptags for included packages Improve how to find the justify package closes: #16420 Co-authored-by: Peter Benjamin Signed-off-by: Christian Brabandt --- runtime/doc/helphelp.txt | 6 +++--- runtime/doc/quickfix.txt | 6 +++--- runtime/doc/tags | 11 +++++++++++ runtime/doc/terminal.txt | 4 ++-- runtime/doc/usr_02.txt | 9 ++++++++- runtime/doc/usr_05.txt | 10 +++++----- runtime/doc/usr_25.txt | 8 ++++---- 7 files changed, 36 insertions(+), 18 deletions(-) diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 3ba0920626..7b9dd7671c 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 9.1. Last change: 2024 Dec 26 +*helphelp.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -247,10 +247,10 @@ command: > (requires write permission there): > :helptags $VIMRUNTIME/doc < - *:HelpToc* *help-TOC* *help-toc-install* + *:HelpToc* *help-TOC* *help-toc-install* *package-helptoc* If you want to access an interactive table of contents, from any position in -the file, you can use the helptoc plugin. Load the plugin with: > +the file, you can use the helptoc plugin. Load the plugin with: >vim packadd helptoc diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index b6d79507ff..834f0e1b6e 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 9.1. Last change: 2024 Dec 27 +*quickfix.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -550,9 +550,9 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST: < Otherwise it works the same as `:ldo`. FILTERING A QUICKFIX OR LOCATION LIST: - *cfilter-plugin* *:Cfilter* *:Lfilter* + *cfilter-plugin* *:Cfilter* *:Lfilter* *package-cfilter* If you have too many entries in a quickfix list, you can use the cfilter -plugin to reduce the number of entries. Load the plugin with: > +plugin to reduce the number of entries. Load the plugin with: >vim packadd cfilter diff --git a/runtime/doc/tags b/runtime/doc/tags index a2996794f7..2fc28d7241 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -2129,6 +2129,7 @@ $quote eval.txt /*$quote* :GnatTags ft_ada.txt /*:GnatTags* :HelpToc helphelp.txt /*:HelpToc* :Hexplore pi_netrw.txt /*:Hexplore* +:Justify usr_25.txt /*:Justify* :LP pi_logipat.txt /*:LP* :LPE pi_logipat.txt /*:LPE* :LPF pi_logipat.txt /*:LPF* @@ -5567,6 +5568,7 @@ J change.txt /*J* Japanese mbyte.txt /*Japanese* Job eval.txt /*Job* Jobs eval.txt /*Jobs* +Justify() usr_25.txt /*Justify()* K various.txt /*K* KDE gui_x11.txt /*KDE* KVim gui_x11.txt /*KVim* @@ -8538,6 +8540,7 @@ jump-motions motion.txt /*jump-motions* jumplist motion.txt /*jumplist* jumplist-stack motion.txt /*jumplist-stack* jumpto-diffs diff.txt /*jumpto-diffs* +justify usr_25.txt /*justify* k motion.txt /*k* kcc uganda.txt /*kcc* kde gui_x11.txt /*kde* @@ -9384,9 +9387,17 @@ out_name channel.txt /*out_name* out_timeout channel.txt /*out_timeout* p change.txt /*p* pack-add repeat.txt /*pack-add* +package-cfilter quickfix.txt /*package-cfilter* +package-comment usr_05.txt /*package-comment* package-create repeat.txt /*package-create* package-doc repeat.txt /*package-doc* package-documentation repeat.txt /*package-documentation* +package-editorconfig usr_05.txt /*package-editorconfig* +package-helptoc helphelp.txt /*package-helptoc* +package-justify usr_25.txt /*package-justify* +package-matchit usr_05.txt /*package-matchit* +package-nohlsearch usr_05.txt /*package-nohlsearch* +package-termdebug terminal.txt /*package-termdebug* package-translate_example repeat.txt /*package-translate_example* package-translation repeat.txt /*package-translation* packages repeat.txt /*packages* diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index 7e2d898245..1fcc470db8 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -1,4 +1,4 @@ -*terminal.txt* For Vim version 9.1. Last change: 2024 Dec 30 +*terminal.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1254,7 +1254,7 @@ Alternatively, press "s" to swap the first and second dump. Do this several times so that you can spot the difference in the context of the text. ============================================================================== -6. Debugging *terminal-debug* *terminal-debugger* +6. Debugging *terminal-debug* *terminal-debugger* *package-termdebug* The Terminal debugging plugin can be used to debug a program with gdb and view the source code in a Vim window. Since this is completely contained inside diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt index 70d24d3dd9..a02835d86b 100644 --- a/runtime/doc/usr_02.txt +++ b/runtime/doc/usr_02.txt @@ -1,4 +1,4 @@ -*usr_02.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*usr_02.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM USER MANUAL - by Bram Moolenaar @@ -694,6 +694,13 @@ Summary: *help-summary* > :help E128 < takes you to the |:function| command +27) Documenction for packages distributed with Vim have the form package-. + So > + :help package-comment +< + will bring you to the help section for the included comment plugin and how to + enable it. + ============================================================================== diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index ca6b910754..93231f6cd1 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -1,4 +1,4 @@ -*usr_05.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*usr_05.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM USER MANUAL - by Bram Moolenaar @@ -392,7 +392,7 @@ The ":map" command (with no arguments) lists your current mappings. At least the ones for Normal mode. More about mappings in section |40.1|. ============================================================================== -*05.5* Adding a package *add-package* *matchit-install* +*05.5* Adding a package *add-package* *matchit-install* *package-matchit* A package is a set of files that you can add to Vim. There are two kinds of packages: optional and automatically loaded on startup. @@ -427,7 +427,7 @@ an archive or as a repository. For an archive you can follow these steps: Here "fancytext" is the name of the package, it can be anything else. -Adding the editorconfig package *editorconfig-install* +Adding the editorconfig package *editorconfig-install* *package-editorconfig* Similar to the matchit package, to load the distributed editorconfig plugin when Vim starts, add the following line to your vimrc file: > @@ -437,7 +437,7 @@ After restarting your Vim, the plugin is active and you can read about it at: > :h editorconfig.txt -Adding comment package *comment-install* +Adding comment package *comment-install* *package-comment* Load the plugin with this command: > packadd comment @@ -450,7 +450,7 @@ the package loaded. Once the package is loaded, read about it at: > :h comment.txt -Adding nohlsearch package *nohlsearch-install* +Adding nohlsearch package *nohlsearch-install* *package-nohlsearch* Load the plugin with this command: > packadd nohlsearch diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt index af013bcfe7..5b4df0d0e6 100644 --- a/runtime/doc/usr_25.txt +++ b/runtime/doc/usr_25.txt @@ -1,4 +1,4 @@ -*usr_25.txt* For Vim version 9.1. Last change: 2016 Mar 28 +*usr_25.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM USER MANUAL - by Bram Moolenaar @@ -190,15 +190,15 @@ This results in the following: story. ~ -JUSTIFYING TEXT +JUSTIFYING TEXT *justify* *:Justify* *Justify()* *package-justify* Vim has no built-in way of justifying text. However, there is a neat macro package that does the job. To use this package, execute the following -command: > +command: >vim :packadd justify -Or put this line in your |vimrc|: > +Or put this line in your |vimrc|: >vim packadd! justify From c9a1e257f1630a0866447e53a564f7ff96a80ead Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 11 Jan 2025 15:25:00 +0100 Subject: [PATCH 07/93] patch 9.1.1003: [security]: heap-buffer-overflow with visual mode Problem: [security]: heap-buffer-overflow with visual mode when using :all, causing Vim trying to access beyond end-of-line (gandalf) Solution: Reset visual mode on :all, validate position in gchar_pos() and charwise_block_prep() This fixes CVE-2025-22134 Github Advisory: https://github.com/vim/vim/security/advisories/GHSA-5rgf-26wj-48v8 Co-authored-by: zeertzjq Signed-off-by: Christian Brabandt --- src/arglist.c | 4 ++++ src/misc1.c | 4 ++++ src/ops.c | 3 ++- src/testdir/test_visual.vim | 26 ++++++++++++++++++++++---- src/version.c | 2 ++ 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/arglist.c b/src/arglist.c index 8825c8e252..4eec079df4 100644 --- a/src/arglist.c +++ b/src/arglist.c @@ -1258,6 +1258,10 @@ do_arg_all( tabpage_T *new_lu_tp = curtab; + // Stop Visual mode, the cursor and "VIsual" may very well be invalid after + // switching to another buffer. + reset_VIsual_and_resel(); + // Try closing all windows that are not in the argument list. // Also close windows that are not full width; // When 'hidden' or "forceit" set the buffer becomes hidden. diff --git a/src/misc1.c b/src/misc1.c index 90cf914742..142a6161ea 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -543,11 +543,15 @@ plines_m_win(win_T *wp, linenr_T first, linenr_T last, int max) gchar_pos(pos_T *pos) { char_u *ptr; + int ptrlen; // When searching columns is sometimes put at the end of a line. if (pos->col == MAXCOL) return NUL; + ptrlen = ml_get_len(pos->lnum); ptr = ml_get_pos(pos); + if (pos->col > ptrlen) + return NUL; if (has_mbyte) return (*mb_ptr2char)(ptr); return (int)*ptr; diff --git a/src/ops.c b/src/ops.c index a75efab59e..9efef383d1 100644 --- a/src/ops.c +++ b/src/ops.c @@ -2586,6 +2586,7 @@ charwise_block_prep( colnr_T startcol = 0, endcol = MAXCOL; colnr_T cs, ce; char_u *p; + int plen = ml_get_len(lnum); p = ml_get(lnum); bdp->startspaces = 0; @@ -2646,7 +2647,7 @@ charwise_block_prep( else bdp->textlen = endcol - startcol + inclusive; bdp->textcol = startcol; - bdp->textstart = p + startcol; + bdp->textstart = startcol <= plen ? p + startcol : p; } /* diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim index 0be73ecc13..03335a464d 100644 --- a/src/testdir/test_visual.vim +++ b/src/testdir/test_visual.vim @@ -470,7 +470,7 @@ func Test_Visual_Block() \ "\t{", \ "\t}"], getline(1, '$')) - close! + bw! endfunc " Test for 'p'ut in visual block mode @@ -1080,7 +1080,7 @@ func Test_star_register() delmarks < > call assert_fails('*yank', 'E20:') - close! + bw! endfunc " Test for changing text in visual mode with 'exclusive' selection @@ -1096,7 +1096,7 @@ func Test_exclusive_selection() call assert_equal('l one', getline(1)) set virtualedit& set selection& - close! + bw! endfunc " Test for starting linewise visual with a count. @@ -1153,7 +1153,7 @@ func Test_visual_inner_block() 8,9d call cursor(5, 1) call assert_beeps('normal ViBiB') - close! + bw! endfunc func Test_visual_put_in_block() @@ -2760,4 +2760,22 @@ func Test_visual_block_exclusive_selection_adjusted() set selection&vim endfunc +" the following caused a Heap-Overflow, because Vim was accessing outside of a +" line end +func Test_visual_pos_buffer_heap_overflow() + set virtualedit=all + args Xa Xb + all + call setline(1, ['', '', '']) + call cursor(3, 1) + wincmd w + call setline(1, 'foobar') + normal! $lv0 + all + call setreg('"', 'baz') + normal! [P + set virtualedit= + bw! Xa Xb +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index f79eb15f84..0d2189b35b 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1003, /**/ 1002, /**/ From ebb08d591314af4262de5599d2041458d547e3ef Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 11 Jan 2025 15:43:12 +0100 Subject: [PATCH 08/93] patch 9.1.1004: tests: a few termdebug tests are flaky Problem: tests: a few termdebug tests are flaky; test_termdebug_basic() and test_termdebug_config_types() may fail if there is too much load Solution: Set g:test_is_flaky Signed-off-by: Christian Brabandt --- src/testdir/test_termdebug.vim | 2 ++ src/version.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/testdir/test_termdebug.vim b/src/testdir/test_termdebug.vim index 0acdab1a50..d2e046ff82 100644 --- a/src/testdir/test_termdebug.vim +++ b/src/testdir/test_termdebug.vim @@ -60,6 +60,7 @@ packadd termdebug " should be the first test to run, since it validates the window layout with " win ids func Test_termdebug_basic() + let g:test_is_flaky = 1 let bin_name = 'XTD_basic' let src_name = bin_name .. '.c' call s:generate_files(bin_name) @@ -579,6 +580,7 @@ endfunction function Test_termdebug_config_types() " TODO Remove the deprecated features after 1 Jan 2025. + let g:test_is_flaky = 1 let g:termdebug_config = {} let s:error_message = 'Deprecation Warning:' call assert_true(maparg('K', 'n', 0, 1)->empty()) diff --git a/src/version.c b/src/version.c index 0d2189b35b..6179cb3f9b 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1004, /**/ 1003, /**/ From 9fddb8ae770be3e16545dd4c2f4cfaad8f62cb40 Mon Sep 17 00:00:00 2001 From: glepnir Date: Sat, 11 Jan 2025 16:42:50 +0100 Subject: [PATCH 09/93] patch 9.1.1005: completion text is highlighted even with no pattern found Problem: completion text is highlighted even with no pattern found Solution: use ins_compl_leader_len() instead of checking compl_leader.length (glepnir) closes: #16422 Signed-off-by: glepnir Signed-off-by: Christian Brabandt --- src/insexpand.c | 2 +- .../dumps/Test_pum_matchins_combine_09.dump | 20 +++++++++++++++++++ src/testdir/test_popup.vim | 7 +++++++ src/version.c | 2 ++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/testdir/dumps/Test_pum_matchins_combine_09.dump diff --git a/src/insexpand.c b/src/insexpand.c index 22f021de7e..4a02f0ec8e 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -927,7 +927,7 @@ ins_compl_col_range_attr(int col) if ((get_cot_flags() & COT_FUZZY)) return -1; - if (col >= (compl_col + (int)compl_leader.length) && col < compl_ins_end_col) + if (col >= (compl_col + (int)ins_compl_leader_len()) && col < compl_ins_end_col) return syn_name2attr((char_u *)"ComplMatchIns"); return -1; diff --git a/src/testdir/dumps/Test_pum_matchins_combine_09.dump b/src/testdir/dumps/Test_pum_matchins_combine_09.dump new file mode 100644 index 0000000000..d7904b29e0 --- /dev/null +++ b/src/testdir/dumps/Test_pum_matchins_combine_09.dump @@ -0,0 +1,20 @@ +|f+8(ff4011> @73 +|~+0#4040ff13#4040ff13| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |K|e|y|w|o|r|d| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |P+0#ffffff16#e000002|a|t@1|e|r|n| |n|o|t| |f|o|u|n|d| +0#0000000#4040ff13@28 diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 3f4836fa80..0303c42bd6 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -1829,6 +1829,13 @@ func Test_pum_matchins_highlight_combine() call term_sendkeys(buf, "S\\f\") call VerifyScreenDump(buf, 'Test_pum_matchins_combine_08', {}) call term_sendkeys(buf, "\\") + call TermWait(buf) + + call term_sendkeys(buf, ":set cot-=fuzzy\") + call TermWait(buf) + call term_sendkeys(buf, "Sf\") + call VerifyScreenDump(buf, 'Test_pum_matchins_combine_09', {}) + call term_sendkeys(buf, "\\") call StopVimInTerminal(buf) endfunc diff --git a/src/version.c b/src/version.c index 6179cb3f9b..1927d9e82e 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1005, /**/ 1004, /**/ From 9eff3ee81839d67999491d293879ada134df2d3e Mon Sep 17 00:00:00 2001 From: glepnir Date: Sat, 11 Jan 2025 16:47:34 +0100 Subject: [PATCH 10/93] patch 9.1.1006: PmenuMatch completion highlight can be combined Problem: PmenuMatch completion highlight can be combined Solution: Combine highlight groups PmenuMatch with Pmenu and PmenuMatchSel with PmenuSel (glepnir) fixes: #15563 closes: #16408 Signed-off-by: glepnir Signed-off-by: Christian Brabandt --- runtime/doc/syntax.txt | 8 +++++--- src/popupmenu.c | 5 +++++ src/testdir/dumps/Test_pum_highlights_18.dump | 20 +++++++++++++++++++ src/testdir/test_popup.vim | 10 ++++++++++ src/version.c | 2 ++ 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 src/testdir/dumps/Test_pum_highlights_18.dump diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 7640ee1838..2fb320efcb 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 9.1. Last change: 2024 Dec 16 +*syntax.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -5854,9 +5854,11 @@ PmenuSbar Popup menu: Scrollbar. *hl-PmenuThumb* PmenuThumb Popup menu: Thumb of the scrollbar. *hl-PmenuMatch* -PmenuMatch Popup menu: Matched text in normal item. +PmenuMatch Popup menu: Matched text in normal item. Applied in + combination with |hl-Pmenu|. *hl-PmenuMatchSel* -PmenuMatchSel Popup menu: Matched text in selected item. +PmenuMatchSel Popup menu: Matched text in selected item. Applied in + combination with |hl-PmenuSel|. *hl-ComplMatchIns* ComplMatchIns Matched text of the currently inserted completion. *hl-PopupNotification* diff --git a/src/popupmenu.c b/src/popupmenu.c index ea2edca9ab..14cc69a86e 100644 --- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -450,13 +450,18 @@ pum_compute_text_attrs(char_u *text, hlf_T hlf, int user_hlattr) if (char_pos == ((int_u *)ga->ga_data)[i]) { new_attr = highlight_attr[is_select ? HLF_PMSI : HLF_PMNI]; + new_attr = hl_combine_attr(highlight_attr[hlf], new_attr); break; } } } else if (matched_start && ptr < text + leader_len) + { new_attr = highlight_attr[is_select ? HLF_PMSI : HLF_PMNI]; + new_attr = hl_combine_attr(highlight_attr[hlf], new_attr); + } + new_attr = hl_combine_attr(highlight_attr[HLF_PNI], new_attr); if (user_hlattr > 0) new_attr = hl_combine_attr(new_attr, user_hlattr); diff --git a/src/testdir/dumps/Test_pum_highlights_18.dump b/src/testdir/dumps/Test_pum_highlights_18.dump new file mode 100644 index 0000000000..a57f7a2bea --- /dev/null +++ b/src/testdir/dumps/Test_pum_highlights_18.dump @@ -0,0 +1,20 @@ +|f+0&#ffffff0|b> @72 +|f+0#40ffff15#e0e0e08|o+0#0000001&@1|B+0#40ffff15&|a+0#0000001&|z| @1|f|o@1|k|i|n|d| | +0#4040ff13#ffffff0@58 +|f+0&#ffd7ff255|o+0#0000001&@1|b+0#4040ff13&|a+0#0000001&|r| @1|f|o@1|k|i|n|d| | +0#4040ff13#ffffff0@58 +|f+0&#ffd7ff255|o+0#0000001&@1|b+0#4040ff13&|a+0#0000001&|l|a| |f|o@1|k|i|n|d| | +0#4040ff13#ffffff0@58 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |O|m|n|i| |c|o|m|p|l|e|t|i|o|n| |(|^|O|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |9| +0#0000000&@34 diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 0303c42bd6..08b9cd9ca9 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -1511,6 +1511,16 @@ func Test_pum_highlights_match() call term_sendkeys(buf, "\S/non_existing_folder\\") call TermWait(buf, 50) call VerifyScreenDump(buf, 'Test_pum_highlights_15', {}) + call term_sendkeys(buf, "\\") + + call term_sendkeys(buf, ":hi PmenuMatchSel ctermfg=14\") + call TermWait(buf, 50) + call term_sendkeys(buf, ":hi PmenuMatch ctermfg=12\") + call term_sendkeys(buf, ":set cot=menu,noinsert,fuzzy\") + call term_sendkeys(buf, "S\\") + call TermWait(buf, 50) + call term_sendkeys(buf, "fb") + call VerifyScreenDump(buf, 'Test_pum_highlights_18', {}) call term_sendkeys(buf, "\\") call TermWait(buf) diff --git a/src/version.c b/src/version.c index 1927d9e82e..9d9f905355 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1006, /**/ 1005, /**/ From 5eaacef18eb6fc99617c008cf436d304aa4328d0 Mon Sep 17 00:00:00 2001 From: Aliaksei Budavei <0x000c70@gmail.com> Date: Sat, 11 Jan 2025 17:10:06 +0100 Subject: [PATCH 11/93] tests: Load screendump files with "git vimdumps" Also, fold the difference part and the bottom part for the identical screendump files. closes: #16380 Co-authored-by: D. Ben Knoble Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt --- runtime/doc/tags | 1 + runtime/doc/terminal.txt | 6 ++ runtime/syntax/testdir/README.txt | 3 + src/testdir/README.txt | 2 + src/testdir/commondumps.vim | 110 +++++++++++++++++++++++++++++- 5 files changed, 121 insertions(+), 1 deletion(-) diff --git a/runtime/doc/tags b/runtime/doc/tags index 2fc28d7241..9310df8f7c 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -7926,6 +7926,7 @@ gf editing.txt /*gf* gg motion.txt /*gg* gh visual.txt /*gh* gi insert.txt /*gi* +git-vimdumps terminal.txt /*git-vimdumps* gj motion.txt /*gj* gk motion.txt /*gk* glob() builtin.txt /*glob()* diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index 1fcc470db8..43b5e5f247 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -494,6 +494,12 @@ ConPTY problems have been fixed "winpty" will be preferred. Environment variables are used to pass information to the running job: VIM_SERVERNAME v:servername + *git-vimdumps* +There exists a git-difftool extension called `git-vimdumps` that can be used +to conveniently inspect screendump files and diff them. Please see in the Vim +Repository the file `src/testdir/commondumps.vim` on how to create and use +this git extension. + ============================================================================== 2. Terminal functions *terminal-function-details* diff --git a/runtime/syntax/testdir/README.txt b/runtime/syntax/testdir/README.txt index b96e8f6c65..6703228b9b 100644 --- a/runtime/syntax/testdir/README.txt +++ b/runtime/syntax/testdir/README.txt @@ -199,6 +199,9 @@ You can now examine the extracted screendumps: Viewing generated screendumps (submitted for a pull request) ------------------------------------------------------------ +Note: There is also a "git difftool" extension described in + src/testdir/commondumps.vim + First, you need to check out the topic branch with the proposed changes and write down a difference list between the HEAD commit (index) and its parent commit with respect to the changed "dumps" filenames: diff --git a/src/testdir/README.txt b/src/testdir/README.txt index 203c3245b7..c7067ac024 100644 --- a/src/testdir/README.txt +++ b/src/testdir/README.txt @@ -162,6 +162,8 @@ You can now examine the extracted screendumps: VIEWING GENERATED SCREENDUMPS (submitted for a pull request): +Note: There is also a "git difftool" extension described in ./commondumps.vim. + First, you need to check out the topic branch with the proposed changes and write down a difference list between the HEAD commit (index) and its parent commit with respect to the changed "dumps" filenames: diff --git a/src/testdir/commondumps.vim b/src/testdir/commondumps.vim index 1211ae9c4e..3dbdab5328 100644 --- a/src/testdir/commondumps.vim +++ b/src/testdir/commondumps.vim @@ -1,7 +1,112 @@ vim9script -# (Script-local.) +# See below on how to configure the git difftool extension + +# Extend "git difftool" with the capability for loading screendump files. +if v:progname =~? '\filter((_: number, fname: string) => + fname =~? '^\%(/dev/null\|.\+\.dump\)$') + ->len() == 2 + try + if argv(0) ==? '/dev/null' + term_dumpload(argv(1)) + elseif argv(1) ==? '/dev/null' + term_dumpload(argv(0)) + else + term_dumpdiff(argv(0), argv(1)) + endif + finally + silent bwipeout 1 2 + endtry + endif + + # Always stop from further sourcing this script for "(g)vimdiff". + finish +endif + +# CONSIDER ALTERNATIVES FOR ENABLING THE ABOVE EXTENSION. +# +# For convenience, it is assumed that there is a defined "$VIM_FORK_PATHNAME" +# environment variable holding an absolute pathname for the root directory of +# this repository. +# +# +# A. USE Git FOR CONFIGURATION. +# +# Define the following Git variables with "git config --edit --local" (where +# the "vimdumps" name is arbitrary): +# +# ------------------------------------------------------------------------------ +# [diff] +# tool = vimdumps +# [difftool.vimdumps] +# cmd = vimdiff -S "${VIM_FORK_PATHNAME:?}"/src/testdir/commondumps.vim -o -- "$LOCAL" "$REMOTE" +# ------------------------------------------------------------------------------ +# +# Rendered screendump files (among other files) between revisions can now be +# compared, two at a time, by using "git difftool", e.g.: +# git difftool 50423ab8~1 50423ab8 +# git difftool 50423ab8~1 50423ab8 -- '**/*.dump' +# +# The raw files can also be examined: +# :all +# +# +# B. USE Bash FOR CONFIGURATION (on Debian GNU/Linux). +# +# 1. Make an alias that sources this file, e.g.: +# alias git_vimdiff="git difftool -x 'vimdiff -S "${VIM_FORK_PATHNAME:?}"/vim/src/testdir/commondumps.vim -o --'" # +# 2. Enable programmable completion for the alias, e.g.: +# cat ~/.local/share/bash-completion/completions/git_vimdiff +# +# ------------------------------------------------------------------------------ +# ## Consider (un)setting "$BASH_COMPLETION_USER_DIR" and/or "$XDG_DATA_HOME" so +# ## that this file can be found and sourced; look for these variables in the +# ## "/usr/share/bash-completion/bash_completion" script. +# ## +# ## Look for __git_complete() examples in the header comment of the sourced +# ## "/usr/share/bash-completion/completions/git" script. +# [ -r /usr/share/bash-completion/completions/git ] && +# . /usr/share/bash-completion/completions/git && +# __git_complete git_vimdiff _git_difftool +# ------------------------------------------------------------------------------ +# +# Rendered screendump files (among other files) between revisions can now be +# compared, two at a time, by using the alias, e.g.: +# git_vimdiff 50423ab8~1 50423ab8 +# git_vimdiff 50423ab8~1 50423ab8 -- '**/*.dump' +# +# The raw files can also be examined: +# :all + + +# Script-local functions +# +# Fold the difference part and the bottom part when the top and the bottom +# parts are identical. +def FoldDumpDiffCopy() + try + normal mc + # Shape the pattern after get_separator() from "terminal.c". + const separator: string = '^\(=\+\)\=\s\S.*\.dump\s\1$' + const start_lnum: number = search(separator, 'eW', (line('$') / 2)) + if start_lnum > 0 + const end_lnum: number = search(separator, 'eW') + if end_lnum > 0 && getline((start_lnum + 1), (end_lnum - 1)) + ->filter((_: number, line: string) => line !~ '^\s\+$') + ->empty() + setlocal foldenable foldmethod=manual + exec 'normal ' .. start_lnum .. 'GzfG' + endif + endif + finally + normal `c + endtry +enddef + # Render a loaded screendump file or the difference of a loaded screendump # file and its namesake file from the "dumps" directory. def Render() @@ -13,6 +118,7 @@ def Render() fnamemodify(failed_fname, ':p:h:h') .. '/dumps') if filereadable(dumps_fname) term_dumpdiff(failed_fname, dumps_fname) + FoldDumpDiffCopy() else term_dumpload(failed_fname) endif @@ -21,6 +127,8 @@ def Render() endtry enddef +# Public functions +# # Search for the "failed" directory in the passed _subtreedirname_ directories # (usually "\" or "\") and, if found, select its passed _count_ # occurrence, add all its "*.dump" files to the argument list and list them; From 8cbe2e0a0a78f57bb545a97695bfedd6a95e6992 Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Sun, 12 Jan 2025 09:27:01 +0100 Subject: [PATCH 12/93] patch 9.1.1007: filetype: various ignore are not recognized Problem: filetype: various ignore are not recognized Solution: detect rg/docker/npm/vvsce ignore files as 'gitgnore' filetype (Wu, Zhenyu) Not only prettier, but many programs also support ignore files (like rg, docker, npm, vscode). So use the gitignore filetype for them due to same syntax closes: #16428 Signed-off-by: Wu, Zhenyu Signed-off-by: Christian Brabandt --- runtime/filetype.vim | 1 + src/testdir/test_filetype.vim | 2 +- src/version.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 154ce79cb6..29f702f27d 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -951,6 +951,7 @@ au BufNewFile,BufRead */.config/git/attributes setf gitattributes au BufNewFile,BufRead */etc/gitattributes setf gitattributes au BufNewFile,BufRead .gitignore,*.git/info/exclude setf gitignore au BufNewFile,BufRead */.config/git/ignore,*.prettierignore setf gitignore +au BufNewFile,BufRead .rgignore,.ignore,.dockerignore,.npmignore,.vscodeignore setf gitignore au BufNewFile,BufRead git-rebase-todo setf gitrebase au BufRead,BufNewFile .gitsendemail.msg.?????? setf gitsendemail au BufNewFile,BufRead *.git/* diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 6d64d9df6e..3b3b2f9200 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -309,7 +309,7 @@ def s:GetFilenameChecks(): dict> gitattributes: ['file.git/info/attributes', '.gitattributes', '/.config/git/attributes', '/etc/gitattributes', '/usr/local/etc/gitattributes', 'some.git/info/attributes'] + WhenConfigHome('$XDG_CONFIG_HOME/git/attributes'), gitcommit: ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG', 'NOTES_EDITMSG', 'EDIT_DESCRIPTION'], gitconfig: ['file.git/config', 'file.git/config.worktree', 'file.git/worktrees/x/config.worktree', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config', '/etc/gitconfig', '/usr/local/etc/gitconfig', '/etc/gitconfig.d/file', 'any/etc/gitconfig.d/file', '/.gitconfig.d/file', 'any/.config/git/config', 'any/.gitconfig.d/file', 'some.git/config', 'some.git/modules/any/config'] + WhenConfigHome('$XDG_CONFIG_HOME/git/config'), - gitignore: ['file.git/info/exclude', '.gitignore', '/.config/git/ignore', 'some.git/info/exclude'] + WhenConfigHome('$XDG_CONFIG_HOME/git/ignore') + ['.prettierignore'], + gitignore: ['file.git/info/exclude', '.gitignore', '/.config/git/ignore', 'some.git/info/exclude'] + WhenConfigHome('$XDG_CONFIG_HOME/git/ignore') + ['.prettierignore', '.rgignore', '.ignore', '.dockerignore', '.npmignore', '.vscodeignore'], gitolite: ['gitolite.conf', '/gitolite-admin/conf/file', 'any/gitolite-admin/conf/file'], gitrebase: ['git-rebase-todo'], gitsendemail: ['.gitsendemail.msg.xxxxxx'], diff --git a/src/version.c b/src/version.c index 9d9f905355..45fcbd3a39 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1007, /**/ 1006, /**/ From faf250c9e4f6f9fa5db38d9373735e77ba438a90 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 12 Jan 2025 09:32:27 +0100 Subject: [PATCH 13/93] patch 9.1.1008: tests: test for patch 9.1.1006 doesn't fail without the patch Problem: tests: test for patch 9.1.1006 doesn't fail without the patch (after v9.1.1006) Solution: Add ctermbg=NONE to the highlight groups (zeertzjq). closes: #16425 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- src/testdir/test_popup.vim | 4 ++-- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 08b9cd9ca9..d4d1c2fed7 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -1513,9 +1513,9 @@ func Test_pum_highlights_match() call VerifyScreenDump(buf, 'Test_pum_highlights_15', {}) call term_sendkeys(buf, "\\") - call term_sendkeys(buf, ":hi PmenuMatchSel ctermfg=14\") + call term_sendkeys(buf, ":hi PmenuMatchSel ctermfg=14 ctermbg=NONE\") call TermWait(buf, 50) - call term_sendkeys(buf, ":hi PmenuMatch ctermfg=12\") + call term_sendkeys(buf, ":hi PmenuMatch ctermfg=12 ctermbg=NONE\") call term_sendkeys(buf, ":set cot=menu,noinsert,fuzzy\") call term_sendkeys(buf, "S\\") call TermWait(buf, 50) diff --git a/src/version.c b/src/version.c index 45fcbd3a39..858034e6ea 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1008, /**/ 1007, /**/ From 7c7a4e6d1ad50d5b25b42aa2d5a33a8d04a4cc8a Mon Sep 17 00:00:00 2001 From: Jonathon Date: Sun, 12 Jan 2025 09:58:00 +0100 Subject: [PATCH 14/93] patch 9.1.1009: diff feature can be improved Problem: diff feature can be improved Solution: include the linematch diff alignment algorithm (Jonathon) closes: #9661 Signed-off-by: Jonathon Signed-off-by: Christian Brabandt --- Filelist | 2 + runtime/doc/options.txt | 94 ++-- runtime/doc/version9.txt | 5 +- src/Make_ami.mak | 1 + src/Make_cyg_ming.mak | 1 + src/Make_mvc.mak | 4 + src/Make_vms.mms | 5 + src/Makefile | 11 + src/diff.c | 527 ++++++++++++++++-- src/drawline.c | 18 +- src/globals.h | 1 + src/linematch.c | 486 ++++++++++++++++ src/proto.h | 1 + src/proto/diff.pro | 1 + src/proto/linematch.pro | 3 + src/proto/strings.pro | 1 + src/strings.c | 16 + src/structs.h | 2 + src/testdir/dumps/Test_diff_23.dump | 20 + src/testdir/dumps/Test_diff_24.dump | 20 + .../dumps/Test_diff_get_put_linematch_1.dump | 20 + .../dumps/Test_diff_get_put_linematch_10.dump | 20 + .../dumps/Test_diff_get_put_linematch_11.dump | 20 + .../dumps/Test_diff_get_put_linematch_12.dump | 20 + .../dumps/Test_diff_get_put_linematch_13.dump | 20 + .../dumps/Test_diff_get_put_linematch_14.dump | 20 + .../dumps/Test_diff_get_put_linematch_15.dump | 20 + .../dumps/Test_diff_get_put_linematch_16.dump | 20 + .../dumps/Test_diff_get_put_linematch_17.dump | 20 + .../dumps/Test_diff_get_put_linematch_18.dump | 20 + .../dumps/Test_diff_get_put_linematch_19.dump | 20 + .../dumps/Test_diff_get_put_linematch_2.dump | 20 + .../dumps/Test_diff_get_put_linematch_3.dump | 20 + .../dumps/Test_diff_get_put_linematch_4.dump | 20 + .../dumps/Test_diff_get_put_linematch_5.dump | 20 + .../dumps/Test_diff_get_put_linematch_6.dump | 20 + .../dumps/Test_diff_get_put_linematch_7.dump | 20 + .../dumps/Test_diff_get_put_linematch_8.dump | 20 + .../dumps/Test_diff_get_put_linematch_9.dump | 20 + src/testdir/dumps/Test_linematch_3diffs1.dump | 20 + src/testdir/dumps/Test_linematch_diff1.dump | 20 + .../dumps/Test_linematch_diff_grouping1.dump | 20 + .../dumps/Test_linematch_diff_grouping2.dump | 20 + .../Test_linematch_diff_grouping_scroll0.dump | 20 + .../Test_linematch_diff_grouping_scroll1.dump | 20 + .../Test_linematch_diff_grouping_scroll2.dump | 20 + .../dumps/Test_linematch_diff_iwhite1.dump | 20 + .../dumps/Test_linematch_diff_iwhite2.dump | 20 + .../Test_linematch_line_limit_exceeded1.dump | 20 + .../Test_linematch_line_limit_exceeded2.dump | 20 + src/testdir/test_diffmode.vim | 442 +++++++++++++++ src/version.c | 2 + src/vim.h | 1 + 53 files changed, 2162 insertions(+), 102 deletions(-) create mode 100644 src/linematch.c create mode 100644 src/proto/linematch.pro create mode 100644 src/testdir/dumps/Test_diff_23.dump create mode 100644 src/testdir/dumps/Test_diff_24.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_1.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_10.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_11.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_12.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_13.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_14.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_15.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_16.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_17.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_18.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_19.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_2.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_3.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_4.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_5.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_6.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_7.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_8.dump create mode 100644 src/testdir/dumps/Test_diff_get_put_linematch_9.dump create mode 100644 src/testdir/dumps/Test_linematch_3diffs1.dump create mode 100644 src/testdir/dumps/Test_linematch_diff1.dump create mode 100644 src/testdir/dumps/Test_linematch_diff_grouping1.dump create mode 100644 src/testdir/dumps/Test_linematch_diff_grouping2.dump create mode 100644 src/testdir/dumps/Test_linematch_diff_grouping_scroll0.dump create mode 100644 src/testdir/dumps/Test_linematch_diff_grouping_scroll1.dump create mode 100644 src/testdir/dumps/Test_linematch_diff_grouping_scroll2.dump create mode 100644 src/testdir/dumps/Test_linematch_diff_iwhite1.dump create mode 100644 src/testdir/dumps/Test_linematch_diff_iwhite2.dump create mode 100644 src/testdir/dumps/Test_linematch_line_limit_exceeded1.dump create mode 100644 src/testdir/dumps/Test_linematch_line_limit_exceeded2.dump diff --git a/Filelist b/Filelist index 0a1d9936a2..aefed89d88 100644 --- a/Filelist +++ b/Filelist @@ -52,6 +52,7 @@ SRC_ALL = \ src/debugger.c \ src/dict.c \ src/diff.c \ + src/linematch.c \ src/digraph.c \ src/drawline.c \ src/drawscreen.c \ @@ -286,6 +287,7 @@ SRC_ALL = \ src/proto/insexpand.pro \ src/proto/job.pro \ src/proto/json.pro \ + src/proto/linematch.pro \ src/proto/list.pro \ src/proto/locale.pro \ src/proto/logfile.pro \ diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 780db60aba..2f64ba3be0 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Jan 10 +*options.txt* For Vim version 9.1. Last change: 2025 Jan 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2880,11 +2880,20 @@ A jump table for the options with a short description can be found at |Q_op|. Option settings for diff mode. It can consist of the following items. All are optional. Items must be separated by a comma. - filler Show filler lines, to keep the text - synchronized with a window that has inserted - lines at the same position. Mostly useful - when windows are side-by-side and 'scrollbind' - is set. + algorithm:{text} Use the specified diff algorithm with the + internal diff engine. Currently supported + algorithms are: + myers the default algorithm + minimal spend extra time to generate the + smallest possible diff + patience patience diff algorithm + histogram histogram diff algorithm + + closeoff When a window is closed where 'diff' is set + and there is only one window remaining in the + same tab page with 'diff' set, execute + `:diffoff` in that window. This undoes a + `:diffsplit` command. context:{n} Use a context of {n} lines between a change and a fold that contains unchanged lines. @@ -2895,6 +2904,23 @@ A jump table for the options with a short description can be found at |Q_op|. value (999999) to disable folding completely. See |fold-diff|. + filler Show filler lines, to keep the text + synchronized with a window that has inserted + lines at the same position. Mostly useful + when windows are side-by-side and 'scrollbind' + is set. + + foldcolumn:{n} Set the 'foldcolumn' option to {n} when + starting diff mode. Without this 2 is used. + + followwrap Follow the 'wrap' option and leave as it is. + + horizontal Start diff mode with horizontal splits (unless + explicitly specified otherwise). + + hiddenoff Do not use diff mode for a buffer when it + becomes hidden. + iblank Ignore changes where lines are all blank. Adds the "-B" flag to the "diff" command if 'diffexpr' is empty. Check the documentation @@ -2908,6 +2934,17 @@ A jump table for the options with a short description can be found at |Q_op|. are considered the same. Adds the "-i" flag to the "diff" command if 'diffexpr' is empty. + indent-heuristic + Use the indent heuristic for the internal + diff library. + + internal Use the internal diff library. This is + ignored when 'diffexpr' is set. *E960* + When running out of memory when writing a + buffer this item will be ignored for diffs + involving that buffer. Set the 'verbose' + option to see when this happens. + iwhite Ignore changes in amount of white space. Adds the "-b" flag to the "diff" command if 'diffexpr' is empty. Check the documentation @@ -2927,46 +2964,19 @@ A jump table for the options with a short description can be found at |Q_op|. of the "diff" command for what this does exactly. - horizontal Start diff mode with horizontal splits (unless - explicitly specified otherwise). + linematch:{n} Align and mark changes between the most + similar lines between the buffers. When the + total number of lines in the diff hunk exceeds + {n}, the lines will not be aligned because for + very large diff hunks there will be a + noticeable lag. A reasonable setting is + "linematch:60", as this will enable alignment + for a 2 buffer diff hunk of 30 lines each, + or a 3 buffer diff hunk of 20 lines each. vertical Start diff mode with vertical splits (unless explicitly specified otherwise). - closeoff When a window is closed where 'diff' is set - and there is only one window remaining in the - same tab page with 'diff' set, execute - `:diffoff` in that window. This undoes a - `:diffsplit` command. - - hiddenoff Do not use diff mode for a buffer when it - becomes hidden. - - foldcolumn:{n} Set the 'foldcolumn' option to {n} when - starting diff mode. Without this 2 is used. - - followwrap Follow the 'wrap' option and leave as it is. - - internal Use the internal diff library. This is - ignored when 'diffexpr' is set. *E960* - When running out of memory when writing a - buffer this item will be ignored for diffs - involving that buffer. Set the 'verbose' - option to see when this happens. - - indent-heuristic - Use the indent heuristic for the internal - diff library. - - algorithm:{text} Use the specified diff algorithm with the - internal diff engine. Currently supported - algorithms are: - myers the default algorithm - minimal spend extra time to generate the - smallest possible diff - patience patience diff algorithm - histogram histogram diff algorithm - Examples: > :set diffopt=internal,filler,context:4 :set diffopt= diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index bcb0b78f7b..e212230e5b 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2025 Jan 02 +*version9.txt* For Vim version 9.1. Last change: 2025 Jan 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41625,6 +41625,9 @@ Changed~ the "matches" key - |v:stacktrace| The stack trace of the exception most recently caught and not finished +- include the linematch algorithm for the 'diffopt' setting. This aligns + changes between buffers on similar lines improving the diff highlighting in + Vim *added-9.2* Added ~ diff --git a/src/Make_ami.mak b/src/Make_ami.mak index 42270f36ba..c779914292 100644 --- a/src/Make_ami.mak +++ b/src/Make_ami.mak @@ -123,6 +123,7 @@ SRC += \ indent.c \ insexpand.c \ json.c \ + linematch.c\ list.c \ locale.c \ logfile.c \ diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak index cd84b85a5a..3f2a6dabdb 100644 --- a/src/Make_cyg_ming.mak +++ b/src/Make_cyg_ming.mak @@ -817,6 +817,7 @@ OBJ = \ $(OUTDIR)/indent.o \ $(OUTDIR)/insexpand.o \ $(OUTDIR)/json.o \ + $(OUTDIR)/linematch.o \ $(OUTDIR)/list.o \ $(OUTDIR)/locale.o \ $(OUTDIR)/logfile.o \ diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 49d8a33732..c24f0af855 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -738,6 +738,7 @@ OBJ = \ $(OUTDIR)\indent.obj \ $(OUTDIR)\insexpand.obj \ $(OUTDIR)\json.obj \ + $(OUTDIR)\linematch.obj \ $(OUTDIR)\list.obj \ $(OUTDIR)\locale.obj \ $(OUTDIR)\logfile.obj \ @@ -1675,6 +1676,8 @@ $(OUTDIR)/job.obj: $(OUTDIR) job.c $(INCL) $(OUTDIR)/json.obj: $(OUTDIR) json.c $(INCL) +$(OUTDIR)/linematch.obj: $(OUTDIR) linematch.c $(INCL) + $(OUTDIR)/list.obj: $(OUTDIR) list.c $(INCL) $(OUTDIR)/locale.obj: $(OUTDIR) locale.c $(INCL) @@ -1954,6 +1957,7 @@ proto.h: \ proto/indent.pro \ proto/insexpand.pro \ proto/json.pro \ + proto/linematch.pro \ proto/list.pro \ proto/locale.pro \ proto/logfile.pro \ diff --git a/src/Make_vms.mms b/src/Make_vms.mms index 559c2f8e43..20630236fe 100644 --- a/src/Make_vms.mms +++ b/src/Make_vms.mms @@ -381,6 +381,7 @@ SRC = \ insexpand.c \ job.c \ json.c \ + linematch.c \ list.c \ locale.c \ logfile.c \ @@ -514,6 +515,7 @@ OBJ = \ insexpand.obj \ job.obj \ json.obj \ + linematch.obj \ list.obj \ locale.obj \ logfile.obj \ @@ -986,6 +988,9 @@ job.obj : job.c vim.h [.auto]config.h feature.h os_unix.h json.obj : json.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h +linematch.obj : linematch.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ + [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h list.obj : list.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h termdefs.h macros.h option.h structs.h regexp.h gui.h \ beval.h [.proto]gui_beval.pro alloc.h ex_cmds.h spell.h proto.h \ diff --git a/src/Makefile b/src/Makefile index f5d01cf082..7f26c908c8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1531,6 +1531,7 @@ BASIC_SRC = \ indent.c \ insexpand.c \ json.c \ + linematch.c \ list.c \ locale.c \ logfile.c \ @@ -1693,6 +1694,7 @@ OBJ_COMMON = \ objects/if_xcmdsrv.o \ objects/indent.o \ objects/insexpand.o \ + objects/linematch.o \ objects/list.o \ objects/locale.o \ objects/logfile.o \ @@ -1842,6 +1844,7 @@ PRO_AUTO = \ debugger.pro \ dict.pro \ diff.pro \ + linematch.pro \ digraph.pro \ drawline.pro \ drawscreen.pro \ @@ -3343,6 +3346,9 @@ objects/json_test.o: json_test.c objects/kword_test.o: kword_test.c $(CCC) -o $@ kword_test.c +objects/linematch.o: linematch.c + $(CCC) -o $@ linematch.c + objects/list.o: list.c $(CCC) -o $@ list.c @@ -3944,6 +3950,11 @@ objects/json.o: json.c vim.h protodef.h auto/config.h feature.h os_unix.h \ proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ libvterm/include/vterm_keycodes.h alloc.h ex_cmds.h spell.h proto.h \ globals.h errors.h +objects/linematch.o: linematch.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h xdiff/xdiff.h \ + xdiff/../vim.h alloc.h ex_cmds.h spell.h proto.h globals.h errors.h objects/list.o: list.c vim.h protodef.h auto/config.h feature.h os_unix.h \ auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ diff --git a/src/diff.c b/src/diff.c index ebe409e5f3..971ef6520d 100644 --- a/src/diff.c +++ b/src/diff.c @@ -37,6 +37,7 @@ static int diff_need_update = FALSE; // ex_diffupdate needs to be called #define DIFF_INTERNAL 0x200 // use internal xdiff algorithm #define DIFF_CLOSE_OFF 0x400 // diffoff when closing window #define DIFF_FOLLOWWRAP 0x800 // follow the wrap option +#define DIFF_LINEMATCH 0x1000 // match most similar lines within diff #define ALL_WHITE_DIFF (DIFF_IWHITE | DIFF_IWHITEALL | DIFF_IWHITEEOL) static int diff_flags = DIFF_INTERNAL | DIFF_FILLER | DIFF_CLOSE_OFF; @@ -398,7 +399,8 @@ diff_mark_adjust_tp( { // 6. change below line2: only adjust for amount_after; also when // "deleted" became zero when deleted all lines between two diffs - if (dp->df_lnum[idx] - (deleted + inserted != 0) > line2) + if (dp->df_lnum[idx] - (deleted + inserted != 0) > line2 - + (dp->is_linematched ? 1 : 0)) { if (amount_after == 0) break; // nothing left to change @@ -501,8 +503,9 @@ diff_mark_adjust_tp( } // check if this block touches the previous one, may merge them. - if (dprev != NULL && dprev->df_lnum[idx] + dprev->df_count[idx] - == dp->df_lnum[idx]) + if (dprev != NULL && !dp->is_linematched + && dprev->df_lnum[idx] + dprev->df_count[idx] + == dp->df_lnum[idx]) { for (i = 0; i < DB_COUNT; ++i) if (tp->tp_diffbuf[i] != NULL) @@ -570,6 +573,7 @@ diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp) if (dnew == NULL) return NULL; + dnew->is_linematched = FALSE; dnew->df_next = dp; if (dprev == NULL) tp->tp_first_diff = dnew; @@ -753,13 +757,16 @@ clear_diffout(diffout_T *dout) * Return FAIL for failure. */ static int -diff_write_buffer(buf_T *buf, diffin_T *din) +diff_write_buffer(buf_T *buf, diffin_T *din, linenr_T start, linenr_T end) { linenr_T lnum; char_u *s; long len = 0; char_u *ptr; + if (end < 0) + end = buf->b_ml.ml_line_count; + if (buf->b_ml.ml_flags & ML_EMPTY) { din->din_mmfile.ptr = NULL; @@ -768,7 +775,7 @@ diff_write_buffer(buf_T *buf, diffin_T *din) } // xdiff requires one big block of memory with all the text. - for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum) + for (lnum = start; lnum <= end; ++lnum) len += ml_get_buf_len(buf, lnum) + 1; ptr = alloc(len); if (ptr == NULL) @@ -790,7 +797,7 @@ diff_write_buffer(buf_T *buf, diffin_T *din) din->din_mmfile.size = len; len = 0; - for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum) + for (lnum = start; lnum <= end; ++lnum) { for (s = ml_get_buf(buf, lnum, FALSE); *s != NUL; ) { @@ -841,7 +848,7 @@ diff_write(buf_T *buf, diffin_T *din) int save_cmod_flags; if (din->din_fname == NULL) - return diff_write_buffer(buf, din); + return diff_write_buffer(buf, din, 1, -1); // Always use 'fileformat' set to "unix". save_ff = buf->b_p_ff; @@ -1922,6 +1929,360 @@ diff_clear(tabpage_T *tp) tp->tp_first_diff = NULL; } +/* + * return true if the options are set to use diff linematch + */ + static int +diff_linematch(diff_T *dp) +{ + if (!(diff_flags & DIFF_LINEMATCH)) + return 0; + + // are there more than three diff buffers? + int tsize = 0; + for (int i = 0; i < DB_COUNT; i++) + { + if (curtab->tp_diffbuf[i] != NULL) + { + // for the rare case (bug?) that the count of a diff block is + // negative, do not run the algorithm because this will try to + // allocate a negative amount of space and crash + if (dp->df_count[i] < 0) + return FALSE; + tsize += dp->df_count[i]; + } + } + + // avoid allocating a huge array because it will lag + return tsize <= linematch_lines; +} + + static int +get_max_diff_length(const diff_T *dp) +{ + int maxlength = 0; + + for (int k = 0; k < DB_COUNT; k++) + { + if (curtab->tp_diffbuf[k] != NULL) + { + if (dp->df_count[k] > maxlength) + maxlength = dp->df_count[k]; + } + } + return maxlength; +} + + static void +find_top_diff_block( + diff_T **thistopdiff, + diff_T **nextblockblock, + int fromidx, + int topline) +{ + diff_T *topdiff = NULL; + diff_T *localtopdiff = NULL; + int topdiffchange = 0; + + for (topdiff = curtab->tp_first_diff; topdiff != NULL; + topdiff = topdiff->df_next) + { + // set the top of the current overlapping diff block set as we + // iterate through all of the sets of overlapping diff blocks + if (!localtopdiff || topdiffchange) + { + localtopdiff = topdiff; + topdiffchange = 0; + } + + // check if the fromwin topline is matched by the current diff. if so, + // set it to the top of the diff block + if (topline >= topdiff->df_lnum[fromidx] && topline <= + (topdiff->df_lnum[fromidx] + topdiff->df_count[fromidx])) + { + // this line is inside the current diff block, so we will save the + // top block of the set of blocks to refer to later + if ((*thistopdiff) == NULL) + (*thistopdiff) = localtopdiff; + } + + // check if the next set of overlapping diff blocks is next + if (!(topdiff->df_next && (topdiff->df_next->df_lnum[fromidx] == + (topdiff->df_lnum[fromidx] + + topdiff->df_count[fromidx])))) + { + // mark that the next diff block is belongs to a different set of + // overlapping diff blocks + topdiffchange = 1; + + // if we already have found that the line number is inside a diff + // block, set the marker of the next block and finish the iteration + if (*thistopdiff) + { + (*nextblockblock) = topdiff->df_next; + break; + } + } + } +} + + static void +count_filler_lines_and_topline( + int *curlinenum_to, + int *linesfiller, + const diff_T *thistopdiff, + const int toidx, + int virtual_lines_passed) +{ + const diff_T *curdif = thistopdiff; + int ch_virtual_lines = 0; + int isfiller = FALSE; + + while (virtual_lines_passed > 0) + { + if (ch_virtual_lines) + { + virtual_lines_passed--; + ch_virtual_lines--; + if (!isfiller) + (*curlinenum_to)++; + else + (*linesfiller)++; + } + else + { + (*linesfiller) = 0; + ch_virtual_lines = get_max_diff_length(curdif); + isfiller = (curdif->df_count[toidx] ? FALSE : TRUE); + if (isfiller) + { + while (curdif && curdif->df_next && + curdif->df_lnum[toidx] == + curdif->df_next->df_lnum[toidx] && + curdif->df_next->df_count[toidx] == 0) + { + curdif = curdif->df_next; + ch_virtual_lines += get_max_diff_length(curdif); + } + } + if (curdif) + curdif = curdif->df_next; + } + } +} + + static void +calculate_topfill_and_topline( + const int fromidx, + const int toidx, + const int from_topline, + const int from_topfill, + int *topfill, + linenr_T *topline) +{ + // 1. find the position from the top of the diff block, and the start + // of the next diff block + diff_T *thistopdiff = NULL; + diff_T *nextblockblock = NULL; + int virtual_lines_passed = 0; + + find_top_diff_block(&thistopdiff, &nextblockblock, fromidx, from_topline); + + // count the virtual lines that have been passed + diff_T *curdif = thistopdiff; + while (curdif && (curdif->df_lnum[fromidx] + curdif->df_count[fromidx]) + <= from_topline) + { + virtual_lines_passed += get_max_diff_length(curdif); + + curdif = curdif->df_next; + } + + if (curdif != nextblockblock) + virtual_lines_passed += from_topline - curdif->df_lnum[fromidx]; + virtual_lines_passed -= from_topfill; + + // count the same amount of virtual lines in the toidx buffer + int curlinenum_to = thistopdiff->df_lnum[toidx]; + int linesfiller = 0; + + count_filler_lines_and_topline(&curlinenum_to, &linesfiller, thistopdiff, + toidx, virtual_lines_passed); + + // count the number of filler lines that would normally be above this line + int maxfiller = 0; + for (diff_T *dpfillertest = thistopdiff; dpfillertest != NULL; + dpfillertest = dpfillertest->df_next) + { + if (dpfillertest->df_lnum[toidx] == curlinenum_to) + { + while (dpfillertest && dpfillertest->df_lnum[toidx] == + curlinenum_to) + { + maxfiller += dpfillertest->df_count[toidx] ? 0 : + get_max_diff_length(dpfillertest); + dpfillertest = dpfillertest->df_next; + } + break; + } + } + (*topfill) = maxfiller - linesfiller; + (*topline) = curlinenum_to; +} + + static int +linematched_filler_lines(diff_T *dp, int idx, linenr_T lnum, int *linestatus) +{ + int filler_lines_d1 = 0; + + while (dp && dp->df_next && + lnum == (dp->df_lnum[idx] + dp->df_count[idx]) && + dp->df_next->df_lnum[idx] == lnum) + { + if (dp->df_count[idx] == 0) + filler_lines_d1 += get_max_diff_length(dp); + dp = dp->df_next; + } + + if (dp->df_count[idx] == 0) + filler_lines_d1 += get_max_diff_length(dp); + + if (lnum < dp->df_lnum[idx] + dp->df_count[idx]) + { + int j = 0; + + for (int i = 0; i < DB_COUNT; i++) + { + if (curtab->tp_diffbuf[i] != NULL) + { + if (dp->df_count[i]) + j++; + } + // is this an added line or a changed line? + if (linestatus) + (*linestatus) = (j == 1) ? -2 : -1; + } + } + + return filler_lines_d1; +} + +// Apply results from the linematch algorithm and apply to 'dp' by splitting it +// into multiple adjacent diff blocks. + static void +apply_linematch_results( + diff_T *dp, + size_t decisions_length, + const int *decisions) +{ + // get the start line number here in each diff buffer, and then increment + int line_numbers[DB_COUNT]; + int outputmap[DB_COUNT]; + size_t ndiffs = 0; + + for (int i = 0; i < DB_COUNT; i++) + { + if (curtab->tp_diffbuf[i] != NULL) + { + line_numbers[i] = dp->df_lnum[i]; + dp->df_count[i] = 0; + + // Keep track of the index of the diff buffer we are using here. + // We will use this to write the output of the algorithm to + // diff_T structs at the correct indexes + outputmap[ndiffs] = i; + ndiffs++; + } + } + + // write the diffs starting with the current diff block + diff_T *dp_s = dp; + for (size_t i = 0; i < decisions_length; i++) + { + // Don't allocate on first iter since we can reuse the initial + // diffblock + if (i != 0 && (decisions[i - 1] != decisions[i])) + { + // create new sub diff blocks to segment the original diff block + // which we further divided by running the linematch algorithm + dp_s = diff_alloc_new(curtab, dp_s, dp_s->df_next); + dp_s->is_linematched = TRUE; + for (int j = 0; j < DB_COUNT; j++) + { + if (curtab->tp_diffbuf[j] != NULL) + { + dp_s->df_lnum[j] = line_numbers[j]; + dp_s->df_count[j] = 0; + } + } + } + for (size_t j = 0; j < ndiffs; j++) + { + if (decisions[i] & (1 << j)) + { + // will need to use the map here + dp_s->df_count[outputmap[j]]++; + line_numbers[outputmap[j]]++; + } + } + } + dp->is_linematched = TRUE; +} + + static void +run_linematch_algorithm(diff_T *dp) +{ + // define buffers for diff algorithm + diffin_T diffbufs_mm[DB_COUNT]; + const mmfile_t *diffbufs[DB_COUNT]; + int diff_length[DB_COUNT]; + size_t ndiffs = 0; + + for (int i = 0; i < DB_COUNT; i++) + { + if (curtab->tp_diffbuf[i] != NULL) + { + // write the contents of the entire buffer to + // diffbufs_mm[diffbuffers_count] + if (dp->df_count[i] > 0) + { + diff_write_buffer(curtab->tp_diffbuf[i], &diffbufs_mm[ndiffs], + dp->df_lnum[i], dp->df_lnum[i] + dp->df_count[i] - 1); + } + else + { + diffbufs_mm[ndiffs].din_mmfile.size = 0; + diffbufs_mm[ndiffs].din_mmfile.ptr = NULL; + } + + diffbufs[ndiffs] = &diffbufs_mm[ndiffs].din_mmfile; + + // keep track of the length of this diff block to pass it to the + // linematch algorithm + diff_length[ndiffs] = dp->df_count[i]; + + // increment the amount of diff buffers we are passing to the + // algorithm + ndiffs++; + } + } + + // we will get the output of the linematch algorithm in the format of an + // array of integers (*decisions) and the length of that array + // (decisions_length) + int *decisions = NULL; + const int iwhite = (diff_flags & (DIFF_IWHITEALL | DIFF_IWHITE)) > 0 ? 1 : 0; + size_t decisions_length = + linematch_nbuffers(diffbufs, diff_length, ndiffs, &decisions, iwhite); + + for (size_t i = 0; i < ndiffs; i++) + free(diffbufs_mm[i].din_mmfile.ptr); // TODO should this be vim_free ? + + apply_linematch_results(dp, decisions_length, decisions); + + free(decisions); +} + /* * Check diff status for line "lnum" in buffer "buf": * Returns 0 for nothing special @@ -1930,9 +2291,15 @@ diff_clear(tabpage_T *tp) * Returns > 0 for inserting that many filler lines above it (never happens * when 'diffopt' doesn't contain "filler"). * This should only be used for windows where 'diff' is set. + * When diffopt contains linematch, a changed/added/deleted line + * may also have filler lines above it. In such a case, the possibilities + * are no longer mutually exclusive. The number of filler lines is + * returned from diff_check, and the integer 'linestatus' passed by + * pointer is set to -1 to indicate a changed line, and -2 to indicate an + * added line */ int -diff_check(win_T *wp, linenr_T lnum) +diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus) { int idx; // index in tp_diffbuf[] for this buffer diff_T *dp; @@ -1968,6 +2335,15 @@ diff_check(win_T *wp, linenr_T lnum) if (dp == NULL || lnum < dp->df_lnum[idx]) return 0; + // Don't run linematch when lnum is offscreen. Useful for scrollbind + // calculations which need to count all the filler lines above the screen. + if (lnum >= wp->w_topline && lnum < wp->w_botline + && !dp->is_linematched && diff_linematch(dp)) + run_linematch_algorithm(dp); + + if (dp->is_linematched) + return linematched_filler_lines(dp, idx, lnum, linestatus); + if (lnum < dp->df_lnum[idx] + dp->df_count[idx]) { int zero = FALSE; @@ -2014,13 +2390,16 @@ diff_check(win_T *wp, linenr_T lnum) // Insert filler lines above the line just below the change. Will return // 0 when this buf had the max count. - maxcount = 0; - for (i = 0; i < DB_COUNT; ++i) - if (curtab->tp_diffbuf[i] != NULL && dp->df_count[i] > maxcount) - maxcount = dp->df_count[i]; + maxcount = get_max_diff_length(dp); return maxcount - dp->df_count[idx]; } + int +diff_check(win_T *wp, linenr_T lnum) +{ + return diff_check_with_linestatus(wp, lnum, NULL); +} + /* * Compare two entries in diff "*dp" and return TRUE if they are equal. */ @@ -2194,53 +2573,64 @@ diff_set_topline(win_T *fromwin, win_T *towin) towin->w_topline = lnum + (dp->df_lnum[toidx] - dp->df_lnum[fromidx]); if (lnum >= dp->df_lnum[fromidx]) { - // Inside a change: compute filler lines. With three or more - // buffers we need to know the largest count. - max_count = 0; - for (i = 0; i < DB_COUNT; ++i) - if (curtab->tp_diffbuf[i] != NULL - && max_count < dp->df_count[i]) - max_count = dp->df_count[i]; - - if (dp->df_count[toidx] == dp->df_count[fromidx]) + if (dp->is_linematched) { - // same number of lines: use same filler count - towin->w_topfill = fromwin->w_topfill; + calculate_topfill_and_topline(fromidx, toidx, + fromwin->w_topline, + fromwin->w_topfill, + &towin->w_topfill, + &towin->w_topline); } - else if (dp->df_count[toidx] > dp->df_count[fromidx]) + else { - if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) + // Inside a change: compute filler lines. With three or more + // buffers we need to know the largest count. + max_count = 0; + for (i = 0; i < DB_COUNT; ++i) + if (curtab->tp_diffbuf[i] != NULL + && max_count < dp->df_count[i]) + max_count = dp->df_count[i]; + + if (dp->df_count[toidx] == dp->df_count[fromidx]) + { + // same number of lines: use same filler count + towin->w_topfill = fromwin->w_topfill; + } + else if (dp->df_count[toidx] > dp->df_count[fromidx]) { - // more lines in towin and fromwin doesn't show diff - // lines, only filler lines - if (max_count - fromwin->w_topfill >= dp->df_count[toidx]) + if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) { - // towin also only shows filler lines - towin->w_topline = dp->df_lnum[toidx] - + dp->df_count[toidx]; - towin->w_topfill = fromwin->w_topfill; + // more lines in towin and fromwin doesn't show diff + // lines, only filler lines + if (max_count - fromwin->w_topfill >= dp->df_count[toidx]) + { + // towin also only shows filler lines + towin->w_topline = dp->df_lnum[toidx] + + dp->df_count[toidx]; + towin->w_topfill = fromwin->w_topfill; + } + else + // towin still has some diff lines to show + towin->w_topline = dp->df_lnum[toidx] + + max_count - fromwin->w_topfill; } - else - // towin still has some diff lines to show - towin->w_topline = dp->df_lnum[toidx] - + max_count - fromwin->w_topfill; } - } - else if (towin->w_topline >= dp->df_lnum[toidx] - + dp->df_count[toidx]) - { - // less lines in towin and no diff lines to show: compute - // filler lines - towin->w_topline = dp->df_lnum[toidx] + dp->df_count[toidx]; - if (diff_flags & DIFF_FILLER) + else if (towin->w_topline >= dp->df_lnum[toidx] + + dp->df_count[toidx]) { - if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) - // fromwin is also out of diff lines - towin->w_topfill = fromwin->w_topfill; - else - // fromwin has some diff lines - towin->w_topfill = dp->df_lnum[fromidx] - + max_count - lnum; + // less lines in towin and no diff lines to show: compute + // filler lines + towin->w_topline = dp->df_lnum[toidx] + dp->df_count[toidx]; + if (diff_flags & DIFF_FILLER) + { + if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) + // fromwin is also out of diff lines + towin->w_topfill = fromwin->w_topfill; + else + // fromwin has some diff lines + towin->w_topfill = dp->df_lnum[fromidx] + + max_count - lnum; + } } } } @@ -2278,6 +2668,7 @@ diffopt_changed(void) { char_u *p; int diff_context_new = 6; + int linematch_lines_new = 0; int diff_flags_new = 0; int diff_foldcolumn_new = 2; long diff_algorithm_new = 0; @@ -2390,6 +2781,12 @@ diffopt_changed(void) else return FAIL; } + else if (STRNCMP(p, "linematch:", 10) == 0 && VIM_ISDIGIT(p[11])) + { + p += 10; + linematch_lines_new = getdigits(&p); + diff_flags_new |= DIFF_LINEMATCH; + } if (*p != ',' && *p != NUL) return FAIL; @@ -2411,6 +2808,7 @@ diffopt_changed(void) diff_flags = diff_flags_new; diff_context = diff_context_new == 0 ? 1 : diff_context_new; + linematch_lines = linematch_lines_new; diff_foldcolumn = diff_foldcolumn_new; diff_algorithm = diff_algorithm_new; @@ -2489,6 +2887,13 @@ diff_find_change( FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp) if (lnum <= dp->df_lnum[idx] + dp->df_count[idx]) break; + if (dp->is_linematched) + { + while (dp && dp->df_next + && lnum == dp->df_count[idx] + dp->df_lnum[idx] + && dp->df_next->df_lnum[idx] == lnum) + dp = dp->df_next; + } if (dp == NULL || diff_check_sanity(curtab, dp) == FAIL) { vim_free(line_org); @@ -2829,6 +3234,19 @@ ex_diffgetput(exarg_T *eap) dprev = NULL; for (dp = curtab->tp_first_diff; dp != NULL; ) { + if (!eap->addr_count) + { + // handle the case with adjacent diff blocks + while (dp->is_linematched + && dp->df_next + && dp->df_next->df_lnum[idx_cur] == dp->df_lnum[idx_cur] + + dp->df_count[idx_cur] + && dp->df_next->df_lnum[idx_cur] == eap->line1 + off + 1) + { + dprev = dp; + dp = dp->df_next; + } + } if (dp->df_lnum[idx_cur] > eap->line2 + off) break; // past the range that was specified @@ -3445,10 +3863,11 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) || fnum != curbuf->b_fnum) { // New line, buffer, change: need to get the values. - filler_lines = diff_check(curwin, lnum); - if (filler_lines < 0) + int linestatus = 0; + filler_lines = diff_check_with_linestatus(curwin, lnum, &linestatus); + if (filler_lines < 0 || linestatus < 0) { - if (filler_lines == -1) + if (filler_lines == -1 || linestatus == -1) { change_start = MAXCOL; change_end = -1; diff --git a/src/drawline.c b/src/drawline.c index f3838572c3..a6b6317f83 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -1467,10 +1467,13 @@ win_line( } #ifdef FEAT_DIFF - wlv.filler_lines = diff_check(wp, lnum); - if (wlv.filler_lines < 0) + + int linestatus = 0; + wlv.filler_lines = diff_check_with_linestatus(wp, lnum, &linestatus); + + if (wlv.filler_lines < 0 || linestatus < 0) { - if (wlv.filler_lines == -1) + if (wlv.filler_lines == -1 || linestatus == -1) { if (diff_find_change(wp, lnum, &change_start, &change_end)) wlv.diff_hlf = HLF_ADD; // added line @@ -1480,12 +1483,17 @@ win_line( wlv.diff_hlf = HLF_CHD; // changed line } else - wlv.diff_hlf = HLF_ADD; // added line - wlv.filler_lines = 0; + wlv.diff_hlf = HLF_ADD; + + if (linestatus == 0) + wlv.filler_lines = 0; + area_highlighting = TRUE; } + if (lnum == wp->w_topline) wlv.filler_lines = wp->w_topfill; + wlv.filler_todo = wlv.filler_lines; #endif diff --git a/src/globals.h b/src/globals.h index 77ddea816b..e3b1e27f45 100644 --- a/src/globals.h +++ b/src/globals.h @@ -869,6 +869,7 @@ EXTERN int drag_sep_line INIT(= FALSE); // dragging vert separator #ifdef FEAT_DIFF // Value set from 'diffopt'. EXTERN int diff_context INIT(= 6); // context for folds +EXTERN int linematch_lines INIT(= 0); // number of lines for diff line match EXTERN int diff_foldcolumn INIT(= 2); // 'foldcolumn' for diff mode EXTERN int diff_need_scrollbind INIT(= FALSE); #endif diff --git a/src/linematch.c b/src/linematch.c new file mode 100644 index 0000000000..c1463fdf18 --- /dev/null +++ b/src/linematch.c @@ -0,0 +1,486 @@ +/* vi:set ts=8 sts=4 sw=4 noet: + * + * VIM - Vi IMproved by Bram Moolenaar + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. + * See README.txt for an overview of the Vim source code. + */ + +#include "vim.h" + +#define LN_MAX_BUFS 8 +#define LN_DECISION_MAX 255 // pow(2, LN_MAX_BUFS(8)) - 1 = 255 + +// struct for running the diff linematch algorithm +typedef struct diffcmppath_S diffcmppath_T; +struct diffcmppath_S +{ + // to keep track of the total score of this path + int df_lev_score; + size_t df_path_n; // current index of this path + int df_choice_mem[LN_DECISION_MAX + 1]; + int df_choice[LN_DECISION_MAX]; + // to keep track of this path traveled + diffcmppath_T *df_decision[LN_DECISION_MAX]; + size_t df_optimal_choice; +}; + +static int matching_chars(const mmfile_t *m1, const mmfile_t *m2); +static size_t unwrap_indexes(const int *values, const int *diff_len, const size_t ndiffs); +static size_t test_charmatch_paths(diffcmppath_T *node, int lastdecision); + + static size_t +line_len(const mmfile_t *m) +{ + char *s = m->ptr; + size_t n = (size_t)m->size; + char *end; + + end = vim_strnchr(s, &n, '\n'); + if (end) + return (size_t)(end - s); + + return (size_t)m->size; +} + +#define MATCH_CHAR_MAX_LEN 800 + +/// Same as matching_chars but ignore whitespace +/// +/// @param s1 +/// @param s2 + static int +matching_chars_iwhite(const mmfile_t *s1, const mmfile_t *s2) +{ + // the newly processed strings that will be compared + // delete the white space characters + mmfile_t sp[2]; + char p[2][MATCH_CHAR_MAX_LEN]; + + for (int k = 0; k < 2; k++) + { + const mmfile_t *s = k == 0 ? s1 : s2; + size_t pi = 0; + size_t slen = MIN(MATCH_CHAR_MAX_LEN - 1, line_len(s)); + + for (size_t i = 0; i <= slen; i++) + { + char e = s->ptr[i]; + + if (e != ' ' && e != '\t') + { + p[k][pi] = e; + pi++; + } + } + + sp[k].ptr = p[k]; + sp[k].size = (int)pi; + } + + return matching_chars(&sp[0], &sp[1]); +} + +/// Return matching characters between "s1" and "s2" whilst respecting sequence +/// order. +/// Consider the case of two strings 'AAACCC' and 'CCCAAA', the +/// return value from this function will be 3, either to match +/// the 3 C's, or the 3 A's. +/// +/// Examples: +/// matching_chars("aabc", "acba") -> 2 // 'a' and 'b' in common +/// matching_chars("123hello567", "he123ll567o") -> 8 // '123', 'll' and '567' in common +/// matching_chars("abcdefg", "gfedcba") -> 1 // all characters in common, +/// // but only at most 1 in sequence +/// +/// @param m1 +/// @param m2 + static int +matching_chars(const mmfile_t *m1, const mmfile_t *m2) +{ + size_t s1len = MIN(MATCH_CHAR_MAX_LEN - 1, line_len(m1)); + size_t s2len = MIN(MATCH_CHAR_MAX_LEN - 1, line_len(m2)); + char *s1 = m1->ptr; + char *s2 = m2->ptr; + int matrix[2][MATCH_CHAR_MAX_LEN] = { 0 }; + int icur = 1; // save space by storing only two rows for i axis + + for (size_t i = 0; i < s1len; i++) + { + icur = (icur == 1 ? 0 : 1); + int *e1 = matrix[icur]; + int *e2 = matrix[!icur]; + + for (size_t j = 0; j < s2len; j++) + { + // skip char in s1 + if (e2[j + 1] > e1[j + 1]) + e1[j + 1] = e2[j + 1]; + // skip char in s2 + if (e1[j] > e1[j + 1]) + e1[j + 1] = e1[j]; + // compare char in s1 and s2 + if ((s1[i] == s2[j]) && (e2[j] + 1) > e1[j + 1]) + e1[j + 1] = e2[j] + 1; + } + } + + return matrix[icur][s2len]; +} + +/// count the matching characters between a variable number of strings "sp" +/// mark the strings that have already been compared to extract them later +/// without re-running the character match counting. +/// @param sp +/// @param fomvals +/// @param n + static int +count_n_matched_chars(mmfile_t **sp, const size_t n, int iwhite) +{ + int matched_chars = 0; + int matched = 0; + + for (size_t i = 0; i < n; i++) + { + for (size_t j = i + 1; j < n; j++) + { + if (sp[i]->ptr != NULL && sp[j]->ptr != NULL) + { + matched++; + // TODO(lewis6991): handle whitespace ignoring higher up in the + // stack + matched_chars += iwhite ? matching_chars_iwhite(sp[i], sp[j]) + : matching_chars(sp[i], sp[j]); + } + } + } + + // prioritize a match of 3 (or more lines) equally to a match of 2 lines + if (matched >= 2) + { + matched_chars *= 2; + matched_chars /= matched; + } + + return matched_chars; +} + + static mmfile_t +fastforward_buf_to_lnum(mmfile_t s, linenr_T lnum) +{ + for (int i = 0; i < lnum - 1; i++) + { + size_t n = (size_t)s.size; + + s.ptr = vim_strnchr(s.ptr, &n, '\n'); + s.size = (int)n; + if (!s.ptr) + break; + s.ptr++; + s.size--; + } + + return s; +} + +/// try all the different ways to compare these lines and use the one that +/// results in the most matching characters +/// @param df_iters +/// @param paths +/// @param npaths +/// @param path_idx +/// @param choice +/// @param diffcmppath +/// @param diff_len +/// @param ndiffs +/// @param diff_blk + static void +try_possible_paths( + const int *df_iters, + const size_t *paths, + const int npaths, + const int path_idx, + int *choice, + diffcmppath_T *diffcmppath, + const int *diff_len, + const size_t ndiffs, + const mmfile_t **diff_blk, + int iwhite) +{ + if (path_idx == npaths) + { + if ((*choice) > 0) + { + int from_vals[LN_MAX_BUFS] = { 0 }; + const int *to_vals = df_iters; + + mmfile_t mm[LN_MAX_BUFS]; // stack memory for current_lines + mmfile_t *current_lines[LN_MAX_BUFS]; + for (size_t k = 0; k < ndiffs; k++) + { + from_vals[k] = df_iters[k]; + // get the index at all of the places + if ((*choice) & (1 << k)) + { + from_vals[k]--; + mm[k] = fastforward_buf_to_lnum(*diff_blk[k], df_iters[k]); + } + else + CLEAR_FIELD(mm[k]); + current_lines[k] = &mm[k]; + } + size_t unwrapped_idx_from = unwrap_indexes(from_vals, diff_len, ndiffs); + size_t unwrapped_idx_to = unwrap_indexes(to_vals, diff_len, ndiffs); + int matched_chars = count_n_matched_chars(current_lines, ndiffs, iwhite); + int score = diffcmppath[unwrapped_idx_from].df_lev_score + matched_chars; + + if (score > diffcmppath[unwrapped_idx_to].df_lev_score) + { + diffcmppath[unwrapped_idx_to].df_path_n = 1; + diffcmppath[unwrapped_idx_to].df_decision[0] = + &diffcmppath[unwrapped_idx_from]; + diffcmppath[unwrapped_idx_to].df_choice[0] = *choice; + diffcmppath[unwrapped_idx_to].df_lev_score = score; + } + else if (score == diffcmppath[unwrapped_idx_to].df_lev_score) + { + size_t k = diffcmppath[unwrapped_idx_to].df_path_n++; + diffcmppath[unwrapped_idx_to].df_decision[k] = + &diffcmppath[unwrapped_idx_from]; + diffcmppath[unwrapped_idx_to].df_choice[k] = *choice; + } + } + return; + } + + size_t bit_place = paths[path_idx]; + *(choice) |= (1 << bit_place); // set it to 1 + try_possible_paths(df_iters, paths, npaths, path_idx + 1, choice, + diffcmppath, diff_len, ndiffs, diff_blk, iwhite); + *(choice) &= ~(1 << bit_place); // set it to 0 + try_possible_paths(df_iters, paths, npaths, path_idx + 1, choice, + diffcmppath, diff_len, ndiffs, diff_blk, iwhite); +} + +/// unwrap indexes to access n dimensional tensor +/// @param values +/// @param diff_len +/// @param ndiffs + static size_t +unwrap_indexes(const int *values, const int *diff_len, const size_t ndiffs) +{ + size_t num_unwrap_scalar = 1; + + for (size_t k = 0; k < ndiffs; k++) + num_unwrap_scalar *= (size_t)diff_len[k] + 1; + + size_t path_idx = 0; + for (size_t k = 0; k < ndiffs; k++) + { + num_unwrap_scalar /= (size_t)diff_len[k] + 1; + + int n = values[k]; + path_idx += num_unwrap_scalar * (size_t)n; + } + + return path_idx; +} + +/// populate the values of the linematch algorithm tensor, and find the best +/// decision for how to compare the relevant lines from each of the buffers at +/// each point in the tensor +/// @param df_iters +/// @param ch_dim +/// @param diffcmppath +/// @param diff_len +/// @param ndiffs +/// @param diff_blk + static void +populate_tensor( + int *df_iters, + const size_t ch_dim, + diffcmppath_T *diffcmppath, + const int *diff_len, + const size_t ndiffs, + const mmfile_t **diff_blk, + int iwhite) +{ + if (ch_dim == ndiffs) + { + int npaths = 0; + size_t paths[LN_MAX_BUFS]; + + for (size_t j = 0; j < ndiffs; j++) + { + if (df_iters[j] > 0) + { + paths[npaths] = j; + npaths++; + } + } + + int choice = 0; + size_t unwrapper_idx_to = unwrap_indexes(df_iters, diff_len, ndiffs); + + diffcmppath[unwrapper_idx_to].df_lev_score = -1; + try_possible_paths(df_iters, paths, npaths, 0, &choice, diffcmppath, + diff_len, ndiffs, diff_blk, iwhite); + return; + } + + for (int i = 0; i <= diff_len[ch_dim]; i++) + { + df_iters[ch_dim] = i; + populate_tensor(df_iters, ch_dim + 1, diffcmppath, diff_len, + ndiffs, diff_blk, iwhite); + } +} + +/// algorithm to find an optimal alignment of lines of a diff block with 2 or +/// more files. The algorithm is generalized to work for any number of files +/// which corresponds to another dimension added to the tensor used in the +/// algorithm +/// +/// for questions and information about the linematch algorithm please contact +/// Jonathon White (jonathonwhite@protonmail.com) +/// +/// for explanation, a summary of the algorithm in 3 dimensions (3 files +/// compared) follows +/// +/// The 3d case (for 3 buffers) of the algorithm implemented when diffopt +/// 'linematch' is enabled. The algorithm constructs a 3d tensor to +/// compare a diff between 3 buffers. The dimensions of the tensor are +/// the length of the diff in each buffer plus 1 A path is constructed by +/// moving from one edge of the cube/3d tensor to the opposite edge. +/// Motions from one cell of the cube to the next represent decisions. In +/// a 3d cube, there are a total of 7 decisions that can be made, +/// represented by the enum df_path3_choice which is defined in +/// buffer_defs.h a comparison of buffer 0 and 1 represents a motion +/// toward the opposite edge of the cube with components along the 0 and +/// 1 axes. a comparison of buffer 0, 1, and 2 represents a motion +/// toward the opposite edge of the cube with components along the 0, 1, +/// and 2 axes. A skip of buffer 0 represents a motion along only the 0 +/// axis. For each action, a point value is awarded, and the path is +/// saved for reference later, if it is found to have been the optimal +/// path. The optimal path has the highest score. The score is +/// calculated as the summation of the total characters matching between +/// all of the lines which were compared. The structure of the algorithm +/// is that of a dynamic programming problem. We can calculate a point +/// i,j,k in the cube as a function of i-1, j-1, and k-1. To find the +/// score and path at point i,j,k, we must determine which path we want +/// to use, this is done by looking at the possibilities and choosing +/// the one which results in the local highest score. The total highest +/// scored path is, then in the end represented by the cell in the +/// opposite corner from the start location. The entire algorithm +/// consists of populating the 3d cube with the optimal paths from which +/// it may have came. +/// +/// Optimizations: +/// As the function to calculate the cell of a tensor at point i,j,k is a +/// function of the cells at i-1, j-1, k-1, the whole tensor doesn't need +/// to be stored in memory at once. In the case of the 3d cube, only two +/// slices (along k and j axis) are stored in memory. For the 2d matrix +/// (for 2 files), only two rows are stored at a time. The next/previous +/// slice (or row) is always calculated from the other, and they alternate +/// at each iteration. +/// In the 3d case, 3 arrays are populated to memorize the score (matched +/// characters) of the 3 buffers, so a redundant calculation of the +/// scores does not occur +/// @param diff_blk +/// @param diff_len +/// @param ndiffs +/// @param [out] [allocated] decisions +/// @return the length of decisions + size_t +linematch_nbuffers( + const mmfile_t **diff_blk, + const int *diff_len, + const size_t ndiffs, + int **decisions, + int iwhite) +{ + assert(ndiffs <= LN_MAX_BUFS); + + size_t memsize = 1; + size_t memsize_decisions = 0; + for (size_t i = 0; i < ndiffs; i++) + { + assert(diff_len[i] >= 0); + memsize *= (size_t)(diff_len[i] + 1); + memsize_decisions += (size_t)diff_len[i]; + } + + // create the flattened path matrix + diffcmppath_T *diffcmppath = lalloc(sizeof(diffcmppath_T) * memsize, TRUE); + // allocate memory here + for (size_t i = 0; i < memsize; i++) + { + diffcmppath[i].df_lev_score = 0; + diffcmppath[i].df_path_n = 0; + for (size_t j = 0; j < (size_t)pow(2, (double)ndiffs); j++) + diffcmppath[i].df_choice_mem[j] = -1; + } + + // memory for avoiding repetitive calculations of score + int df_iters[LN_MAX_BUFS]; + populate_tensor(df_iters, 0, diffcmppath, diff_len, ndiffs, diff_blk, + iwhite); + + const size_t u = unwrap_indexes(diff_len, diff_len, ndiffs); + diffcmppath_T *startNode = &diffcmppath[u]; + + *decisions = lalloc(sizeof(int) * memsize_decisions, TRUE); + size_t n_optimal = 0; + test_charmatch_paths(startNode, 0); + while (startNode->df_path_n > 0) + { + size_t j = startNode->df_optimal_choice; + (*decisions)[n_optimal++] = startNode->df_choice[j]; + startNode = startNode->df_decision[j]; + } + // reverse array + for (size_t i = 0; i < (n_optimal / 2); i++) + { + int tmp = (*decisions)[i]; + (*decisions)[i] = (*decisions)[n_optimal - 1 - i]; + (*decisions)[n_optimal - 1 - i] = tmp; + } + + vim_free(diffcmppath); + + return n_optimal; +} + +// returns the minimum amount of path changes from start to end + static size_t +test_charmatch_paths(diffcmppath_T *node, int lastdecision) +{ + // memoization + if (node->df_choice_mem[lastdecision] == -1) + { + if (node->df_path_n == 0) + // we have reached the end of the tree + node->df_choice_mem[lastdecision] = 0; + else + { + // the minimum amount of turns required to reach the end + size_t minimum_turns = SIZE_MAX; + for (size_t i = 0; i < node->df_path_n; i++) + { + // recurse + size_t t = test_charmatch_paths(node->df_decision[i], + node->df_choice[i]) + + (lastdecision != node->df_choice[i] ? 1 : 0); + if (t < minimum_turns) + { + node->df_optimal_choice = i; + minimum_turns = t; + } + } + node->df_choice_mem[lastdecision] = (int)minimum_turns; + } + } + + return (size_t)node->df_choice_mem[lastdecision]; +} diff --git a/src/proto.h b/src/proto.h index 94e34b0eee..091e09350c 100644 --- a/src/proto.h +++ b/src/proto.h @@ -74,6 +74,7 @@ extern int _stricoll(char *a, char *b); # include "debugger.pro" # include "dict.pro" # include "diff.pro" +# include "linematch.pro" # include "digraph.pro" # include "drawline.pro" # include "drawscreen.pro" diff --git a/src/proto/diff.pro b/src/proto/diff.pro index 9c34dcfa25..5141e370f2 100644 --- a/src/proto/diff.pro +++ b/src/proto/diff.pro @@ -14,6 +14,7 @@ void diff_win_options(win_T *wp, int addbuf); void ex_diffoff(exarg_T *eap); void diff_clear(tabpage_T *tp); int diff_check(win_T *wp, linenr_T lnum); +int diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus); int diff_check_fill(win_T *wp, linenr_T lnum); void diff_set_topline(win_T *fromwin, win_T *towin); int diffopt_changed(void); diff --git a/src/proto/linematch.pro b/src/proto/linematch.pro new file mode 100644 index 0000000000..56d0037797 --- /dev/null +++ b/src/proto/linematch.pro @@ -0,0 +1,3 @@ +/* linematch.c */ +size_t linematch_nbuffers(const mmfile_t **diff_blk, const int *diff_len, const size_t ndiffs, int **decisions, int iwhite); +/* vim: set ft=c : */ diff --git a/src/proto/strings.pro b/src/proto/strings.pro index b792edcc85..c25555f1cd 100644 --- a/src/proto/strings.pro +++ b/src/proto/strings.pro @@ -17,6 +17,7 @@ int vim_stricmp(char *s1, char *s2); int vim_strnicmp(char *s1, char *s2, size_t len); int vim_strnicmp_asc(char *s1, char *s2, size_t len); char_u *vim_strchr(char_u *string, int c); +char *vim_strnchr(const char *p, size_t *n, int c); char_u *vim_strbyte(char_u *string, int c); char_u *vim_strrchr(char_u *string, int c); void sort_strings(char_u **files, int count); diff --git a/src/strings.c b/src/strings.c index cd75bc371d..54ac17873f 100644 --- a/src/strings.c +++ b/src/strings.c @@ -674,6 +674,22 @@ vim_strchr(char_u *string, int c) return NULL; } +// Sized version of strchr that can handle embedded NULs. +// Adjusts n to the new size. + char * +vim_strnchr(const char *p, size_t *n, int c) +{ + while (*n > 0) + { + if (*p == c) + return (char *)p; + p++; + (*n)--; + } + + return NULL; +} + /* * Version of strchr() that only works for bytes and handles unsigned char * strings with characters above 128 correctly. It also doesn't return a diff --git a/src/structs.h b/src/structs.h index 87aca30742..69494dd9b0 100644 --- a/src/structs.h +++ b/src/structs.h @@ -3553,6 +3553,8 @@ struct diffblock_S diff_T *df_next; linenr_T df_lnum[DB_COUNT]; // line number in buffer linenr_T df_count[DB_COUNT]; // nr of inserted/changed lines + int is_linematched; // has the linematch algorithm ran on this diff hunk to divide it into + // smaller diff hunks? }; #endif diff --git a/src/testdir/dumps/Test_diff_23.dump b/src/testdir/dumps/Test_diff_23.dump new file mode 100644 index 0000000000..25e1750b14 --- /dev/null +++ b/src/testdir/dumps/Test_diff_23.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|a| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|b+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|b+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|c| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_24.dump b/src/testdir/dumps/Test_diff_24.dump new file mode 100644 index 0000000000..71004bdce0 --- /dev/null +++ b/src/testdir/dumps/Test_diff_24.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|0|-|1| @9|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|0|-|1| @9|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_1.dump b/src/testdir/dumps/Test_diff_get_put_linematch_1.dump new file mode 100644 index 0000000000..056c4be759 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1> +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|0|-|1| @9|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|0|-|1| @9|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |1|7|L|,| |1|2|0|B| @54 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_10.dump b/src/testdir/dumps/Test_diff_get_put_linematch_10.dump new file mode 100644 index 0000000000..f163146928 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_10.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31 +| +0#0000e05#a8a8a8255@1>s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|1|3|,|1| @10|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|7|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|g|e|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_11.dump b/src/testdir/dumps/Test_diff_get_put_linematch_11.dump new file mode 100644 index 0000000000..7e78bafa4f --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_11.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1>A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|5|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| |[|+|]| @6|5|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_12.dump b/src/testdir/dumps/Test_diff_get_put_linematch_12.dump new file mode 100644 index 0000000000..8e9e0c6684 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_12.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1>A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|6|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| |[|+|]| @6|9|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_13.dump b/src/testdir/dumps/Test_diff_get_put_linematch_13.dump new file mode 100644 index 0000000000..1601c5d53d --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_13.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1>A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|7|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| |[|+|]| @6|1|0|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_14.dump b/src/testdir/dumps/Test_diff_get_put_linematch_14.dump new file mode 100644 index 0000000000..9c7d17bf76 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_14.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1>c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1@1|,|1| @10|A|l@1| |X+1&&|d|i|f|i|l|e|2| |[|+|]| @6|1|4|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_15.dump b/src/testdir/dumps/Test_diff_get_put_linematch_15.dump new file mode 100644 index 0000000000..d9b72ade33 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_15.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1>s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|2|,|1| @10|A|l@1| |X+1&&|d|i|f|i|l|e|2| |[|+|]| @6|1|6|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_16.dump b/src/testdir/dumps/Test_diff_get_put_linematch_16.dump new file mode 100644 index 0000000000..d4649d2052 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_16.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1>x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|9|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|6|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_17.dump b/src/testdir/dumps/Test_diff_get_put_linematch_17.dump new file mode 100644 index 0000000000..69737fa58c --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_17.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1>x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|9|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|8|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_18.dump b/src/testdir/dumps/Test_diff_get_put_linematch_18.dump new file mode 100644 index 0000000000..49ab243871 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_18.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1>D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|6|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|9|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_19.dump b/src/testdir/dumps/Test_diff_get_put_linematch_19.dump new file mode 100644 index 0000000000..cbea3e5602 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_19.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1>s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|1|3|,|1| @10|A|l@1| |X+3&&|d|i|f|i|l|e|2| @10|1|7|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|p|u|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_2.dump b/src/testdir/dumps/Test_diff_get_put_linematch_2.dump new file mode 100644 index 0000000000..df249ab17c --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_2.dump @@ -0,0 +1,20 @@ +|++0#0000e05#a8a8a8255| >+|-@1| @1|7| |l|i|n|e|s|:| |c|o|m@1|o|n| |l|i|n|e|-@9||+1#0000000#ffffff0|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |c|o|m@1|o|n| |l|i|n|e|-@9 +| @1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|1|,|0|-|1| @9|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|0|-|1| @9|A|l@1 +|:+0&&|5|,|9|d|i|f@1|g|e|t| @63 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_3.dump b/src/testdir/dumps/Test_diff_get_put_linematch_3.dump new file mode 100644 index 0000000000..cb62a9ef71 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_3.dump @@ -0,0 +1,20 @@ +|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@34||+1&&|-+0#0000e05#a8a8a8255| | +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1>A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| @10|5|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| |[|+|]| @6|5|,|1| @11|A|l@1 +|:+0&&|5|,|1|0|d|i|f@1|g|e|t| @62 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_4.dump b/src/testdir/dumps/Test_diff_get_put_linematch_4.dump new file mode 100644 index 0000000000..6cd85c9b63 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_4.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1>A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|A+0#0000000#ffffff0|B|C|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+1#0000000&|d|i|f|i|l|e|1| @10|5|,|1| @11|A|l@1| |X+3&&|d|i|f|i|l|e|2| |[|+|]| @6|5|,|1| @11|A|l@1 +|:+0&&|4|,|1|7|d|i|f@1|g|e|t| @62 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_5.dump b/src/testdir/dumps/Test_diff_get_put_linematch_5.dump new file mode 100644 index 0000000000..d203885bd9 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_5.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1>D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31||+1&&| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0|y|z| @31 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|5|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|5|,|1| @11|A|l@1 +|:+0&&|4|,|1|2|d|i|f@1|g|e|t| @62 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_6.dump b/src/testdir/dumps/Test_diff_get_put_linematch_6.dump new file mode 100644 index 0000000000..b2ca4d1c2a --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_6.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1>D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|5|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|5|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|g|e|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_7.dump b/src/testdir/dumps/Test_diff_get_put_linematch_7.dump new file mode 100644 index 0000000000..fa8529988d --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_7.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1>D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|6|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|9|,|1| @11|A|l@1 +|:+0&&|d|i|f@1|g|e|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_8.dump b/src/testdir/dumps/Test_diff_get_put_linematch_8.dump new file mode 100644 index 0000000000..d99744ece6 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_8.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1>D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F|a|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|7|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|0|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|g|e|t| @66 diff --git a/src/testdir/dumps/Test_diff_get_put_linematch_9.dump b/src/testdir/dumps/Test_diff_get_put_linematch_9.dump new file mode 100644 index 0000000000..3c1674f339 --- /dev/null +++ b/src/testdir/dumps/Test_diff_get_put_linematch_9.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|A+2#0000000#ff404010|B|C|a+0&#ffd7ff255|b|c| @28||+1&#ffffff0| +0#0000e05#a8a8a8255@1|D+2#0000000#ff404010|E|F|a+0&#ffd7ff255|b|c| @28 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31||+1&&| +0#0000e05#a8a8a8255@1|D+0#0000000#ffffff0|E|F| @31 +| +0#0000e05#a8a8a8255@1>c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| |[|+|]| @6|1|2|,|1| @10|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|5|,|1| @10|A|l@1 +|:+0&&|d|i|f@1|g|e|t| @66 diff --git a/src/testdir/dumps/Test_linematch_3diffs1.dump b/src/testdir/dumps/Test_linematch_3diffs1.dump new file mode 100644 index 0000000000..e54fe26670 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_3diffs1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@22||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@21||+1&&| +0#0000e05#a8a8a8255@1> +0#0000000#ffffff0@21 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@1|c|o|m@1|o|n| |l|i|n|e| @9||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@1|c|o|m@1|o|n| |l|i|n|e| @8||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@1|c|o|m@1|o|n| |l|i|n|e| @8 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|<@6| |H|E|A|D| @7||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @13||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @13||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @13||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|A@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|=@6| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@5|B@2| @12 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|>@6| |b|r|a|n|c|h|1| @4||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +|~+0&#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|X+1#0000000&|d|i|f|i|l|e|1| @4|1|,|0|-|1| @3|A|l@1| |X|d|i|f|i|l|e|2| @3|1|,|0|-|1| @3|A|l@1| |X+3&&|d|i|f|i|l|e|3| @3|1|,|0|-|1| @3|A|l@1 +|"+0&&|X|d|i|f|i|l|e|3|"| |5|L|,| |4|5|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff1.dump b/src/testdir/dumps/Test_linematch_diff1.dump new file mode 100644 index 0000000000..26b729c769 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|!+0#0000000#5fd7ff255| @33 +| +0#0000e05#a8a8a8255@1>/+2#0000000#ff404010@1| |a|b|c| |d|?| +0&#ffd7ff255@25||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|b|c| |d|!| +0&#ffd7ff255@28 +| +0#0000e05#a8a8a8255@1|/+2#0000000#ff404010@1| |d|?| +0&#ffd7ff255@29||+1&#ffffff0| +0#0000e05#a8a8a8255@1|d+2#0000000#ff404010|!| +0&#ffd7ff255@32 +| +0#0000e05#a8a8a8255@1|/+0#0000000#5fd7ff255@1| |d|?| @29||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |3|L|,| |1|2|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff_grouping1.dump b/src/testdir/dumps/Test_linematch_diff_grouping1.dump new file mode 100644 index 0000000000..19c907390e --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_grouping1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|Z| @32 +| +0#0000e05#a8a8a8255@1>!+2#0000000#ff404010|A+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|A+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|B+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|B+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|C+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|C+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|A| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|B| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|B| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |8|L|,| |2|4|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff_grouping2.dump b/src/testdir/dumps/Test_linematch_diff_grouping2.dump new file mode 100644 index 0000000000..35cf575c4e --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_grouping2.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|A| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|Z| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|B| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +| +0#0000e05#a8a8a8255@1>!+2#0000000#ff404010|A+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|A+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|B+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|B+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|C+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|C+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |8|L|,| |2|4|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff_grouping_scroll0.dump b/src/testdir/dumps/Test_linematch_diff_grouping_scroll0.dump new file mode 100644 index 0000000000..35cf575c4e --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_grouping_scroll0.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|A| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|Z| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|B| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +| +0#0000e05#a8a8a8255@1>!+2#0000000#ff404010|A+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|A+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|B+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|B+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|C+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|C+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |8|L|,| |2|4|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff_grouping_scroll1.dump b/src/testdir/dumps/Test_linematch_diff_grouping_scroll1.dump new file mode 100644 index 0000000000..673b9094c8 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_grouping_scroll1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +| +0#0000e05#a8a8a8255@1>!+2#0000000#ff404010|A+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|A+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|B+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|B+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|!+2#0000000#ff404010|C+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|C+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|8|,|1| @11|B|o|t +| +0&&@74 diff --git a/src/testdir/dumps/Test_linematch_diff_grouping_scroll2.dump b/src/testdir/dumps/Test_linematch_diff_grouping_scroll2.dump new file mode 100644 index 0000000000..0d91732f6b --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_grouping_scroll2.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>!+2#0000000#ff404010|C+0&#ffd7ff255| @32||+1&#ffffff0| +0#0000e05#a8a8a8255@1|?+2#0000000#ff404010|C+0&#ffd7ff255| @32 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|?+0#0000000#5fd7ff255|C| @32 +|~+0#4040ff13#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|3|,|1| @11|B|o|t| |X+1&&|d|i|f|i|l|e|2| @10|7|,|1| @11|B|o|t +| +0&&@74 diff --git a/src/testdir/dumps/Test_linematch_diff_iwhite1.dump b/src/testdir/dumps/Test_linematch_diff_iwhite1.dump new file mode 100644 index 0000000000..50803a3175 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_iwhite1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>v+0#0000000#ffffff0|o|i|d| |t|e|s|t|F|u|n|c|t|i|o|n| |(|)| |{| @12||+1&&| +0#0000e05#a8a8a8255@1|v+0#0000000#ffffff0|o|i|d| |t|e|s|t|F|u|n|c|t|i|o|n| |(|)| |{| @12 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|f|o|r| |(|i|n|t| |i| |=| |0|;| |i| |<| |1|0|;| |i|+@1|)| |{| @2||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1| +2&#ff404010@1|f|o|r| |(|i|n|t| |j| |=| |0|;| |j| |<| |1|0|;| |j|++0&#ffd7ff255@1|)| |{| ||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1|/+2&#ff404010@1| |f|o|r| |(|i|n|t| |j| |=| |0|;| |j| |<| |1|0|;| |i|++0&#ffd7ff255@1|)| |{ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1| +2&#ff404010| +0&#ffd7ff255|}| @29||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1|/+2&#ff404010@1| +0&#ffd7ff255|}| @28 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|}| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |4|L|,| |6|8|B| @56 diff --git a/src/testdir/dumps/Test_linematch_diff_iwhite2.dump b/src/testdir/dumps/Test_linematch_diff_iwhite2.dump new file mode 100644 index 0000000000..11a489a57d --- /dev/null +++ b/src/testdir/dumps/Test_linematch_diff_iwhite2.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>v+0#0000000#ffffff0|o|i|d| |t|e|s|t|F|u|n|c|t|i|o|n| |(|)| |{| @12||+1&&| +0#0000e05#a8a8a8255@1|v+0#0000000#ffffff0|o|i|d| |t|e|s|t|F|u|n|c|t|i|o|n| |(|)| |{| @12 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|f|o|r| |(|i|n|t| |i| |=| |0|;| |i| |<| |1|0|;| |i|+@1|)| |{| @2||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@3|f+2&#ff404010|o|r| |(|i|n|t| |j| |=| |0|;| |j| |<| |1|0|;| |j|++0&#ffd7ff255@1|)| |{| ||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1|/+2&#ff404010@1| |f|o|r| |(|i|n|t| |j| |=| |0|;| |j| |<| |1|0|;| |i|++0&#ffd7ff255@1|)| |{ +| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@3|}| @29||+1&#ffffff0| +0#0000e05#a8a8a8255@1| +0#0000000#ffd7ff255@1|/+2&#ff404010@1| |}+0&#ffd7ff255| @28 +| +0#0000e05#a8a8a8255@1| +0#0000000#5fd7ff255@1|}| @31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34 +| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33||+1&&| +0#0000e05#a8a8a8255@1|}+0#0000000#ffffff0| @33 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|X+3#0000000&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|i|w|h|i|t|e|a|l@1| @51 diff --git a/src/testdir/dumps/Test_linematch_line_limit_exceeded1.dump b/src/testdir/dumps/Test_linematch_line_limit_exceeded1.dump new file mode 100644 index 0000000000..71b0848765 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_line_limit_exceeded1.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|H+2#0000000#ff404010|I|L| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|G+2#0000000#ff404010|H|I| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+0#0000000#5fd7ff255|o|m|e|t|h|i|n|g| @25 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|A+2&#ff404010|B|C|a+0&#ffd7ff255|b|c| @27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|D+2&#ff404010|E|F|a+0&#ffd7ff255|b|c| @27 +| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|A|B|C|a|b|c| +0&#ffd7ff255@27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010|y|z| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|A|B|C|a|b|c| +0&#ffd7ff255@27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010|y|z| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010|A|B|C|a|b|c| +0&#ffd7ff255@27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010|y|z| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|D|E|F|a|b|c| @27 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|D|E|F|a|b|c| @27 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|D|E|F|a|b|c| @27 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|H+2#0000000#ff404010|I|L| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|G+2#0000000#ff404010|H|I| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+0#0000000#5fd7ff255|o|m|e|t|h|i|n|g| |e|l|s|e| @20 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|X+3&&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|"+0&&|X|d|i|f|i|l|e|2|"| |1|8|L|,| |1|3|2|B| @54 diff --git a/src/testdir/dumps/Test_linematch_line_limit_exceeded2.dump b/src/testdir/dumps/Test_linematch_line_limit_exceeded2.dump new file mode 100644 index 0000000000..b88b407732 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_line_limit_exceeded2.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1>c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|H+2#0000000#ff404010|I|L| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|G+2#0000000#ff404010|H|I| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+0#0000000#5fd7ff255|o|m|e|t|h|i|n|g| @25 +| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34||+1&&| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@34 +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|A+2&#ff404010|B|C|a+0&#ffd7ff255|b|c| @27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|D+2&#ff404010|E|F|a+0&#ffd7ff255|b|c| @27 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255|y|z| @31 +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|A+2&#ff404010|B|C|a+0&#ffd7ff255|b|c| @27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|D+2&#ff404010|E|F|a+0&#ffd7ff255|b|c| @27 +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|A+2&#ff404010|B|C|a+0&#ffd7ff255|b|c| @27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|D+2&#ff404010|E|F|a+0&#ffd7ff255|b|c| @27 +| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|A+2&#ff404010|B|C|a+0&#ffd7ff255|b|c| @27||+1&#ffffff0| +0#0000e05#a8a8a8255@1|a+0#0000000#ffd7ff255|D+2&#ff404010|E|F|a+0&#ffd7ff255|b|c| @27 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|D+0#0000000#5fd7ff255|E|F| @31 +| +0#0000e05#a8a8a8255@1|H+2#0000000#ff404010|I|L| +0&#ffd7ff255@31||+1&#ffffff0| +0#0000e05#a8a8a8255@1|G+2#0000000#ff404010|H|I| +0&#ffd7ff255@31 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+0#0000000#5fd7ff255|o|m|e|t|h|i|n|g| |e|l|s|e| @20 +| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23||+1&&| +0#0000e05#a8a8a8255@1|c+0#0000000#ffffff0|o|m@1|o|n| |l|i|n|e| @23 +| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25||+1&&| +0#0000e05#a8a8a8255@1|s+0#0000000#ffffff0|o|m|e|t|h|i|n|g| @25 +|X+3&&|d|i|f|i|l|e|1| @10|1|,|1| @11|A|l@1| |X+1&&|d|i|f|i|l|e|2| @10|1|,|1| @11|A|l@1 +|:+0&&|s|e|t| |d|i|f@1|o|p|t|+|=|l|i|n|e|m|a|t|c|h|:|3|0| @48 diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index bed795e1cc..1c7233e35a 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -1035,6 +1035,41 @@ func Test_diff_screen() call WriteDiffFiles(buf, [], [0]) call VerifyBoth(buf, "Test_diff_22", "") + call WriteDiffFiles(buf, ['?a', '?b', '?c'], ['!b']) + call VerifyInternal(buf, 'Test_diff_23', " diffopt+=linematch:30") + + call WriteDiffFiles(buf, ['', + \ 'common line', + \ 'common line', + \ '', + \ 'DEFabc', + \ 'xyz', + \ 'xyz', + \ 'xyz', + \ 'DEFabc', + \ 'DEFabc', + \ 'DEFabc', + \ 'common line', + \ 'common line', + \ 'DEF', + \ 'common line', + \ 'DEF', + \ 'something' ], + \ ['', + \ 'common line', + \ 'common line', + \ '', + \ 'ABCabc', + \ 'ABCabc', + \ 'ABCabc', + \ 'ABCabc', + \ 'common line', + \ 'common line', + \ 'common line', + \ 'something']) + call VerifyInternal(buf, 'Test_diff_24', " diffopt+=linematch:30") + + " clean up call StopVimInTerminal(buf) call delete('Xdifile1') @@ -2285,4 +2320,411 @@ func Test_diff_topline_noscroll() call StopVimInTerminal(buf) endfunc +func Test_diffget_diffput_linematch() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + " enable linematch + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles(buf, ['', + \ 'common line', + \ 'common line', + \ '', + \ 'ABCabc', + \ 'ABCabc', + \ 'ABCabc', + \ 'ABCabc', + \ 'common line', + \ 'common line', + \ 'common line', + \ 'something' ], + \ ['', + \ 'common line', + \ 'common line', + \ '', + \ 'DEFabc', + \ 'xyz', + \ 'xyz', + \ 'xyz', + \ 'DEFabc', + \ 'DEFabc', + \ 'DEFabc', + \ 'common line', + \ 'common line', + \ 'DEF', + \ 'common line', + \ 'DEF', + \ 'something']) + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_1', {}) + + " get from window 1 from line 5 to 9 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, ":5,9diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_2', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 2 from line 5 to 10 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, ":5,10diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_3', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get all from window 2 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, ":4,17diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_4', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get all from window 1 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, ":4,12diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_5', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 1 using do 1 line 5 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "5gg") + call term_sendkeys(buf, ":diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_6', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 1 using do 2 line 6 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "6gg") + call term_sendkeys(buf, ":diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_7', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 1 using do 2 line 7 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "7gg") + call term_sendkeys(buf, ":diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_8', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 1 using do 2 line 11 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "11gg") + call term_sendkeys(buf, ":diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_9', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " get from window 1 using do 2 line 12 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "12gg") + call term_sendkeys(buf, ":diffget\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_10', {}) + + " undo the last diffget + call term_sendkeys(buf, "u") + + " put from window 1 using dp 1 line 5 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "5gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_11', {}) + + " undo the last diffput + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "u") + + " put from window 1 using dp 2 line 6 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "6gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_12', {}) + + " undo the last diffput + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "u") + + " put from window 1 using dp 2 line 7 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "7gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_13', {}) + + " undo the last diffput + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "u") + + " put from window 1 using dp 2 line 11 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "11gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_14', {}) + + " undo the last diffput + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "u") + + " put from window 1 using dp 2 line 12 + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "12gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_15', {}) + + " undo the last diffput + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "u") + + " put from window 2 using dp line 6 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "6gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_16', {}) + + " undo the last diffput + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "u") + + " put from window 2 using dp line 8 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "8gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_17', {}) + + " undo the last diffput + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "u") + + " put from window 2 using dp line 9 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "9gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_18', {}) + + " undo the last diffput + call term_sendkeys(buf, "1\w") + call term_sendkeys(buf, "u") + + " put from window 2 using dp line 17 + call term_sendkeys(buf, "2\w") + call term_sendkeys(buf, "17gg") + call term_sendkeys(buf, ":diffput\") + call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_19', {}) + +endfunc + +func Test_linematch_diff() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + " enable linematch + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles(buf, ['// abc d?', + \ '// d?', + \ '// d?' ], + \ ['!', + \ 'abc d!', + \ 'd!']) + call VerifyScreenDump(buf, 'Test_linematch_diff1', {}) + +endfunc + +func Test_linematch_diff_iwhite() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + " setup a diff with 2 files and set linematch:30, with ignore white + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles(buf, ['void testFunction () {', + \ ' for (int i = 0; i < 10; i++) {', + \ ' for (int j = 0; j < 10; j++) {', + \ ' }', + \ ' }', + \ '}' ], + \ ['void testFunction () {', + \ ' // for (int j = 0; j < 10; i++) {', + \ ' // }', + \ '}']) + call VerifyScreenDump(buf, 'Test_linematch_diff_iwhite1', {}) + call term_sendkeys(buf, ":set diffopt+=iwhiteall\") + call VerifyScreenDump(buf, 'Test_linematch_diff_iwhite2', {}) + +endfunc + +func Test_linematch_diff_grouping() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + " a diff that would result in multiple groups before grouping optimization + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles(buf, ['!A', + \ '!B', + \ '!C' ], + \ ['?Z', + \ '?A', + \ '?B', + \ '?C', + \ '?A', + \ '?B', + \ '?B', + \ '?C']) + call VerifyScreenDump(buf, 'Test_linematch_diff_grouping1', {}) + call WriteDiffFiles(buf, ['!A', + \ '!B', + \ '!C' ], + \ ['?A', + \ '?Z', + \ '?B', + \ '?C', + \ '?A', + \ '?B', + \ '?C', + \ '?C']) + call VerifyScreenDump(buf, 'Test_linematch_diff_grouping2', {}) + +endfunc + +func Test_linematch_diff_scroll() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + " a diff that would result in multiple groups before grouping optimization + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles(buf, ['!A', + \ '!B', + \ '!C' ], + \ ['?A', + \ '?Z', + \ '?B', + \ '?C', + \ '?A', + \ '?B', + \ '?C', + \ '?C']) + " scroll down to show calculation of top fill and scroll to correct line in + " both windows + call VerifyScreenDump(buf, 'Test_linematch_diff_grouping_scroll0', {}) + call term_sendkeys(buf, "3\") + call VerifyScreenDump(buf, 'Test_linematch_diff_grouping_scroll1', {}) + call term_sendkeys(buf, "3\") + call VerifyScreenDump(buf, 'Test_linematch_diff_grouping_scroll2', {}) + +endfunc + + + +func Test_linematch_line_limit_exceeded() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call WriteDiffFiles(0, [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2', {}) + call term_sendkeys(buf, ":set autoread\\w:set autoread\\w") + + call term_sendkeys(buf, ":set diffopt+=linematch:10\") + " a diff block will not be aligned with linematch because it's contents + " exceed 10 lines + call WriteDiffFiles(buf, + \ ['common line', + \ 'HIL', + \ '', + \ 'aABCabc', + \ 'aABCabc', + \ 'aABCabc', + \ 'aABCabc', + \ 'common line', + \ 'HIL', + \ 'common line', + \ 'something'], + \ ['common line', + \ 'DEF', + \ 'GHI', + \ 'something', + \ '', + \ 'aDEFabc', + \ 'xyz', + \ 'xyz', + \ 'xyz', + \ 'aDEFabc', + \ 'aDEFabc', + \ 'aDEFabc', + \ 'common line', + \ 'DEF', + \ 'GHI', + \ 'something else', + \ 'common line', + \ 'something']) + call VerifyScreenDump(buf, 'Test_linematch_line_limit_exceeded1', {}) + " after increasing the count to 30, the limit is not exceeded, and the + " alignment algorithm will run on the largest diff block here + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call VerifyScreenDump(buf, 'Test_linematch_line_limit_exceeded2', {}) + +endfunc + +func Test_linematch_3diffs() + CheckScreendump + call delete('.Xdifile1.swp') + call delete('.Xdifile2.swp') + call delete('.Xdifile3.swp') + call WriteDiffFiles3(0, [], [], []) + let buf = RunVimInTerminal('-d Xdifile1 Xdifile2 Xdifile3', {}) + call term_sendkeys(buf, "1\w:set autoread\") + call term_sendkeys(buf, "2\w:set autoread\") + call term_sendkeys(buf, "3\w:set autoread\") + call term_sendkeys(buf, ":set diffopt+=linematch:30\") + call WriteDiffFiles3(buf, + \ ["", + \ " common line", + \ " AAA", + \ " AAA", + \ " AAA"], + \ ["", + \ " common line", + \ " <<<<<<< HEAD", + \ " AAA", + \ " AAA", + \ " AAA", + \ " =======", + \ " BBB", + \ " BBB", + \ " BBB", + \ " >>>>>>> branch1"], + \ ["", + \ " common line", + \ " BBB", + \ " BBB", + \ " BBB"]) + call VerifyScreenDump(buf, 'Test_linematch_3diffs1', {}) + +endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 858034e6ea..19c08b9f79 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1009, /**/ 1008, /**/ diff --git a/src/vim.h b/src/vim.h index 25c9d120d8..1cf7648215 100644 --- a/src/vim.h +++ b/src/vim.h @@ -1992,6 +1992,7 @@ typedef int sock_T; // Note that gui.h is included by structs.h #include "structs.h" // defines many structures +#include "xdiff/xdiff.h" // TODO: maybe remove this, but this brings in mmfile_t so it can compile #include "alloc.h" From c200f53cbb03fa11e489a27791d5b9dfc34a6564 Mon Sep 17 00:00:00 2001 From: Konfekt Date: Sun, 12 Jan 2025 20:02:04 +0100 Subject: [PATCH 15/93] patch 9.1.1010: filetype: VisualCode setting file not recognized Problem: filetype: VisualCode setting file not recognized Solution: detect json files in VSCode config directory as jsonc filetype (Konfekt) closes: #16400 Signed-off-by: Konfekt Signed-off-by: Christian Brabandt --- runtime/filetype.vim | 2 ++ src/testdir/test_filetype.vim | 2 +- src/version.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 29f702f27d..c4d32398f0 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1274,6 +1274,8 @@ au BufNewFile,BufRead .prettierrc,.firebaserc,.stylelintrc,.lintstagedrc,flake.l " JSONC (JSON with comments) au BufNewFile,BufRead *.jsonc,.babelrc,.eslintrc,.jsfmtrc,bun.lock setf jsonc au BufNewFile,BufRead .jshintrc,.jscsrc,.vsconfig,.hintrc,.swrc,[jt]sconfig*.json setf jsonc +" Visual Studio Code settings +au BufRead,BufNewFile ~/*/{Code,VSCodium}/User/*.json setf jsonc " JSON au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 3b3b2f9200..3a6306f6f6 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -399,7 +399,7 @@ def s:GetFilenameChecks(): dict> '.prettierrc', '.firebaserc', '.stylelintrc', '.lintstagedrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', 'file.bd', 'file.bda', 'file.xci', 'flake.lock', 'pack.mcmeta', 'deno.lock'], json5: ['file.json5'], - jsonc: ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc', 'bun.lock'], + jsonc: ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc', 'bun.lock', expand("$HOME/.config/VSCodium/User/settings.json")], jsonl: ['file.jsonl'], jsonnet: ['file.jsonnet', 'file.libsonnet'], jsp: ['file.jsp'], diff --git a/src/version.c b/src/version.c index 19c08b9f79..b7a22dd497 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1010, /**/ 1009, /**/ From 3a0cc36c69744a7727ce34311d39d2d9d8ddc6f9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 13 Jan 2025 07:27:43 +0100 Subject: [PATCH 16/93] patch 9.1.1011: popupmenu internal error with some abbr in completion item Problem: Popup menu internal error with some abbr in completion item. Solution: Don't compute attributes when there is no corresponding text. Reduce indent in pum_redraw() while at it (zeertzjq). fixes: #16427 closes: #16435 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- src/popupmenu.c | 190 +++++++++--------- src/testdir/dumps/Test_pum_highlights_19.dump | 20 ++ src/testdir/test_popup.vim | 33 +++ src/version.c | 2 + 4 files changed, 149 insertions(+), 96 deletions(-) create mode 100644 src/testdir/dumps/Test_pum_highlights_19.dump diff --git a/src/popupmenu.c b/src/popupmenu.c index 14cc69a86e..d9ab997bf4 100644 --- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -414,7 +414,7 @@ pum_compute_text_attrs(char_u *text, hlf_T hlf, int user_hlattr) int_u char_pos = 0; int is_select = FALSE; - if ((hlf != HLF_PSI && hlf != HLF_PNI) + if (*text == NUL || (hlf != HLF_PSI && hlf != HLF_PNI) || (highlight_attr[HLF_PMSI] == highlight_attr[HLF_PSI] && highlight_attr[HLF_PMNI] == highlight_attr[HLF_PNI])) return NULL; @@ -662,131 +662,129 @@ pum_redraw(void) if (s == NULL) s = p; w = ptr2cells(p); - if (*p == NUL || *p == TAB || totwidth + w > pum_width) + if (*p != NUL && *p != TAB && totwidth + w <= pum_width) { - // Display the text that fits or comes before a Tab. - // First convert it to printable characters. - char_u *st; - int *attrs = NULL; - int saved = *p; - - if (saved != NUL) - *p = NUL; - st = transstr(s); - if (saved != NUL) - *p = saved; - - if (item_type == CPT_ABBR) - attrs = pum_compute_text_attrs(st, hlf, - pum_array[idx].pum_user_abbr_hlattr); + width += w; + continue; + } + + // Display the text that fits or comes before a Tab. + // First convert it to printable characters. + char_u *st; + int *attrs = NULL; + int saved = *p; + + if (saved != NUL) + *p = NUL; + st = transstr(s); + if (saved != NUL) + *p = saved; + + if (item_type == CPT_ABBR) + attrs = pum_compute_text_attrs(st, hlf, + pum_array[idx].pum_user_abbr_hlattr); #ifdef FEAT_RIGHTLEFT - if (pum_rl) + if (pum_rl) + { + if (st != NULL) { - if (st != NULL) + char_u *rt = reverse_text(st); + + if (rt != NULL) { - char_u *rt = reverse_text(st); + char_u *rt_start = rt; + int cells; - if (rt != NULL) + cells = vim_strsize(rt); + if (cells > pum_width) { - char_u *rt_start = rt; - int cells; - - cells = vim_strsize(rt); - if (cells > pum_width) + do { - do - { - cells -= has_mbyte + cells -= has_mbyte ? (*mb_ptr2cells)(rt) : 1; - MB_PTR_ADV(rt); - } while (cells > pum_width); - - if (cells < pum_width) - { - // Most left character requires - // 2-cells but only 1 cell is - // available on screen. Put a - // '<' on the left of the pum - // item - *(--rt) = '<'; - cells++; - } + MB_PTR_ADV(rt); + } while (cells > pum_width); + + if (cells < pum_width) + { + // Most left character requires 2-cells + // but only 1 cell is available on + // screen. Put a '<' on the left of + // the pum item. + *(--rt) = '<'; + cells++; } + } - if (attrs == NULL) - screen_puts_len(rt, (int)STRLEN(rt), - row, col - cells + 1, attr); - else - pum_screen_puts_with_attrs(row, + if (attrs == NULL) + screen_puts_len(rt, (int)STRLEN(rt), row, + col - cells + 1, attr); + else + pum_screen_puts_with_attrs(row, col - cells + 1, cells, rt, - (int)STRLEN(rt), attrs); + (int)STRLEN(rt), attrs); - vim_free(rt_start); - } - vim_free(st); + vim_free(rt_start); } - col -= width; + vim_free(st); } - else + col -= width; + } + else #endif + { + if (st != NULL) { - if (st != NULL) - { - int size = (int)STRLEN(st); - int cells = (*mb_string2cells)(st, size); + int size = (int)STRLEN(st); + int cells = (*mb_string2cells)(st, size); - // only draw the text that fits - while (size > 0 + // only draw the text that fits + while (size > 0 && col + cells > pum_width + pum_col) + { + --size; + if (has_mbyte) { - --size; - if (has_mbyte) - { - size -= (*mb_head_off)(st, st + size); - cells -= (*mb_ptr2cells)(st + size); - } - else - --cells; + size -= (*mb_head_off)(st, st + size); + cells -= (*mb_ptr2cells)(st + size); } - - if (attrs == NULL) - screen_puts_len(st, size, row, col, attr); else - pum_screen_puts_with_attrs(row, col, cells, + --cells; + } + + if (attrs == NULL) + screen_puts_len(st, size, row, col, attr); + else + pum_screen_puts_with_attrs(row, col, cells, st, size, attrs); - vim_free(st); - } - col += width; + vim_free(st); } + col += width; + } - if (attrs != NULL) - VIM_CLEAR(attrs); + if (attrs != NULL) + VIM_CLEAR(attrs); - if (*p != TAB) - break; + if (*p != TAB) + break; - // Display two spaces for a Tab. + // Display two spaces for a Tab. #ifdef FEAT_RIGHTLEFT - if (pum_rl) - { - screen_puts_len((char_u *)" ", 2, row, col - 1, - attr); - col -= 2; - } - else -#endif - { - screen_puts_len((char_u *)" ", 2, row, col, - attr); - col += 2; - } - totwidth += 2; - s = NULL; // start text at next char - width = 0; + if (pum_rl) + { + screen_puts_len((char_u *)" ", 2, row, col - 1, attr); + col -= 2; } else - width += w; +#endif + { + screen_puts_len((char_u *)" ", 2, row, col, attr); + col += 2; + } + totwidth += 2; + s = NULL; // start text at next char + width = 0; } if (j > 0) diff --git a/src/testdir/dumps/Test_pum_highlights_19.dump b/src/testdir/dumps/Test_pum_highlights_19.dump new file mode 100644 index 0000000000..4cb3534476 --- /dev/null +++ b/src/testdir/dumps/Test_pum_highlights_19.dump @@ -0,0 +1,20 @@ +|f+0&#ffffff0|o@1> @71 +|f+0#00e0e07#e0e0e08|o@1|b+0#0000001&|a|r| @3|!| @3| +0#4040ff13#ffffff0@59 +|f+0#0000e05#ffd7ff255|o@1|b+0#0000001&|a|z| @3|!| @3| +0#4040ff13#ffffff0@59 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |O|m|n|i| |c|o|m|p|l|e|t|i|o|n| |(|^|O|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |2| +0#0000000&@34 diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index d4d1c2fed7..fb5d07b39f 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -1528,6 +1528,39 @@ func Test_pum_highlights_match() call StopVimInTerminal(buf) endfunc +func Test_pum_highlights_match_with_abbr() + CheckScreendump + let lines =<< trim END + func Omni_test(findstart, base) + if a:findstart + return col(".") + endif + return { + \ 'words': [ + \ { 'word': 'foobar', 'abbr': "foobar\t\t!" }, + \ { 'word': 'foobaz', 'abbr': "foobaz\t\t!" }, + \]} + endfunc + + set omnifunc=Omni_test + set completeopt=menuone,noinsert + hi PmenuMatchSel ctermfg=6 ctermbg=7 + hi PmenuMatch ctermfg=4 ctermbg=225 + END + call writefile(lines, 'Xscript', 'D') + let buf = RunVimInTerminal('-S Xscript', {}) + call TermWait(buf) + call term_sendkeys(buf, "i\\") + call TermWait(buf, 50) + call term_sendkeys(buf, "foo") + call VerifyScreenDump(buf, 'Test_pum_highlights_19', {}) + + call term_sendkeys(buf, "\\") + call TermWait(buf) + + call StopVimInTerminal(buf) +endfunc + func Test_pum_user_abbr_hlgroup() CheckScreendump let lines =<< trim END diff --git a/src/version.c b/src/version.c index b7a22dd497..a008d32404 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1011, /**/ 1010, /**/ From 8e92db4ea22f010d402df9d34071022a4aa8cef5 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Mon, 13 Jan 2025 07:30:11 +0100 Subject: [PATCH 17/93] patch 9.1.1012: Vim9: class interface inheritance not correctly working Problem: Vim9: class interface inheritance not correctly working Solution: make the class inherit the interfaces of the super class fixes: #16395 closes: #16412 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_vim9_class.vim | 221 ++++++++++++++++++++++++++------ src/version.c | 2 + src/vim9class.c | 105 ++++++++++++++- 3 files changed, 283 insertions(+), 45 deletions(-) diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index c20de25337..23281bcad7 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -6096,44 +6096,151 @@ enddef " Test for using an interface method using a child object when it is overridden " by the child class. -" FIXME: This test fails. -" def Test_interface_overridden_method_from_child() -" var lines =<< trim END -" vim9script -" -" interface A -" def Foo(): string -" endinterface -" -" class B implements A -" def Foo(): string -" return 'b-foo' -" enddef -" endclass -" -" class C extends B -" def Bar(): string -" return 'bar' -" enddef -" def Foo(): string -" return 'c-foo' -" enddef -" endclass -" -" def T1(a: A) -" assert_equal('c-foo', a.Foo()) -" enddef -" -" def T2(b: B) -" assert_equal('c-foo', b.Foo()) -" enddef -" -" var c = C.new() -" T1(c) -" T2(c) -" END -" v9.CheckSourceSuccess(lines) -" enddef +def Test_interface_overridden_method_from_child() + var lines =<< trim END + vim9script + + interface A + def Foo(): string + endinterface + + class B implements A + def Foo(): string + return 'b-foo' + enddef + endclass + + class C extends B + def Bar(): string + return 'bar' + enddef + def Foo(): string + return 'c-foo' + enddef + endclass + + def T1(a: A) + assert_equal('c-foo', a.Foo()) + enddef + + def T2(b: B) + assert_equal('c-foo', b.Foo()) + enddef + + var c = C.new() + T1(c) + T2(c) + END + v9.CheckSourceSuccess(lines) +enddef + +" Test for interface inheritance +def Test_interface_inheritance() + var lines =<< trim END + vim9script + + interface A + def A_Fn(): string + endinterface + + interface B + def B_Fn(): string + endinterface + + interface C + def C_Fn(): string + endinterface + + class C1 implements A + def A_Fn(): string + return 'c1-a' + enddef + endclass + + class C2 extends C1 implements B + def B_Fn(): string + return 'c2-b' + enddef + def A_Fn(): string + return 'c2-a' + enddef + endclass + + class C3 extends C2 implements C + def C_Fn(): string + return 'c3-c' + enddef + def A_Fn(): string + return 'c3-a' + enddef + def B_Fn(): string + return 'c3-b' + enddef + endclass + + def T1(a: A, s: string) + assert_equal(s, a.A_Fn()) + enddef + + def T2(b: B, s: string) + assert_equal(s, b.B_Fn()) + enddef + + def T3(c: C, s: string) + assert_equal(s, c.C_Fn()) + enddef + + def T4(c1: C1) + T1(c1, 'c3-a') + enddef + + def T5(c2: C2) + T1(c2, 'c3-a') + T2(c2, 'c3-b') + enddef + + def T6(c3: C3) + T1(c3, 'c3-a') + T2(c3, 'c3-b') + T3(c3, 'c3-c') + enddef + + var o3 = C3.new() + T4(o3) + T5(o3) + T6(o3) + END + v9.CheckSourceSuccess(lines) + + # Both the parent and child classes implement the same interface + lines =<< trim END + vim9script + + interface I + def Foo(): string + endinterface + + class A implements I + def Foo(): string + return 'A-foo' + enddef + endclass + + class B implements I + def Foo(): string + return 'B-foo' + enddef + endclass + + def Bar(i1: I): string + return i1.Foo() + enddef + + var b = B.new() + assert_equal('B-foo', Bar(b)) + END + v9.CheckSourceSuccess(lines) +enddef " Test for abstract methods def Test_abstract_method() @@ -7282,6 +7389,44 @@ def Test_implement_interface_with_different_variable_order() v9.CheckSourceSuccess(lines) enddef +" Test for inheriting interfaces from an imported super class +def Test_interface_inheritance_with_imported_super() + var lines =<< trim END + vim9script + + export interface I + def F(): string + endinterface + + export class A implements I + def F(): string + return 'A' + enddef + endclass + END + writefile(lines, 'Xinheritintfimportclass.vim', 'D') + + lines =<< trim END + vim9script + + import './Xinheritintfimportclass.vim' as i_imp + + # class C extends i_imp.A + class C extends i_imp.A implements i_imp.I + def F(): string + return 'C' + enddef + endclass + + def TestI(i: i_imp.I): string + return i.F() + enddef + + assert_equal('C', TestI(C.new())) + END + v9.CheckSourceSuccess(lines) +enddef + " Test for using "any" type for a variable in a sub-class while it has a " concrete type in the interface def Test_implements_using_var_type_any() diff --git a/src/version.c b/src/version.c index a008d32404..9dddabc05a 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1012, /**/ 1011, /**/ diff --git a/src/vim9class.c b/src/vim9class.c index 7c7700ba19..c3ccf0250a 100644 --- a/src/vim9class.c +++ b/src/vim9class.c @@ -782,7 +782,7 @@ validate_interface_methods( static int validate_implements_classes( garray_T *impl_gap, - class_T **intf_classes, + garray_T *intf_classes_gap, garray_T *objmethods_gap, garray_T *objmembers_gap, class_T *extends_cl) @@ -812,7 +812,15 @@ validate_implements_classes( } class_T *ifcl = tv.vval.v_class; - intf_classes[i] = ifcl; + if (ga_grow(intf_classes_gap, 1) == FAIL) + { + success = FALSE; + clear_tv(&tv); + break; + } + ((class_T **)intf_classes_gap->ga_data)[intf_classes_gap->ga_len] + = ifcl; + intf_classes_gap->ga_len++; ++ifcl->class_refcount; // check the variables of the interface match the members of the class @@ -830,6 +838,80 @@ validate_implements_classes( return success; } +/* + * Returns TRUE if the interface class "ifcl" is already present in the + * "intf_classes_gap" grow array. + */ + static int +is_interface_class_present(garray_T *intf_classes_gap, class_T *ifcl) +{ + for (int j = 0; j < intf_classes_gap->ga_len; j++) + { + if (((class_T **)intf_classes_gap)[j] == ifcl) + return TRUE; + } + + return FALSE; +} + +/* + * Add interface "ifcl" from a super class to "intf_classes_gap" and the class + * name to "impl_gap". + */ + static int +add_interface_from_super_class( + class_T *ifcl, + garray_T *impl_gap, + garray_T *intf_classes_gap) +{ + char_u *intf_name; + + // Add the interface name to "impl_gap" + intf_name = vim_strsave(ifcl->class_name); + if (intf_name == NULL) + return FALSE; + + if (ga_grow(impl_gap, 1) == FAIL) + return FALSE; + + char_u **intf_names = (char_u **)impl_gap->ga_data; + intf_names[impl_gap->ga_len] = intf_name; + impl_gap->ga_len++; + + // Add the interface class to "intf_classes_gap" + if (ga_grow(intf_classes_gap, 1) == FAIL) + return FALSE; + + class_T **intf_classes = (class_T **)intf_classes_gap->ga_data; + intf_classes[intf_classes_gap->ga_len] = ifcl; + intf_classes_gap->ga_len++; + ++ifcl->class_refcount; + + return TRUE; +} + +/* + * Add "super" class interfaces to "intf_classes_gap" (if not present already) + * Add the interface class names to "impl_gap". + */ + static int +add_super_class_interfaces( + class_T *super, + garray_T *impl_gap, + garray_T *intf_classes_gap) +{ + // Iterate through all the interfaces implemented by "super" + for (int i = 0; i < super->class_interface_count; i++) + { + class_T *ifcl = super->class_interfaces_cl[i]; + + if (!is_interface_class_present(intf_classes_gap, ifcl)) + add_interface_from_super_class(ifcl, impl_gap, intf_classes_gap); + } + + return TRUE; +} + /* * Check no function argument name is used as a class member. * (Object members are always accessed with "this." prefix, so no need @@ -2427,14 +2509,23 @@ ex_class(exarg_T *eap) success = validate_abstract_class_methods(&classfunctions, &objmethods, extends_cl); + // Process the "implements" entries // Check all "implements" entries are valid. - if (success && ga_impl.ga_len > 0) - { - intf_classes = ALLOC_CLEAR_MULT(class_T *, ga_impl.ga_len); + garray_T intf_classes_ga; - success = validate_implements_classes(&ga_impl, intf_classes, + ga_init2(&intf_classes_ga, sizeof(class_T *), 5); + + if (success && ga_impl.ga_len > 0) + success = validate_implements_classes(&ga_impl, &intf_classes_ga, &objmethods, &objmembers, extends_cl); - } + + // inherit the super class interfaces + if (success && extends_cl != NULL) + success = add_super_class_interfaces(extends_cl, &ga_impl, + &intf_classes_ga); + + intf_classes = intf_classes_ga.ga_data; + intf_classes_ga.ga_len = 0; // Check no function argument name is used as a class member. if (success) From 221c53202da1e9a2a30d081a46eacdeb220be443 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 13 Jan 2025 07:54:33 +0100 Subject: [PATCH 18/93] runtime(vim): Split Vim legacy and Vim9 script indent tests The indent test file is not highlighted correctly as it's currently a syntactically erroneous mix of legacy and Vim9 script. This is causing spurious indent test failures as the indent script relies on syntax ID tests to determine the context of lines being processed. Splitting the tests into legacy and Vim9 specific files allows for correct syntax highlighting and indenting. closes: #16431 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/indent/testdir/vim.in | 780 -------------------------------- runtime/indent/testdir/vim.ok | 780 -------------------------------- runtime/indent/testdir/vim9.in | 782 +++++++++++++++++++++++++++++++++ runtime/indent/testdir/vim9.ok | 782 +++++++++++++++++++++++++++++++++ 4 files changed, 1564 insertions(+), 1560 deletions(-) create mode 100644 runtime/indent/testdir/vim9.in create mode 100644 runtime/indent/testdir/vim9.ok diff --git a/runtime/indent/testdir/vim.in b/runtime/indent/testdir/vim.in index 431528ee27..6b894b5107 100644 --- a/runtime/indent/testdir/vim.in +++ b/runtime/indent/testdir/vim.in @@ -113,284 +113,12 @@ echo 0 end " END_INDENT -" START_INDENT -var result = Func( -arg1, -arg2 -) -" END_INDENT - -" START_INDENT -var result = Func(arg1, -arg2) -" END_INDENT - -" START_INDENT -filter(list, (k, v) => -v > 0) -" END_INDENT - -" START_INDENT -filter(list, (k, v) => { -const x = get(list, k, 0) -return x > 0 -}) -" END_INDENT - -" START_INDENT -if x > 0 -filter(list, (k, v) => { -const x = get(list, k, 1) -return x > 0 -}) -endif -" END_INDENT - -" START_INDENT -{ -var temp = 'temp' -} -" END_INDENT - -" START_INDENT -var text = lead -.. middle -.. end -" END_INDENT - -" START_INDENT -var text = lead .. -middle .. -end -" END_INDENT - -" START_INDENT -var total = start + -end - -correction -" END_INDENT - -" START_INDENT -var result = start -:+ print -" END_INDENT - -" START_INDENT -var result = positive -? PosFunc(arg) -: NegFunc(arg) -" END_INDENT - -" START_INDENT -var result = GetBuilder() -->BuilderSetWidth(333) -->BuilderSetHeight(777) -->BuilderBuild() -" END_INDENT - -" START_INDENT -var result = MyDict -.member -" END_INDENT - -" START_INDENT -autocmd BufNewFile *.match if condition -| echo 'match' -| endif -" END_INDENT - -" START_INDENT -set cpo+=C -var lines =<< trim END -| this works -END -set cpo-=C -" END_INDENT - -" START_INDENT -syn region Text -\ start='foo' -#\ comment -\ end='bar' -" END_INDENT - -" START_INDENT -au CursorHold * echom 'BEFORE bar' -#\ some comment -| echom 'AFTER bar' -" END_INDENT - -" START_INDENT -def MyFunc(text: string, -separator = '-' -): string -enddef -" END_INDENT - -" START_INDENT -def MyFunc( -text: string, -separator = '-' -): string -enddef -" END_INDENT - -" START_INDENT -[var1, var2] = -Func() -" END_INDENT - -" START_INDENT -const list = ['one', -'two'] -" END_INDENT - -" START_INDENT -const list = [ -'one', -'two', -] -" END_INDENT - -" START_INDENT -const dict = {one: 1, -two: 2 -} -" END_INDENT - -" START_INDENT -const dict = { -one: 1, -two: 2 -} -" END_INDENT - -" START_INDENT -if true -const dict = -{ -one: 1, -two: 2 -} -endif -" END_INDENT - -" START_INDENT -def Func() -return { -one: 1 -} -enddef -" END_INDENT - -" START_INDENT -echo { -a: 0, -# b -# c -} -" END_INDENT - -" START_INDENT -echo search( -# comment -'1' -.. '2' -) -" END_INDENT - -" START_INDENT -if true -var v = ( # trailing "(" starts line continuation -3 + 4 # nothing special -) # end of expression indicates continued line -var x: number # needs to align with previous "var" -endif -" END_INDENT - -" START_INDENT -def Func() # {{{ -# comment -if true -return -endif -enddef -" END_INDENT - -" START_INDENT -echo { -key: -'value', -} -" END_INDENT - -" START_INDENT -var id = time -->timer_start((_) => { -n = 0 -}) -" END_INDENT - " START_INDENT augroup Name autocmd! augroup END " END_INDENT -" START_INDENT -var n = -# comment -1 -+ 2 - -var s = '' -" END_INDENT - -" START_INDENT -var keys = { -J: 'j', -"\": '1G', -"\": 'G', -z: 'zz' -} -" END_INDENT - -" START_INDENT -export def Func( -n: number, -s: string, -...l: list -) -enddef -" END_INDENT - -" START_INDENT -var heredoc =<< trim ENDD -var nested_heredoc =<< trim END -END -ENDD -" END_INDENT - -" START_INDENT -if true -else " comment -endif -" END_INDENT - -" START_INDENT -if true | echo 'one' | endif -if true | echo 'two' | endif -if true | echo 'three' | endif -" END_INDENT - -" START_INDENT -if true -:'<-1 mark < -else -echo '' -endif -" END_INDENT - " START_INDENT substitute/pat /rep / echo @@ -404,92 +132,12 @@ echo 2 endtry " END_INDENT -" START_INDENT -def Func() -Cmd % -enddef -" END_INDENT - " START_INDENT if end == 'xxx' || end == 'yyy' echo endif " END_INDENT -" START_INDENT -if true -popup_move(id, {col: 1, -line: 2}) -endif -setwinvar(id, 'name', 3) -" END_INDENT - -" START_INDENT -var d = [ -{a: 'x', -b: 'y'}, -FuncA(), -FuncB(), -] -" END_INDENT - -" START_INDENT -var ll = [[ -1, -2, -3], [ -4, -5, -6], [ -7, -8, -9]] -" END_INDENT - -" START_INDENT -var ld = [{ -a: 'xxx', -b: 'yyy'}, { -c: 'xxx', -d: 'yyy'}, { -e: 'xxx', -f: 'yyy'}, { -}] -" END_INDENT - -" START_INDENT -var d = { -a: { -b: { -c: [{ -d: 'e', -f: 'g', -h: 'i' -}], -j: 'k', -}, -}, -} -" END_INDENT - -" START_INDENT -if true -var end: any -if true -end = 0 -elseif true -echo -endif -endif -" END_INDENT - -" START_INDENT -if true -var d = { -end: 0} -endif -" END_INDENT - " START_INDENT nunmap ( nunmap ) @@ -499,224 +147,6 @@ silent! xunmap i{ silent! xunmap a{ " END_INDENT -" START_INDENT -def Func( -s: string, -n = 1, -m = 2 -) -enddef -" END_INDENT - -" START_INDENT -var h =<< END -text -END - -def Func() -echo -enddef -" END_INDENT - -" START_INDENT -def Func() -var h =<< END -text -END -echo 'test' -enddef -" END_INDENT - -" START_INDENT -def Foo() -lcd - -enddef -def Bar() -echo -enddef -" END_INDENT - -" START_INDENT -if true -n = Func(1, 2, -3) -endif -" END_INDENT - -" START_INDENT -def Func(s: string, -n: number): bool -if true -return false -endif -enddef -" END_INDENT - -" START_INDENT -def Func( -n: number) -# -echo -enddef -" END_INDENT - -" START_INDENT -" INDENT_AT this-line -def Func( - n: number) - # -echo # this-line -enddef -" END_INDENT - -" START_INDENT -if true -if true -normal! == -endif -endif -" END_INDENT - -" START_INDENT -var d = { -a: () => true, -b: () => true -&& true -&& Foo(), -c: () => Bar(), -e: () => Baz(), -} -" END_INDENT - -" START_INDENT -def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) -return (Emit: func(any)) => { -Cont((t: any) => { -if Pred(t) -Emit(t) -endif -}) -} -enddef -" END_INDENT - -" START_INDENT -" INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true} -def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) -return (Emit: func(any)) => { -Cont((t: any) => { -if Pred(t) -Emit(t) -endif -}) -} -enddef -" END_INDENT - -" START_INDENT -" INDENT_EXE unlet! g:vim_indent -" END_INDENT - -" START_INDENT -g:lightline = { -'active': { -'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ], -}, -'inactive': { -'left': [ [ 'readonly', 'relativepath', 'modified' ] ], -} -} -" END_INDENT - -" START_INDENT -if getline(1, 10) -->map((_, v: string): number => strcharlen(v)) -->max() > 1'000 -&l:breakindent = false -&l:linebreak = false -else -&l:breakindent = true -&l:linebreak = true -endif -" END_INDENT - -" START_INDENT -var ext2cmd: dict = { -doc: $'antiword {fname}', -docx: $'pandoc --from=docx --to=markdown {fname}', -epub: $'pandoc --from=epub --to=markdown {fname}', -odp: $'odt2txt {fname}', -odt: $'odt2txt {fname}', -pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -', -rtf: 'unrtf --text', -} -" END_INDENT - -" START_INDENT -const ptybuf: number = term_start(&shell, { -hidden: true, -exit_cb: (_, _) => { -if true -close -else -help -endif -} -}) -" END_INDENT - -" START_INDENT -var d = { -a: 0, -# a ' quote {{{ -#}}} -b: 0, -} -" END_INDENT - -" START_INDENT -echo printf('%s () %s', -1, -2 -) -" END_INDENT - -" START_INDENT -prop_add(1, col('.'), { -length: 2, -type: 'test' -}) -" END_INDENT - -" START_INDENT -echo (() => " string starting with space")() -echo -" END_INDENT - -" START_INDENT -var variables = deepcopy(g:) -->filter((k: string, _): bool => -k =~ '\c\V' .. keyword->escape('\') -&& k !~ '\%(loaded\|did_plugin_\)') -->items() -->map((_, v): string => v[0] .. ' = ' .. string(v[1])) -new -" END_INDENT - -" START_INDENT -var d = freq -->map((_, v) => -v * ( -1 -+ 2 -)) -for item in d -->items() -->sort((a, b) => b[1] - a[1]) -echo -endfor -" END_INDENT - " START_INDENT make_job = job_start([&shell, &shellcmdflag, make_cmd], { callback: function(MakeProcessOutput, [qfid]), @@ -726,109 +156,16 @@ in_io: 'null' }) " END_INDENT -" START_INDENT -var matching_abbrev: list> = copy(ABBREV) -->filter((_, v: dict): bool => -stridx(v.lhs, word_to_complete) == 0) -->map((_, v: dict) => ({ -word: v.lhs, -menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0 -? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')') -: AbbrevRhs(v.rhs) -})) -" END_INDENT - -" START_INDENT -def Func() -if true -vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file -endif -enddef -" END_INDENT - " START_INDENT setlocal iskeyword+=[ cword = expand('') " END_INDENT -" START_INDENT -silent if true -echo -endif -" END_INDENT - -" START_INDENT -def Func() -sort :^.*[\/]: -enddef -" END_INDENT - -" START_INDENT -def Func() -d = { -} -hd =<< trim END -[' -]' -END -enddef -" END_INDENT - -" START_INDENT -def Func() -if true -var hd =<< trim END -if get(b:, 'current_syntax', '') -endif -END -elseif true -echo -endif -enddef -" END_INDENT - -" START_INDENT -# test for control-flow keyword followed by commented fold marker {{{ -if true -echo -endif #}}} -" END_INDENT - " START_INDENT if winsz == 0|let winsz= ""|endif exe "noswapfile ".winsz."wincmd s" " END_INDENT -" START_INDENT -if true -if true -windo if true | echo | endif -augroup Name -autocmd WinLeave * if true | eval 1 + 2 | endif -augroup END -endif -endif -" END_INDENT - -" START_INDENT -if true -echo ' =<< trim END' -->len() -endif -" END_INDENT - -" START_INDENT -function Func() -if true -if true -if true | echo com | endif -if true | echo com | endif -endif -else -endif -endfunction -" END_INDENT - " START_INDENT function Func() if v:true @@ -839,128 +176,11 @@ endif endfunction " END_INDENT -" START_INDENT -var matchpairs: string = &matchpairs -var pairs: dict> -for [opening: string, closing: string] -in matchpairs -->split(',') -->map((_, v: string): list => split(v, ':')) -pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$'] -pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0'] -endfor -" END_INDENT - -" START_INDENT -{ -echo [] -+ [] -+ [{a: 1, -b: 2}] -} -" END_INDENT - " START_INDENT silent! argdel * edit file " END_INDENT -" START_INDENT -def Foo() -Bar(1, -[]->filter((_, v) => { -return true -}), -() => { -echo -}) -enddef -" END_INDENT - -" START_INDENT -echo { -k: () => { -if true -echo -popup_setoptions(id, -{title: 'title'}) -endif -} -} -" END_INDENT - -" START_INDENT -if true -elseif -endif -" END_INDENT - -" START_INDENT -if ( -true) -&& true -echo -endif -" END_INDENT - -" START_INDENT -abstract class Shape -var color = Color.Black -var thickness = 10 -endclass -" END_INDENT - -" START_INDENT -class OtherThing -var size: number -static var totalSize: number - -static def ClearTotalSize(): number -var prev = totalSize -totalSize = 0 -return prev -enddef -endclass -" END_INDENT - -" START_INDENT -interface HasSurface -var size: number -def Surface(): number -endinterface -" END_INDENT - -" START_INDENT -interface EnterExit -def Enter(): void -def Exit(): void -endinterface -" END_INDENT - -" START_INDENT -enum Color -White, -Red, -Green, -Blue, -Black -endenum -" END_INDENT - -" START_INDENT -enum Digits -INVALID(v:numbermax), # The null value. -ZERO(0 * v:numbermin), ONE(2 - 1), -TWO(1 + 1), THREE(9 / 3), FOUR(1 * 4), -FIVE(1 + 2 + 2), SIX(36 / 3 / 2), SEVEN(7), EIGHT(2 * 2 * 2), -NINE(3 + 3 + 3) -const value: number -def new(value: number) -this.value = value -enddef -endenum -" END_INDENT - " START_INDENT call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' }) call prop_type_delete('indent_after_literal_dict') diff --git a/runtime/indent/testdir/vim.ok b/runtime/indent/testdir/vim.ok index 03001d525c..29878294bb 100644 --- a/runtime/indent/testdir/vim.ok +++ b/runtime/indent/testdir/vim.ok @@ -113,284 +113,12 @@ if v:true end " END_INDENT -" START_INDENT -var result = Func( - arg1, - arg2 -) -" END_INDENT - -" START_INDENT -var result = Func(arg1, - arg2) -" END_INDENT - -" START_INDENT -filter(list, (k, v) => - v > 0) -" END_INDENT - -" START_INDENT -filter(list, (k, v) => { - const x = get(list, k, 0) - return x > 0 -}) -" END_INDENT - -" START_INDENT -if x > 0 - filter(list, (k, v) => { - const x = get(list, k, 1) - return x > 0 - }) -endif -" END_INDENT - -" START_INDENT -{ - var temp = 'temp' -} -" END_INDENT - -" START_INDENT -var text = lead - .. middle - .. end -" END_INDENT - -" START_INDENT -var text = lead .. - middle .. - end -" END_INDENT - -" START_INDENT -var total = start + - end - - correction -" END_INDENT - -" START_INDENT -var result = start -:+ print -" END_INDENT - -" START_INDENT -var result = positive - ? PosFunc(arg) - : NegFunc(arg) -" END_INDENT - -" START_INDENT -var result = GetBuilder() - ->BuilderSetWidth(333) - ->BuilderSetHeight(777) - ->BuilderBuild() -" END_INDENT - -" START_INDENT -var result = MyDict - .member -" END_INDENT - -" START_INDENT -autocmd BufNewFile *.match if condition - | echo 'match' - | endif -" END_INDENT - -" START_INDENT -set cpo+=C -var lines =<< trim END - | this works -END -set cpo-=C -" END_INDENT - -" START_INDENT -syn region Text - \ start='foo' - #\ comment - \ end='bar' -" END_INDENT - -" START_INDENT -au CursorHold * echom 'BEFORE bar' - #\ some comment - | echom 'AFTER bar' -" END_INDENT - -" START_INDENT -def MyFunc(text: string, - separator = '-' - ): string -enddef -" END_INDENT - -" START_INDENT -def MyFunc( - text: string, - separator = '-' - ): string -enddef -" END_INDENT - -" START_INDENT -[var1, var2] = - Func() -" END_INDENT - -" START_INDENT -const list = ['one', - 'two'] -" END_INDENT - -" START_INDENT -const list = [ - 'one', - 'two', -] -" END_INDENT - -" START_INDENT -const dict = {one: 1, - two: 2 -} -" END_INDENT - -" START_INDENT -const dict = { - one: 1, - two: 2 -} -" END_INDENT - -" START_INDENT -if true - const dict = - { - one: 1, - two: 2 - } -endif -" END_INDENT - -" START_INDENT -def Func() - return { - one: 1 - } -enddef -" END_INDENT - -" START_INDENT -echo { - a: 0, - # b - # c -} -" END_INDENT - -" START_INDENT -echo search( - # comment - '1' - .. '2' -) -" END_INDENT - -" START_INDENT -if true - var v = ( # trailing "(" starts line continuation - 3 + 4 # nothing special - ) # end of expression indicates continued line - var x: number # needs to align with previous "var" -endif -" END_INDENT - -" START_INDENT -def Func() # {{{ - # comment - if true - return - endif -enddef -" END_INDENT - -" START_INDENT -echo { - key: - 'value', -} -" END_INDENT - -" START_INDENT -var id = time - ->timer_start((_) => { - n = 0 - }) -" END_INDENT - " START_INDENT augroup Name autocmd! augroup END " END_INDENT -" START_INDENT -var n = - # comment - 1 - + 2 - -var s = '' -" END_INDENT - -" START_INDENT -var keys = { - J: 'j', - "\": '1G', - "\": 'G', - z: 'zz' -} -" END_INDENT - -" START_INDENT -export def Func( - n: number, - s: string, - ...l: list - ) -enddef -" END_INDENT - -" START_INDENT -var heredoc =<< trim ENDD - var nested_heredoc =<< trim END - END -ENDD -" END_INDENT - -" START_INDENT -if true -else " comment -endif -" END_INDENT - -" START_INDENT -if true | echo 'one' | endif -if true | echo 'two' | endif -if true | echo 'three' | endif -" END_INDENT - -" START_INDENT -if true - :'<-1 mark < -else - echo '' -endif -" END_INDENT - " START_INDENT substitute/pat /rep / echo @@ -404,92 +132,12 @@ catch /pat / # comment endtry " END_INDENT -" START_INDENT -def Func() - Cmd % -enddef -" END_INDENT - " START_INDENT if end == 'xxx' || end == 'yyy' echo endif " END_INDENT -" START_INDENT -if true - popup_move(id, {col: 1, - line: 2}) -endif -setwinvar(id, 'name', 3) -" END_INDENT - -" START_INDENT -var d = [ - {a: 'x', - b: 'y'}, - FuncA(), - FuncB(), -] -" END_INDENT - -" START_INDENT -var ll = [[ - 1, - 2, - 3], [ - 4, - 5, - 6], [ - 7, - 8, - 9]] -" END_INDENT - -" START_INDENT -var ld = [{ - a: 'xxx', - b: 'yyy'}, { - c: 'xxx', - d: 'yyy'}, { - e: 'xxx', - f: 'yyy'}, { - }] -" END_INDENT - -" START_INDENT -var d = { - a: { - b: { - c: [{ - d: 'e', - f: 'g', - h: 'i' - }], - j: 'k', - }, - }, -} -" END_INDENT - -" START_INDENT -if true - var end: any - if true - end = 0 - elseif true - echo - endif -endif -" END_INDENT - -" START_INDENT -if true - var d = { - end: 0} -endif -" END_INDENT - " START_INDENT nunmap ( nunmap ) @@ -499,224 +147,6 @@ silent! xunmap i{ silent! xunmap a{ " END_INDENT -" START_INDENT -def Func( - s: string, - n = 1, - m = 2 - ) -enddef -" END_INDENT - -" START_INDENT -var h =<< END -text -END - -def Func() - echo -enddef -" END_INDENT - -" START_INDENT -def Func() - var h =<< END -text -END - echo 'test' -enddef -" END_INDENT - -" START_INDENT -def Foo() - lcd - -enddef -def Bar() - echo -enddef -" END_INDENT - -" START_INDENT -if true - n = Func(1, 2, - 3) -endif -" END_INDENT - -" START_INDENT -def Func(s: string, - n: number): bool - if true - return false - endif -enddef -" END_INDENT - -" START_INDENT -def Func( - n: number) - # - echo -enddef -" END_INDENT - -" START_INDENT -" INDENT_AT this-line -def Func( - n: number) - # - echo # this-line -enddef -" END_INDENT - -" START_INDENT -if true - if true - normal! == - endif -endif -" END_INDENT - -" START_INDENT -var d = { - a: () => true, - b: () => true - && true - && Foo(), - c: () => Bar(), - e: () => Baz(), -} -" END_INDENT - -" START_INDENT -def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) - return (Emit: func(any)) => { - Cont((t: any) => { - if Pred(t) - Emit(t) - endif - }) - } -enddef -" END_INDENT - -" START_INDENT -" INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true} -def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) - return (Emit: func(any)) => { - Cont((t: any) => { - if Pred(t) - Emit(t) - endif - }) - } -enddef -" END_INDENT - -" START_INDENT -" INDENT_EXE unlet! g:vim_indent -" END_INDENT - -" START_INDENT -g:lightline = { - 'active': { - 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ], - }, - 'inactive': { - 'left': [ [ 'readonly', 'relativepath', 'modified' ] ], - } -} -" END_INDENT - -" START_INDENT -if getline(1, 10) - ->map((_, v: string): number => strcharlen(v)) - ->max() > 1'000 - &l:breakindent = false - &l:linebreak = false -else - &l:breakindent = true - &l:linebreak = true -endif -" END_INDENT - -" START_INDENT -var ext2cmd: dict = { - doc: $'antiword {fname}', - docx: $'pandoc --from=docx --to=markdown {fname}', - epub: $'pandoc --from=epub --to=markdown {fname}', - odp: $'odt2txt {fname}', - odt: $'odt2txt {fname}', - pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -', - rtf: 'unrtf --text', -} -" END_INDENT - -" START_INDENT -const ptybuf: number = term_start(&shell, { - hidden: true, - exit_cb: (_, _) => { - if true - close - else - help - endif - } -}) -" END_INDENT - -" START_INDENT -var d = { - a: 0, - # a ' quote {{{ - #}}} - b: 0, -} -" END_INDENT - -" START_INDENT -echo printf('%s () %s', - 1, - 2 -) -" END_INDENT - -" START_INDENT -prop_add(1, col('.'), { - length: 2, - type: 'test' -}) -" END_INDENT - -" START_INDENT -echo (() => " string starting with space")() -echo -" END_INDENT - -" START_INDENT -var variables = deepcopy(g:) - ->filter((k: string, _): bool => - k =~ '\c\V' .. keyword->escape('\') - && k !~ '\%(loaded\|did_plugin_\)') - ->items() - ->map((_, v): string => v[0] .. ' = ' .. string(v[1])) -new -" END_INDENT - -" START_INDENT -var d = freq - ->map((_, v) => - v * ( - 1 - + 2 - )) -for item in d - ->items() - ->sort((a, b) => b[1] - a[1]) - echo -endfor -" END_INDENT - " START_INDENT make_job = job_start([&shell, &shellcmdflag, make_cmd], { callback: function(MakeProcessOutput, [qfid]), @@ -726,109 +156,16 @@ make_job = job_start([&shell, &shellcmdflag, make_cmd], { }) " END_INDENT -" START_INDENT -var matching_abbrev: list> = copy(ABBREV) - ->filter((_, v: dict): bool => - stridx(v.lhs, word_to_complete) == 0) - ->map((_, v: dict) => ({ - word: v.lhs, - menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0 - ? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')') - : AbbrevRhs(v.rhs) - })) -" END_INDENT - -" START_INDENT -def Func() - if true - vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file - endif -enddef -" END_INDENT - " START_INDENT setlocal iskeyword+=[ cword = expand('') " END_INDENT -" START_INDENT -silent if true - echo -endif -" END_INDENT - -" START_INDENT -def Func() - sort :^.*[\/]: -enddef -" END_INDENT - -" START_INDENT -def Func() - d = { - } - hd =<< trim END - [' - ]' - END -enddef -" END_INDENT - -" START_INDENT -def Func() - if true - var hd =<< trim END - if get(b:, 'current_syntax', '') - endif - END - elseif true - echo - endif -enddef -" END_INDENT - -" START_INDENT -# test for control-flow keyword followed by commented fold marker {{{ -if true - echo -endif #}}} -" END_INDENT - " START_INDENT if winsz == 0|let winsz= ""|endif exe "noswapfile ".winsz."wincmd s" " END_INDENT -" START_INDENT -if true - if true - windo if true | echo | endif - augroup Name - autocmd WinLeave * if true | eval 1 + 2 | endif - augroup END - endif -endif -" END_INDENT - -" START_INDENT -if true - echo ' =<< trim END' - ->len() -endif -" END_INDENT - -" START_INDENT -function Func() - if true - if true - if true | echo com | endif - if true | echo com | endif - endif - else - endif -endfunction -" END_INDENT - " START_INDENT function Func() if v:true @@ -839,128 +176,11 @@ function Func() endfunction " END_INDENT -" START_INDENT -var matchpairs: string = &matchpairs -var pairs: dict> -for [opening: string, closing: string] - in matchpairs - ->split(',') - ->map((_, v: string): list => split(v, ':')) - pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$'] - pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0'] -endfor -" END_INDENT - -" START_INDENT -{ - echo [] - + [] - + [{a: 1, - b: 2}] -} -" END_INDENT - " START_INDENT silent! argdel * edit file " END_INDENT -" START_INDENT -def Foo() - Bar(1, - []->filter((_, v) => { - return true - }), - () => { - echo - }) -enddef -" END_INDENT - -" START_INDENT -echo { - k: () => { - if true - echo - popup_setoptions(id, - {title: 'title'}) - endif - } -} -" END_INDENT - -" START_INDENT -if true -elseif -endif -" END_INDENT - -" START_INDENT -if ( - true) - && true - echo -endif -" END_INDENT - -" START_INDENT -abstract class Shape - var color = Color.Black - var thickness = 10 -endclass -" END_INDENT - -" START_INDENT -class OtherThing - var size: number - static var totalSize: number - - static def ClearTotalSize(): number - var prev = totalSize - totalSize = 0 - return prev - enddef -endclass -" END_INDENT - -" START_INDENT -interface HasSurface - var size: number - def Surface(): number -endinterface -" END_INDENT - -" START_INDENT -interface EnterExit - def Enter(): void - def Exit(): void -endinterface -" END_INDENT - -" START_INDENT -enum Color - White, - Red, - Green, - Blue, - Black -endenum -" END_INDENT - -" START_INDENT -enum Digits - INVALID(v:numbermax), # The null value. - ZERO(0 * v:numbermin), ONE(2 - 1), - TWO(1 + 1), THREE(9 / 3), FOUR(1 * 4), - FIVE(1 + 2 + 2), SIX(36 / 3 / 2), SEVEN(7), EIGHT(2 * 2 * 2), - NINE(3 + 3 + 3) - const value: number - def new(value: number) - this.value = value - enddef -endenum -" END_INDENT - " START_INDENT call prop_type_add('indent_after_literal_dict', #{ foo: 'bar' }) call prop_type_delete('indent_after_literal_dict') diff --git a/runtime/indent/testdir/vim9.in b/runtime/indent/testdir/vim9.in new file mode 100644 index 0000000000..a14d4e7d17 --- /dev/null +++ b/runtime/indent/testdir/vim9.in @@ -0,0 +1,782 @@ +vim9script +# vim: set ft=vim sw=4 : + +# START_INDENT +var result = Func( +arg1, +arg2 +) +# END_INDENT + +# START_INDENT +var result = Func(arg1, +arg2) +# END_INDENT + +# START_INDENT +filter(list, (k, v) => +v > 0) +# END_INDENT + +# START_INDENT +filter(list, (k, v) => { +const x = get(list, k, 0) +return x > 0 +}) +# END_INDENT + +# START_INDENT +if x > 0 +filter(list, (k, v) => { +const x = get(list, k, 1) +return x > 0 +}) +endif +# END_INDENT + +# START_INDENT +{ +var temp = 'temp' +} +# END_INDENT + +# START_INDENT +var text = lead +.. middle +.. end +# END_INDENT + +# START_INDENT +var text = lead .. +middle .. +end +# END_INDENT + +# START_INDENT +var total = start + +end - +correction +# END_INDENT + +# START_INDENT +var result = start +:+ print +# END_INDENT + +# START_INDENT +var result = positive +? PosFunc(arg) +: NegFunc(arg) +# END_INDENT + +# START_INDENT +var result = GetBuilder() +->BuilderSetWidth(333) +->BuilderSetHeight(777) +->BuilderBuild() +# END_INDENT + +# START_INDENT +var result = MyDict +.member +# END_INDENT + +# START_INDENT +autocmd BufNewFile *.match if condition +| echo 'match' +| endif +# END_INDENT + +# START_INDENT +set cpo+=C +var lines =<< trim END +| this works +END +set cpo-=C +# END_INDENT + +# START_INDENT +syn region Text +\ start='foo' +#\ comment +\ end='bar' +# END_INDENT + +# START_INDENT +au CursorHold * echom 'BEFORE bar' +#\ some comment +| echom 'AFTER bar' +# END_INDENT + +# START_INDENT +def MyFunc(text: string, +separator = '-' +): string +enddef +# END_INDENT + +# START_INDENT +def MyFunc( +text: string, +separator = '-' +): string +enddef +# END_INDENT + +# START_INDENT +[var1, var2] = +Func() +# END_INDENT + +# START_INDENT +const list = ['one', +'two'] +# END_INDENT + +# START_INDENT +const list = [ +'one', +'two', +] +# END_INDENT + +# START_INDENT +const dict = {one: 1, +two: 2 +} +# END_INDENT + +# START_INDENT +const dict = { +one: 1, +two: 2 +} +# END_INDENT + +# START_INDENT +if true +const dict = +{ +one: 1, +two: 2 +} +endif +# END_INDENT + +# START_INDENT +def Func() +return { +one: 1 +} +enddef +# END_INDENT + +# START_INDENT +echo { +a: 0, +# b +# c +} +# END_INDENT + +# START_INDENT +echo search( +# comment +'1' +.. '2' +) +# END_INDENT + +# START_INDENT +if true +var v = ( # trailing "(" starts line continuation +3 + 4 # nothing special +) # end of expression indicates continued line +var x: number # needs to align with previous "var" +endif +# END_INDENT + +# START_INDENT +def Func() # {{{ +# comment +if true +return +endif +enddef +# END_INDENT + +# START_INDENT +echo { +key: +'value', +} +# END_INDENT + +# START_INDENT +var id = time +->timer_start((_) => { +n = 0 +}) +# END_INDENT + +# START_INDENT +var n = +# comment +1 ++ 2 + +var s = '' +# END_INDENT + +# START_INDENT +var keys = { +J: 'j', +"\": '1G', +"\": 'G', +z: 'zz' +} +# END_INDENT + +# START_INDENT +export def Func( +n: number, +s: string, +...l: list +) +enddef +# END_INDENT + +# START_INDENT +var heredoc =<< trim ENDD +var nested_heredoc =<< trim END +END +ENDD +# END_INDENT + +# START_INDENT +if true +else " comment +endif +# END_INDENT + +# START_INDENT +if true | echo 'one' | endif +if true | echo 'two' | endif +if true | echo 'three' | endif +# END_INDENT + +# START_INDENT +if true +:'<-1 mark < +else +echo '' +endif +# END_INDENT + +# START_INDENT +def Func() +Cmd % +enddef +# END_INDENT + +# START_INDENT +if true +popup_move(id, {col: 1, +line: 2}) +endif +setwinvar(id, 'name', 3) +# END_INDENT + +# START_INDENT +var d = [ +{a: 'x', +b: 'y'}, +FuncA(), +FuncB(), +] +# END_INDENT + +# START_INDENT +var ll = [[ +1, +2, +3], [ +4, +5, +6], [ +7, +8, +9]] +# END_INDENT + +# START_INDENT +var ld = [{ +a: 'xxx', +b: 'yyy'}, { +c: 'xxx', +d: 'yyy'}, { +e: 'xxx', +f: 'yyy'}, { +}] +# END_INDENT + +# START_INDENT +var d = { +a: { +b: { +c: [{ +d: 'e', +f: 'g', +h: 'i' +}], +j: 'k', +}, +}, +} +# END_INDENT + +# START_INDENT +if true +var end: any +if true +end = 0 +elseif true +echo +endif +endif +# END_INDENT + +# START_INDENT +if true +var d = { +end: 0} +endif +# END_INDENT + +# START_INDENT +def Func( +s: string, +n = 1, +m = 2 +) +enddef +# END_INDENT + +# START_INDENT +var h =<< END +text +END + +def Func() +echo +enddef +# END_INDENT + +# START_INDENT +def Func() +var h =<< END +text +END +echo 'test' +enddef +# END_INDENT + +# START_INDENT +def Foo() +lcd - +enddef +def Bar() +echo +enddef +# END_INDENT + +# START_INDENT +if true +n = Func(1, 2, +3) +endif +# END_INDENT + +# START_INDENT +def Func(s: string, +n: number): bool +if true +return false +endif +enddef +# END_INDENT + +# START_INDENT +def Func( +n: number) +# +echo +enddef +# END_INDENT + +# START_INDENT +# INDENT_AT this-line +def Func( + n: number) + # +echo # this-line +enddef +# END_INDENT + +# START_INDENT +if true +if true +normal! == +endif +endif +# END_INDENT + +# START_INDENT +var d = { +a: () => true, +b: () => true +&& true +&& Foo(), +c: () => Bar(), +e: () => Baz(), +} +# END_INDENT + +# START_INDENT +def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) +return (Emit: func(any)) => { +Cont((t: any) => { +if Pred(t) +Emit(t) +endif +}) +} +enddef +# END_INDENT + +# START_INDENT +# INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true} +def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) +return (Emit: func(any)) => { +Cont((t: any) => { +if Pred(t) +Emit(t) +endif +}) +} +enddef +# END_INDENT + +# START_INDENT +# INDENT_EXE unlet! g:vim_indent +# END_INDENT + +# START_INDENT +g:lightline = { +'active': { +'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ], +}, +'inactive': { +'left': [ [ 'readonly', 'relativepath', 'modified' ] ], +} +} +# END_INDENT + +# START_INDENT +if getline(1, 10) +->map((_, v: string): number => strcharlen(v)) +->max() > 1'000 +&l:breakindent = false +&l:linebreak = false +else +&l:breakindent = true +&l:linebreak = true +endif +# END_INDENT + +# START_INDENT +var ext2cmd: dict = { +doc: $'antiword {fname}', +docx: $'pandoc --from=docx --to=markdown {fname}', +epub: $'pandoc --from=epub --to=markdown {fname}', +odp: $'odt2txt {fname}', +odt: $'odt2txt {fname}', +pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -', +rtf: 'unrtf --text', +} +# END_INDENT + +# START_INDENT +const ptybuf: number = term_start(&shell, { +hidden: true, +exit_cb: (_, _) => { +if true +close +else +help +endif +} +}) +# END_INDENT + +# START_INDENT +var d = { +a: 0, +# a ' quote {{{ +#}}} +b: 0, +} +# END_INDENT + +# START_INDENT +echo printf('%s () %s', +1, +2 +) +# END_INDENT + +# START_INDENT +prop_add(1, col('.'), { +length: 2, +type: 'test' +}) +# END_INDENT + +# START_INDENT +echo (() => " string starting with space")() +echo +# END_INDENT + +# START_INDENT +var variables = deepcopy(g:) +->filter((k: string, _): bool => +k =~ '\c\V' .. keyword->escape('\') +&& k !~ '\%(loaded\|did_plugin_\)') +->items() +->map((_, v): string => v[0] .. ' = ' .. string(v[1])) +new +# END_INDENT + +# START_INDENT +var d = freq +->map((_, v) => +v * ( +1 ++ 2 +)) +for item in d +->items() +->sort((a, b) => b[1] - a[1]) +echo +endfor +# END_INDENT + +# START_INDENT +var matching_abbrev: list> = copy(ABBREV) +->filter((_, v: dict): bool => +stridx(v.lhs, word_to_complete) == 0) +->map((_, v: dict) => ({ +word: v.lhs, +menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0 +? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')') +: AbbrevRhs(v.rhs) +})) +# END_INDENT + +# START_INDENT +def Func() +if true +vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file +endif +enddef +# END_INDENT + +# START_INDENT +silent if true +echo +endif +# END_INDENT + +# START_INDENT +def Func() +sort :^.*[\/]: +enddef +# END_INDENT + +# START_INDENT +def Func() +d = { +} +hd =<< trim END +[' +]' +END +enddef +# END_INDENT + +# START_INDENT +def Func() +if true +var hd =<< trim END +if get(b:, 'current_syntax', '') +endif +END +elseif true +echo +endif +enddef +# END_INDENT + +# START_INDENT +# test for control-flow keyword followed by commented fold marker {{{ +if true +echo +endif #}}} +# END_INDENT + +# START_INDENT +if true +if true +windo if true | echo | endif +augroup Name +autocmd WinLeave * if true | eval 1 + 2 | endif +augroup END +endif +endif +# END_INDENT + +# START_INDENT +if true +echo ' =<< trim END' +->len() +endif +# END_INDENT + +# START_INDENT +function Func() +if true +if true +if true | echo com | endif +if true | echo com | endif +endif +else +endif +endfunction +# END_INDENT + +# START_INDENT +var matchpairs: string = &matchpairs +var pairs: dict> +for [opening: string, closing: string] +in matchpairs +->split(',') +->map((_, v: string): list => split(v, ':')) +pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$'] +pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0'] +endfor +# END_INDENT + +# START_INDENT +{ +echo [] ++ [] ++ [{a: 1, +b: 2}] +} +# END_INDENT + +# START_INDENT +def Foo() +Bar(1, +[]->filter((_, v) => { +return true +}), +() => { +echo +}) +enddef +# END_INDENT + +# START_INDENT +echo { +k: () => { +if true +echo +popup_setoptions(id, +{title: 'title'}) +endif +} +} +# END_INDENT + +# START_INDENT +if true +elseif +endif +# END_INDENT + +# START_INDENT +if ( +true) +&& true +echo +endif +# END_INDENT + +# START_INDENT +abstract class Shape +var color = Color.Black +var thickness = 10 +endclass +# END_INDENT + +# START_INDENT +class OtherThing +var size: number +static var totalSize: number + +static def ClearTotalSize(): number +var prev = totalSize +totalSize = 0 +return prev +enddef +endclass +# END_INDENT + +# START_INDENT +interface HasSurface +var size: number +def Surface(): number +endinterface +# END_INDENT + +# START_INDENT +interface EnterExit +def Enter(): void +def Exit(): void +endinterface +# END_INDENT + +# START_INDENT +enum Color +White, +Red, +Green, +Blue, +Black +endenum +# END_INDENT + +# START_INDENT +enum Digits +INVALID(v:numbermax), # The null value. +ZERO(0 * v:numbermin), ONE(2 - 1), +TWO(1 + 1), THREE(9 / 3), FOUR(1 * 4), +FIVE(1 + 2 + 2), SIX(36 / 3 / 2), SEVEN(7), EIGHT(2 * 2 * 2), +NINE(3 + 3 + 3) +const value: number +def new(value: number) +this.value = value +enddef +endenum +# END_INDENT diff --git a/runtime/indent/testdir/vim9.ok b/runtime/indent/testdir/vim9.ok new file mode 100644 index 0000000000..e4ba72ca10 --- /dev/null +++ b/runtime/indent/testdir/vim9.ok @@ -0,0 +1,782 @@ +vim9script +# vim: set ft=vim sw=4 : + +# START_INDENT +var result = Func( + arg1, + arg2 +) +# END_INDENT + +# START_INDENT +var result = Func(arg1, + arg2) +# END_INDENT + +# START_INDENT +filter(list, (k, v) => + v > 0) +# END_INDENT + +# START_INDENT +filter(list, (k, v) => { + const x = get(list, k, 0) + return x > 0 +}) +# END_INDENT + +# START_INDENT +if x > 0 + filter(list, (k, v) => { + const x = get(list, k, 1) + return x > 0 + }) +endif +# END_INDENT + +# START_INDENT +{ + var temp = 'temp' +} +# END_INDENT + +# START_INDENT +var text = lead + .. middle + .. end +# END_INDENT + +# START_INDENT +var text = lead .. + middle .. + end +# END_INDENT + +# START_INDENT +var total = start + + end - + correction +# END_INDENT + +# START_INDENT +var result = start +:+ print +# END_INDENT + +# START_INDENT +var result = positive + ? PosFunc(arg) + : NegFunc(arg) +# END_INDENT + +# START_INDENT +var result = GetBuilder() + ->BuilderSetWidth(333) + ->BuilderSetHeight(777) + ->BuilderBuild() +# END_INDENT + +# START_INDENT +var result = MyDict + .member +# END_INDENT + +# START_INDENT +autocmd BufNewFile *.match if condition + | echo 'match' + | endif +# END_INDENT + +# START_INDENT +set cpo+=C +var lines =<< trim END + | this works +END +set cpo-=C +# END_INDENT + +# START_INDENT +syn region Text + \ start='foo' + #\ comment + \ end='bar' +# END_INDENT + +# START_INDENT +au CursorHold * echom 'BEFORE bar' + #\ some comment + | echom 'AFTER bar' +# END_INDENT + +# START_INDENT +def MyFunc(text: string, + separator = '-' + ): string +enddef +# END_INDENT + +# START_INDENT +def MyFunc( + text: string, + separator = '-' + ): string +enddef +# END_INDENT + +# START_INDENT +[var1, var2] = + Func() +# END_INDENT + +# START_INDENT +const list = ['one', + 'two'] +# END_INDENT + +# START_INDENT +const list = [ + 'one', + 'two', +] +# END_INDENT + +# START_INDENT +const dict = {one: 1, + two: 2 +} +# END_INDENT + +# START_INDENT +const dict = { + one: 1, + two: 2 +} +# END_INDENT + +# START_INDENT +if true + const dict = + { + one: 1, + two: 2 + } +endif +# END_INDENT + +# START_INDENT +def Func() + return { + one: 1 + } +enddef +# END_INDENT + +# START_INDENT +echo { + a: 0, + # b + # c +} +# END_INDENT + +# START_INDENT +echo search( + # comment + '1' + .. '2' +) +# END_INDENT + +# START_INDENT +if true + var v = ( # trailing "(" starts line continuation + 3 + 4 # nothing special + ) # end of expression indicates continued line + var x: number # needs to align with previous "var" +endif +# END_INDENT + +# START_INDENT +def Func() # {{{ + # comment + if true + return + endif +enddef +# END_INDENT + +# START_INDENT +echo { + key: + 'value', +} +# END_INDENT + +# START_INDENT +var id = time + ->timer_start((_) => { + n = 0 + }) +# END_INDENT + +# START_INDENT +var n = + # comment + 1 + + 2 + +var s = '' +# END_INDENT + +# START_INDENT +var keys = { + J: 'j', + "\": '1G', + "\": 'G', + z: 'zz' +} +# END_INDENT + +# START_INDENT +export def Func( + n: number, + s: string, + ...l: list + ) +enddef +# END_INDENT + +# START_INDENT +var heredoc =<< trim ENDD + var nested_heredoc =<< trim END + END +ENDD +# END_INDENT + +# START_INDENT +if true +else " comment +endif +# END_INDENT + +# START_INDENT +if true | echo 'one' | endif +if true | echo 'two' | endif +if true | echo 'three' | endif +# END_INDENT + +# START_INDENT +if true + :'<-1 mark < +else + echo '' +endif +# END_INDENT + +# START_INDENT +def Func() + Cmd % +enddef +# END_INDENT + +# START_INDENT +if true + popup_move(id, {col: 1, + line: 2}) +endif +setwinvar(id, 'name', 3) +# END_INDENT + +# START_INDENT +var d = [ + {a: 'x', + b: 'y'}, + FuncA(), + FuncB(), +] +# END_INDENT + +# START_INDENT +var ll = [[ + 1, + 2, + 3], [ + 4, + 5, + 6], [ + 7, + 8, + 9]] +# END_INDENT + +# START_INDENT +var ld = [{ + a: 'xxx', + b: 'yyy'}, { + c: 'xxx', + d: 'yyy'}, { + e: 'xxx', + f: 'yyy'}, { + }] +# END_INDENT + +# START_INDENT +var d = { + a: { + b: { + c: [{ + d: 'e', + f: 'g', + h: 'i' + }], + j: 'k', + }, + }, +} +# END_INDENT + +# START_INDENT +if true + var end: any + if true + end = 0 + elseif true + echo + endif +endif +# END_INDENT + +# START_INDENT +if true + var d = { + end: 0} +endif +# END_INDENT + +# START_INDENT +def Func( + s: string, + n = 1, + m = 2 + ) +enddef +# END_INDENT + +# START_INDENT +var h =<< END +text +END + +def Func() + echo +enddef +# END_INDENT + +# START_INDENT +def Func() + var h =<< END +text +END + echo 'test' +enddef +# END_INDENT + +# START_INDENT +def Foo() + lcd - +enddef +def Bar() + echo +enddef +# END_INDENT + +# START_INDENT +if true + n = Func(1, 2, + 3) +endif +# END_INDENT + +# START_INDENT +def Func(s: string, + n: number): bool + if true + return false + endif +enddef +# END_INDENT + +# START_INDENT +def Func( + n: number) + # + echo +enddef +# END_INDENT + +# START_INDENT +# INDENT_AT this-line +def Func( + n: number) + # + echo # this-line +enddef +# END_INDENT + +# START_INDENT +if true + if true + normal! == + endif +endif +# END_INDENT + +# START_INDENT +var d = { + a: () => true, + b: () => true + && true + && Foo(), + c: () => Bar(), + e: () => Baz(), +} +# END_INDENT + +# START_INDENT +def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) + return (Emit: func(any)) => { + Cont((t: any) => { + if Pred(t) + Emit(t) + endif + }) + } +enddef +# END_INDENT + +# START_INDENT +# INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true} +def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) + return (Emit: func(any)) => { + Cont((t: any) => { + if Pred(t) + Emit(t) + endif + }) + } +enddef +# END_INDENT + +# START_INDENT +# INDENT_EXE unlet! g:vim_indent +# END_INDENT + +# START_INDENT +g:lightline = { + 'active': { + 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ], + }, + 'inactive': { + 'left': [ [ 'readonly', 'relativepath', 'modified' ] ], + } +} +# END_INDENT + +# START_INDENT +if getline(1, 10) + ->map((_, v: string): number => strcharlen(v)) + ->max() > 1'000 + &l:breakindent = false + &l:linebreak = false +else + &l:breakindent = true + &l:linebreak = true +endif +# END_INDENT + +# START_INDENT +var ext2cmd: dict = { + doc: $'antiword {fname}', + docx: $'pandoc --from=docx --to=markdown {fname}', + epub: $'pandoc --from=epub --to=markdown {fname}', + odp: $'odt2txt {fname}', + odt: $'odt2txt {fname}', + pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -', + rtf: 'unrtf --text', +} +# END_INDENT + +# START_INDENT +const ptybuf: number = term_start(&shell, { + hidden: true, + exit_cb: (_, _) => { + if true + close + else + help + endif + } +}) +# END_INDENT + +# START_INDENT +var d = { + a: 0, + # a ' quote {{{ + #}}} + b: 0, +} +# END_INDENT + +# START_INDENT +echo printf('%s () %s', + 1, + 2 +) +# END_INDENT + +# START_INDENT +prop_add(1, col('.'), { + length: 2, + type: 'test' +}) +# END_INDENT + +# START_INDENT +echo (() => " string starting with space")() +echo +# END_INDENT + +# START_INDENT +var variables = deepcopy(g:) + ->filter((k: string, _): bool => + k =~ '\c\V' .. keyword->escape('\') + && k !~ '\%(loaded\|did_plugin_\)') + ->items() + ->map((_, v): string => v[0] .. ' = ' .. string(v[1])) +new +# END_INDENT + +# START_INDENT +var d = freq + ->map((_, v) => + v * ( + 1 + + 2 + )) +for item in d + ->items() + ->sort((a, b) => b[1] - a[1]) + echo +endfor +# END_INDENT + +# START_INDENT +var matching_abbrev: list> = copy(ABBREV) + ->filter((_, v: dict): bool => + stridx(v.lhs, word_to_complete) == 0) + ->map((_, v: dict) => ({ + word: v.lhs, + menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0 + ? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')') + : AbbrevRhs(v.rhs) + })) +# END_INDENT + +# START_INDENT +def Func() + if true + vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file + endif +enddef +# END_INDENT + +# START_INDENT +silent if true + echo +endif +# END_INDENT + +# START_INDENT +def Func() + sort :^.*[\/]: +enddef +# END_INDENT + +# START_INDENT +def Func() + d = { + } + hd =<< trim END + [' + ]' + END +enddef +# END_INDENT + +# START_INDENT +def Func() + if true + var hd =<< trim END + if get(b:, 'current_syntax', '') + endif + END + elseif true + echo + endif +enddef +# END_INDENT + +# START_INDENT +# test for control-flow keyword followed by commented fold marker {{{ +if true + echo +endif #}}} +# END_INDENT + +# START_INDENT +if true + if true + windo if true | echo | endif + augroup Name + autocmd WinLeave * if true | eval 1 + 2 | endif + augroup END + endif +endif +# END_INDENT + +# START_INDENT +if true + echo ' =<< trim END' + ->len() +endif +# END_INDENT + +# START_INDENT +function Func() + if true + if true + if true | echo com | endif + if true | echo com | endif + endif + else + endif +endfunction +# END_INDENT + +# START_INDENT +var matchpairs: string = &matchpairs +var pairs: dict> +for [opening: string, closing: string] + in matchpairs + ->split(',') + ->map((_, v: string): list => split(v, ':')) + pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$'] + pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0'] +endfor +# END_INDENT + +# START_INDENT +{ + echo [] + + [] + + [{a: 1, + b: 2}] +} +# END_INDENT + +# START_INDENT +def Foo() + Bar(1, + []->filter((_, v) => { + return true + }), + () => { + echo + }) +enddef +# END_INDENT + +# START_INDENT +echo { + k: () => { + if true + echo + popup_setoptions(id, + {title: 'title'}) + endif + } +} +# END_INDENT + +# START_INDENT +if true +elseif +endif +# END_INDENT + +# START_INDENT +if ( + true) + && true + echo +endif +# END_INDENT + +# START_INDENT +abstract class Shape + var color = Color.Black + var thickness = 10 +endclass +# END_INDENT + +# START_INDENT +class OtherThing + var size: number + static var totalSize: number + + static def ClearTotalSize(): number + var prev = totalSize + totalSize = 0 + return prev + enddef +endclass +# END_INDENT + +# START_INDENT +interface HasSurface + var size: number + def Surface(): number +endinterface +# END_INDENT + +# START_INDENT +interface EnterExit + def Enter(): void + def Exit(): void +endinterface +# END_INDENT + +# START_INDENT +enum Color + White, + Red, + Green, + Blue, + Black +endenum +# END_INDENT + +# START_INDENT +enum Digits + INVALID(v:numbermax), # The null value. + ZERO(0 * v:numbermin), ONE(2 - 1), + TWO(1 + 1), THREE(9 / 3), FOUR(1 * 4), + FIVE(1 + 2 + 2), SIX(36 / 3 / 2), SEVEN(7), EIGHT(2 * 2 * 2), + NINE(3 + 3 + 3) + const value: number + def new(value: number) + this.value = value + enddef +endenum +# END_INDENT From 30377e0fe084496911e108cbb33c84cf075e6e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denilson=20S=C3=A1=20Maia?= Date: Mon, 13 Jan 2025 08:23:24 +0100 Subject: [PATCH 19/93] runtime(lyrics): support milliseconds in syntax script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following tool creates LRC files using three fractional digits after the seconds (i.e. milliseconds). References: https://github.com/magic-akari/lrc-maker https://lrc-maker.github.io/ closes: #16436 Signed-off-by: Denilson Sá Maia Signed-off-by: ObserverOfTime Signed-off-by: Christian Brabandt --- runtime/syntax/lyrics.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/syntax/lyrics.vim b/runtime/syntax/lyrics.vim index fd127988f2..48a5b1171c 100644 --- a/runtime/syntax/lyrics.vim +++ b/runtime/syntax/lyrics.vim @@ -2,7 +2,7 @@ " Language: LyRiCs " Maintainer: ObserverOfTime " Filenames: *.lrc -" Last Change: 2024 Sep 20 +" Last Change: 2025 Jan 13 if exists('b:current_syntax') finish @@ -23,7 +23,7 @@ syn match lrcTagName contained nextgroup=lrcTagValue syn match lrcTagValue /:\zs.\+\ze\]/ contained " Lyrics -syn match lrcLyricTime /^\s*\(\[\d\d:\d\d\.\d\d\]\)\+/ +syn match lrcLyricTime /^\s*\(\[\d\d:\d\d\.\d\d\d\?\]\)\+/ \ contains=lrcNumber nextgroup=lrcLyricLine syn match lrcLyricLine /.*$/ contained contains=lrcWordTime,@Spell syn match lrcWordTime /<\d\d:\d\d\.\d\d>/ contained contains=lrcNumber,@NoSpell From 6289f9159102e0855bedc566636b5e7ca6ced72c Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Tue, 14 Jan 2025 17:13:36 +0100 Subject: [PATCH 20/93] patch 9.1.1013: Vim9: Regression caused by patch v9.1.0646 Problem: Vim9: Regression caused by patch v9.1.0646 Solution: Translate the function name before invoking it in call() (Yegappan Lakshmanan) fixes: #16430 closes: #16445 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/evalfunc.c | 27 +++++--------- src/option.c | 30 ++++++++++++---- src/testdir/test_user_func.vim | 2 +- src/testdir/test_vim9_builtin.vim | 2 +- src/testdir/test_vim9_disassemble.vim | 22 ++++++++++++ src/testdir/test_vim9_func.vim | 41 +++++++++++++++++++++ src/userfunc.c | 52 +-------------------------- src/version.c | 2 ++ 8 files changed, 100 insertions(+), 78 deletions(-) diff --git a/src/evalfunc.c b/src/evalfunc.c index d81480b509..ef30792ad1 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -3739,7 +3739,6 @@ f_call(typval_T *argvars, typval_T *rettv) char_u *func; partial_T *partial = NULL; dict_T *selfdict = NULL; - char_u *dot; char_u *tofree = NULL; if (in_vim9script() @@ -3765,36 +3764,26 @@ f_call(typval_T *argvars, typval_T *rettv) if (func == NULL || *func == NUL) return; // type error, empty name or null function - dot = vim_strchr(func, '.'); - if (dot != NULL) + char_u *p = func; + tofree = trans_function_name(&p, NULL, FALSE, TFN_INT|TFN_QUIET); + if (tofree == NULL) { - imported_T *import = find_imported(func, dot - func, TRUE); - - if (import != NULL && SCRIPT_ID_VALID(import->imp_sid)) - { - scriptitem_T *si = SCRIPT_ITEM(import->imp_sid); - - if (si->sn_autoload_prefix != NULL) - { - // Turn "import.Func" into "scriptname#Func". - tofree = concat_str(si->sn_autoload_prefix, dot + 1); - if (tofree == NULL) - return; - func = tofree; - } - } + emsg_funcname(e_unknown_function_str, func); + return; } + func = tofree; if (argvars[2].v_type != VAR_UNKNOWN) { if (check_for_dict_arg(argvars, 2) == FAIL) - return; + goto done; selfdict = argvars[2].vval.v_dict; } (void)func_call(func, &argvars[1], partial, selfdict, rettv); +done: vim_free(tofree); } diff --git a/src/option.c b/src/option.c index 52f9969753..653b87cae2 100644 --- a/src/option.c +++ b/src/option.c @@ -8786,15 +8786,33 @@ option_set_callback_func(char_u *optval UNUSED, callback_T *optcb UNUSED) vim_free(cb.cb_name); free_tv(tv); - if (in_vim9script() && funcname && (vim_strchr(optval, '.') != NULL)) + char_u *dot = NULL; + if (in_vim9script() && funcname + && ((dot = vim_strchr(optval, '.')) != NULL)) { - // When a Vim9 imported function name is used, it is expanded by the - // call to get_callback() above to _funcname. Revert the name to - // back to "import.funcname". if (optcb->cb_free_name) vim_free(optcb->cb_name); - optcb->cb_name = vim_strsave(optval); - optcb->cb_free_name = TRUE; + + imported_T *import = find_imported(optval, dot - optval, FALSE); + if (import != NULL && SCRIPT_ID_VALID(import->imp_sid) + && !(import->imp_flags & IMP_FLAGS_AUTOLOAD)) + { + char_u fnamebuf[MAX_FUNC_NAME_LEN]; + + // Imported non-autoloaded function. Replace the import script + // name (import.funcname) with the script ID (123_funcname) + vim_snprintf((char *)fnamebuf, sizeof(fnamebuf), "%d_%s", + import->imp_sid, dot + 1); + optcb->cb_name = vim_strsave(fnamebuf); + optcb->cb_free_name = TRUE; + } + else + { + // Imported autoloaded function. Store the function name as + // "import.funcname". + optcb->cb_name = vim_strsave(optval); + optcb->cb_free_name = TRUE; + } } // when using Vim9 style "import.funcname" it needs to be expanded to // "import#funcname". diff --git a/src/testdir/test_user_func.vim b/src/testdir/test_user_func.vim index 992329bc72..99ac90662c 100644 --- a/src/testdir/test_user_func.vim +++ b/src/testdir/test_user_func.vim @@ -427,7 +427,7 @@ func Test_script_local_func() " Try to call a script local function in global scope let lines =<< trim [CODE] :call assert_fails('call s:Xfunc()', 'E81:') - :call assert_fails('let x = call("Xfunc", [])', 'E120:') + :call assert_fails('let x = call("Xfunc", [])', ['E81:', 'E117:']) :call writefile(v:errors, 'Xresult') :qall diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 6103453a24..c82608b465 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -540,7 +540,7 @@ def Test_call_imports() const Imported = i_imp.Imported const foo = i_imp.foo - assert_fails('call("i_imp.foo", [])', 'E117:') # foo is not a function + assert_fails('call("i_imp.foo", [])', ['E46:', 'E117:']) # foo is not a function assert_fails('call("foo", [])', 'E117:') # foo is not a function assert_fails('call("i_xxx.foo", [])', 'E117:') # i_xxx not imported file END diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim index 2dc925a353..b4e25c39aa 100644 --- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -3611,4 +3611,26 @@ def Test_disassemble_interface_variable_access() unlet g:instr enddef +" Disassemble the code generated for accessing a script-local funcref +def Test_disassemble_using_script_local_funcref() + var lines =<< trim END + vim9script + def Noop() + enddef + export var Setup = Noop + export def Run() + Setup() + enddef + g:instr = execute('disassemble Run') + END + v9.CheckScriptSuccess(lines) + assert_match('\d\+_Run\_s*' .. + 'Setup()\_s*' .. + '0 LOADSCRIPT Setup-0 from .*\_s*' .. + '1 PCALL (argc 0)\_s*' .. + '2 DROP\_s*' .. + '3 RETURN void\_s*', g:instr) + unlet g:instr +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 4188f82e5d..38832e99d6 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -4714,6 +4714,47 @@ def Test_comment_after_inner_block() v9.CheckScriptSuccess(lines) enddef +" Test for calling an imported funcref which is modified in the current script +def Test_call_modified_import_func() + var lines =<< trim END + vim9script + + export var done = 0 + + def Noop() + enddef + + export var Setup = Noop + + export def Run() + done = 0 + Setup() + done += 1 + enddef + END + writefile(lines, 'XcallModifiedImportFunc.vim', 'D') + + lines =<< trim END + vim9script + + import './XcallModifiedImportFunc.vim' as imp + + var setup = 0 + + imp.Run() + + imp.Setup = () => { + ++setup + } + + imp.Run() + + assert_equal(1, setup) + assert_equal(1, imp.done) + END + v9.CheckScriptSuccess(lines) +enddef + " The following messes up syntax highlight, keep near the end. if has('python3') def Test_python3_command() diff --git a/src/userfunc.c b/src/userfunc.c index b4ee0a2675..06be445af7 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -2308,49 +2308,6 @@ find_func_with_prefix(char_u *name, int sid) return NULL; } -/* - * Find a function by name, return pointer to it. - * The name may be a local script variable, VAR_FUNC. or it may be a fully - * qualified import name such as 'i_imp.FuncName'. - * - * When VAR_FUNC, the import might either direct or autoload. - * When 'i_imp.FuncName' it is direct, autoload is rewritten as i_imp#FuncName - * in f_call and subsequently found. - */ - static ufunc_T * -find_func_imported(char_u *name, int flags) -{ - ufunc_T *func = NULL; - char_u *dot = name; // Find a dot, '.', in the name - - // Either run into '.' or the end of the string - while (eval_isnamec(*dot)) - ++dot; - - if (*dot == '.') - { - imported_T *import = find_imported(name, dot - name, FALSE); - if (import != NULL) - func = find_func_with_sid(dot + 1, import->imp_sid); - } - else if (*dot == NUL) // looking at the entire string - { - hashtab_T *ht = get_script_local_ht(); - if (ht != NULL) - { - hashitem_T *hi = hash_find(ht, name); - if (!HASHITEM_EMPTY(hi)) - { - dictitem_T *di = HI2DI(hi); - if (di->di_tv.v_type == VAR_FUNC - && di->di_tv.vval.v_string != NULL) - func = find_func_even_dead(di->di_tv.vval.v_string, flags); - } - } - } - return func; -} - /* * Find a function by name, return pointer to it in ufuncs. * When "flags" has FFED_IS_GLOBAL don't find script-local or imported @@ -2400,15 +2357,8 @@ find_func_even_dead(char_u *name, int flags) } // Find autoload function if this is an autoload script. - func = find_func_with_prefix(name[0] == 's' && name[1] == ':' + return find_func_with_prefix(name[0] == 's' && name[1] == ':' ? name + 2 : name, current_sctx.sc_sid); - if (func != NULL) - return func; - - // Find a script-local "VAR_FUNC" or i_"imp.Func", so vim9script). - if (in_vim9script()) - func = find_func_imported(name, flags); - return func; } /* diff --git a/src/version.c b/src/version.c index 9dddabc05a..2cf4f46978 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1013, /**/ 1012, /**/ From 045564d0a73218594691953c0c8bf2035e1e176e Mon Sep 17 00:00:00 2001 From: Maxim Kim Date: Tue, 14 Jan 2025 17:15:59 +0100 Subject: [PATCH 21/93] runtime(colors): Update colorschemes, include new unokai colorscheme - new unokai colorscheme (similar/inspired by monokai) - the rest: add explicit PopupSelected link to PmenuSel closes: #16443 Signed-off-by: Maxim Kim Signed-off-by: Christian Brabandt --- runtime/colors/blue.vim | 6 +- runtime/colors/darkblue.vim | 4 +- runtime/colors/delek.vim | 4 +- runtime/colors/desert.vim | 4 +- runtime/colors/evening.vim | 5 +- runtime/colors/habamax.vim | 4 +- runtime/colors/industry.vim | 5 +- runtime/colors/lunaperche.vim | 4 +- runtime/colors/morning.vim | 4 +- runtime/colors/murphy.vim | 4 +- runtime/colors/pablo.vim | 4 +- runtime/colors/peachpuff.vim | 4 +- runtime/colors/quiet.vim | 3 +- runtime/colors/retrobox.vim | 3 +- runtime/colors/shine.vim | 4 +- runtime/colors/slate.vim | 4 +- runtime/colors/sorbet.vim | 3 +- runtime/colors/torte.vim | 4 +- runtime/colors/unokai.vim | 521 ++++++++++++++++++++++++++++++++++ runtime/colors/wildcharm.vim | 4 +- runtime/colors/zaibatsu.vim | 6 +- runtime/colors/zellner.vim | 4 +- 22 files changed, 587 insertions(+), 21 deletions(-) create mode 100644 runtime/colors/unokai.vim diff --git a/runtime/colors/blue.vim b/runtime/colors/blue.vim index aafa8e9fa5..5b40feb725 100644 --- a/runtime/colors/blue.vim +++ b/runtime/colors/blue.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Steven Vertigan " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -77,6 +77,7 @@ hi Type guifg=#ffa500 guibg=NONE gui=bold cterm=NONE hi Underlined guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline hi Label guifg=#ffd700 guibg=NONE gui=NONE cterm=NONE hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg @@ -189,6 +190,7 @@ if s:t_Co >= 256 hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline hi Label ctermfg=220 ctermbg=NONE cterm=NONE hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg @@ -304,6 +306,7 @@ if s:t_Co >= 16 hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline hi Label ctermfg=yellow ctermbg=NONE cterm=NONE hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg @@ -418,6 +421,7 @@ if s:t_Co >= 8 hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline hi Label ctermfg=yellow ctermbg=NONE cterm=NONE hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link Debug Special hi! link Added String hi! link Removed WarningMsg diff --git a/runtime/colors/darkblue.vim b/runtime/colors/darkblue.vim index 3a0a218d28..de56d8be78 100644 --- a/runtime/colors/darkblue.vim +++ b/runtime/colors/darkblue.vim @@ -4,7 +4,7 @@ " Maintainer: Original author Bohdan Vlasyuk " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -19,6 +19,7 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_ansi_colors = ['#000000', '#8b0000', '#90f020', '#ffa500', '#00008b', '#8b008b', '#008b8b', '#c0c0c0', '#808080', '#ffa0a0', '#90f020', '#ffff60', '#0030ff', '#ff00ff', '#90fff0', '#ffffff'] endif hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link CursorColumn CursorLine hi! link CursorIM Cursor hi! link EndOfBuffer NonText @@ -129,6 +130,7 @@ hi DiffDelete guifg=#ffffff guibg=#af5faf gui=NONE cterm=NONE if s:t_Co >= 256 hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link CursorColumn CursorLine hi! link CursorIM Cursor hi! link EndOfBuffer NonText diff --git a/runtime/colors/delek.vim b/runtime/colors/delek.vim index c06fda215c..6edd128c86 100644 --- a/runtime/colors/delek.vim +++ b/runtime/colors/delek.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer David Schweikert " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -19,6 +19,7 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_ansi_colors = ['#ffffff', '#0000ff', '#00cd00', '#cd00cd', '#008b8b', '#0000ff', '#ff1493', '#bcbcbc', '#ee0000', '#0000ff', '#00cd00', '#cd00cd', '#008b8b', '#0000ff', '#ff1493', '#000000'] endif hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search @@ -95,6 +96,7 @@ hi DiffDelete guifg=#ffffff guibg=#af5faf gui=NONE cterm=NONE if s:t_Co >= 256 hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search diff --git a/runtime/colors/desert.vim b/runtime/colors/desert.vim index 4c3446832b..a3efbd8fa7 100644 --- a/runtime/colors/desert.vim +++ b/runtime/colors/desert.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Hans Fugal " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -27,6 +27,7 @@ hi! link CursorLineSign CursorLine hi! link EndOfBuffer NonText hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#ffffff guibg=#333333 gui=NONE cterm=NONE hi StatusLine guifg=#333333 guibg=#c2bfa5 gui=NONE cterm=NONE hi StatusLineNC guifg=#7f7f8c guibg=#c2bfa5 gui=NONE cterm=NONE @@ -103,6 +104,7 @@ if s:t_Co >= 256 hi! link EndOfBuffer NonText hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=231 ctermbg=236 cterm=NONE hi StatusLine ctermfg=236 ctermbg=144 cterm=NONE hi StatusLineNC ctermfg=242 ctermbg=144 cterm=NONE diff --git a/runtime/colors/evening.vim b/runtime/colors/evening.vim index 7ea265d310..e7c640f7da 100644 --- a/runtime/colors/evening.vim +++ b/runtime/colors/evening.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Steven Vertigan " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -19,6 +19,7 @@ if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_ansi_colors = ['#000000', '#cd0000', '#00cd00', '#cdcd00', '#0087ff', '#cd00cd', '#00cdcd', '#e5e5e5', '#7f7f7f', '#ff0000', '#00ff00', '#ffff00', '#5c5cff', '#ff00ff', '#00ffff', '#ffffff'] endif hi! link VertSplit StatusLineNC +hi! link PopupSelected PmenuSel hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link TabLineFill TabLine @@ -129,6 +130,7 @@ hi DiffDelete guifg=#ffffff guibg=#af5faf gui=NONE cterm=NONE if s:t_Co >= 256 hi! link VertSplit StatusLineNC + hi! link PopupSelected PmenuSel hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link TabLineFill TabLine @@ -242,6 +244,7 @@ endif if s:t_Co >= 16 hi! link VertSplit StatusLineNC + hi! link PopupSelected PmenuSel hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link TabLineFill TabLine diff --git a/runtime/colors/habamax.vim b/runtime/colors/habamax.vim index a9cbf524e2..b840c3d64b 100644 --- a/runtime/colors/habamax.vim +++ b/runtime/colors/habamax.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -22,6 +22,7 @@ hi! link Terminal Normal hi! link StatuslineTerm Statusline hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu +hi! link PopupSelected PmenuSel hi! link javaScriptFunction Statement hi! link javaScriptIdentifier Statement hi! link sqlKeyword Statement @@ -117,6 +118,7 @@ if s:t_Co >= 256 hi! link StatuslineTerm Statusline hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu + hi! link PopupSelected PmenuSel hi! link javaScriptFunction Statement hi! link javaScriptIdentifier Statement hi! link sqlKeyword Statement diff --git a/runtime/colors/industry.vim b/runtime/colors/industry.vim index 71ef4cedf1..29a4c4012e 100644 --- a/runtime/colors/industry.vim +++ b/runtime/colors/industry.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Shian Lee. " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -81,6 +81,7 @@ hi Conceal guifg=#6c6c6c guibg=NONE gui=NONE cterm=NONE hi Ignore guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE hi Title guifg=#ff00ff guibg=NONE gui=bold cterm=bold hi! link Terminal Normal +hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search @@ -157,6 +158,7 @@ if s:t_Co >= 256 hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE hi Title ctermfg=201 ctermbg=NONE cterm=bold hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search @@ -236,6 +238,7 @@ if s:t_Co >= 16 hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE hi Title ctermfg=magenta ctermbg=NONE cterm=bold hi! link Terminal Normal + hi! link PopupSelected PmenuSel hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link CurSearch Search diff --git a/runtime/colors/lunaperche.vim b/runtime/colors/lunaperche.vim index 5ccba2d812..a6536da8f7 100644 --- a/runtime/colors/lunaperche.vim +++ b/runtime/colors/lunaperche.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim " Website: https://www.github.com/vim/colorschemes " License: Vim License (see `:help license`) -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -92,6 +92,7 @@ hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel if &background ==# 'dark' if (has('termguicolors') && &termguicolors) || has('gui_running') let g:terminal_ansi_colors = ['#000000', '#af5f5f', '#5faf5f', '#af875f', '#5f87af', '#d787d7', '#5fafaf', '#c6c6c6', '#767676', '#ff5f5f', '#5fd75f', '#ffd787', '#5fafff', '#ff87ff', '#5fd7d7', '#ffffff'] @@ -360,6 +361,7 @@ if s:t_Co >= 256 hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel if &background ==# 'dark' hi Normal ctermfg=251 ctermbg=16 cterm=NONE hi Statusline ctermfg=251 ctermbg=16 cterm=bold,reverse diff --git a/runtime/colors/morning.vim b/runtime/colors/morning.vim index bd62d0c63f..3cdf41614e 100644 --- a/runtime/colors/morning.vim +++ b/runtime/colors/morning.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Bram Moolenaar " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -28,6 +28,7 @@ hi! link StatuslineTerm Statusline hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#e4e4e4 gui=NONE cterm=NONE hi EndOfBuffer guifg=#0000ff guibg=#cccccc gui=bold cterm=bold hi Folded guifg=#00008b guibg=#d3d3d3 gui=NONE cterm=NONE @@ -102,6 +103,7 @@ if s:t_Co >= 256 hi! link StatuslineTermNC StatuslineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=254 cterm=NONE hi EndOfBuffer ctermfg=21 ctermbg=252 cterm=bold hi Folded ctermfg=18 ctermbg=252 cterm=NONE diff --git a/runtime/colors/murphy.vim b/runtime/colors/murphy.vim index 6cdbd6e04a..7ade6689a6 100644 --- a/runtime/colors/murphy.vim +++ b/runtime/colors/murphy.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Ron Aaron . " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -28,6 +28,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link Added Constant hi Normal guifg=#87ff87 guibg=#000000 gui=NONE cterm=NONE hi EndOfBuffer guifg=#0000ff guibg=#000000 gui=NONE cterm=NONE @@ -103,6 +104,7 @@ if s:t_Co >= 256 hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi! link Added Constant hi Normal ctermfg=120 ctermbg=16 cterm=NONE hi EndOfBuffer ctermfg=21 ctermbg=16 cterm=NONE diff --git a/runtime/colors/pablo.vim b/runtime/colors/pablo.vim index 22bf377490..777698df69 100644 --- a/runtime/colors/pablo.vim +++ b/runtime/colors/pablo.vim @@ -3,7 +3,7 @@ " Maintainer: Original maintainerRon Aaron " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -25,6 +25,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#ffffff guibg=#000000 gui=NONE cterm=NONE hi Comment guifg=#808080 guibg=NONE gui=NONE cterm=NONE hi Constant guifg=#00ffff guibg=NONE gui=NONE cterm=NONE @@ -100,6 +101,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=231 ctermbg=16 cterm=NONE hi Comment ctermfg=244 ctermbg=NONE cterm=NONE hi Constant ctermfg=51 ctermbg=NONE cterm=NONE diff --git a/runtime/colors/peachpuff.vim b/runtime/colors/peachpuff.vim index bc485c49b2..f08a93ba88 100644 --- a/runtime/colors/peachpuff.vim +++ b/runtime/colors/peachpuff.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer David Ne\v{c}as (Yeti) " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -26,6 +26,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#ffdab9 gui=NONE cterm=NONE hi Folded guifg=#000000 guibg=#e3c1a5 gui=NONE cterm=NONE hi CursorLine guifg=NONE guibg=#f5c195 gui=NONE cterm=NONE @@ -100,6 +101,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=223 cterm=NONE hi Folded ctermfg=16 ctermbg=252 cterm=NONE hi CursorLine ctermfg=NONE ctermbg=180 cterm=NONE diff --git a/runtime/colors/quiet.vim b/runtime/colors/quiet.vim index 83ef067f46..687221e38b 100644 --- a/runtime/colors/quiet.vim +++ b/runtime/colors/quiet.vim @@ -4,7 +4,7 @@ " Maintainer: Maxence Weynans " Website: https://github.com/vim/colorschemes " License: Vim License (see `:help license`)` -" Last Change: 2024 Aug 05 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -21,6 +21,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement diff --git a/runtime/colors/retrobox.vim b/runtime/colors/retrobox.vim index fb982c2470..e848d5aabb 100644 --- a/runtime/colors/retrobox.vim +++ b/runtime/colors/retrobox.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim , ported from gruvbox8 of Lifepillar " Website: https://www.github.com/vim/colorschemes " License: Vim License (see `:help license`) -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -21,6 +21,7 @@ hi! link Tag Special hi! link lCursor Cursor hi! link MessageWindow PMenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link CurSearch IncSearch hi! link Terminal Normal diff --git a/runtime/colors/shine.vim b/runtime/colors/shine.vim index 58e73781e0..f00e34f5df 100644 --- a/runtime/colors/shine.vim +++ b/runtime/colors/shine.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer is Yasuhiro Matsumoto " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -30,6 +30,7 @@ hi! link Tag Special hi! link Operator Statement hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#ffffff gui=NONE cterm=NONE hi Folded guifg=#00008b guibg=#dadada gui=NONE cterm=NONE hi CursorLine guifg=NONE guibg=#dadada gui=NONE cterm=NONE @@ -110,6 +111,7 @@ if s:t_Co >= 256 hi! link Operator Statement hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=231 cterm=NONE hi Folded ctermfg=18 ctermbg=253 cterm=NONE hi CursorLine ctermfg=NONE ctermbg=253 cterm=NONE diff --git a/runtime/colors/slate.vim b/runtime/colors/slate.vim index b63a5fbab6..f7ce591f9b 100644 --- a/runtime/colors/slate.vim +++ b/runtime/colors/slate.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Ralph Amissah " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -26,6 +26,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#ffffff guibg=#262626 gui=NONE cterm=NONE hi EndOfBuffer guifg=#5f87d7 guibg=NONE gui=NONE cterm=NONE hi StatusLine guifg=#000000 guibg=#afaf87 gui=NONE cterm=NONE @@ -105,6 +106,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=231 ctermbg=235 cterm=NONE hi EndOfBuffer ctermfg=68 ctermbg=NONE cterm=NONE hi StatusLine ctermfg=16 ctermbg=144 cterm=NONE diff --git a/runtime/colors/sorbet.vim b/runtime/colors/sorbet.vim index eca239e6b9..c586baec35 100644 --- a/runtime/colors/sorbet.vim +++ b/runtime/colors/sorbet.vim @@ -4,7 +4,7 @@ " Maintainer: Maxence Weynans " Website: https://github.com/vim/colorschemes " License: Vim License (see `:help license`)` -" Last Change: 2024 Aug 05 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -20,6 +20,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement diff --git a/runtime/colors/torte.vim b/runtime/colors/torte.vim index 516f91687f..7526109027 100644 --- a/runtime/colors/torte.vim +++ b/runtime/colors/torte.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Thorsten Maerz " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -28,6 +28,7 @@ hi! link StatusLineTerm StatusLine hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#cccccc guibg=#000000 gui=NONE cterm=NONE hi Comment guifg=#80a0ff guibg=NONE gui=NONE cterm=NONE hi Constant guifg=#ffa0a0 guibg=NONE gui=NONE cterm=NONE @@ -103,6 +104,7 @@ if s:t_Co >= 256 hi! link StatusLineTermNC StatusLineNC hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=251 ctermbg=16 cterm=NONE hi Comment ctermfg=111 ctermbg=NONE cterm=NONE hi Constant ctermfg=217 ctermbg=NONE cterm=NONE diff --git a/runtime/colors/unokai.vim b/runtime/colors/unokai.vim new file mode 100644 index 0000000000..8addefcc52 --- /dev/null +++ b/runtime/colors/unokai.vim @@ -0,0 +1,521 @@ +" Name: unokai +" Description: Color scheme similar to Monokai originally created by Wimer Hazenberg for TextMate +" Author: k-37 <60838818+k-37@users.noreply.github.com> +" Maintainer: k-37 <60838818+k-37@users.noreply.github.com> +" Website: https://github.com/vim/colorschemes +" License: Vim License (see `:help license`) +" Last Change: 2024 Dec 15 + +" Generated by Colortemplate v2.2.3 + +set background=dark + +hi clear +let g:colors_name = 'unokai' + +let s:t_Co = has('gui_running') ? -1 : (&t_Co ?? 0) +let s:italics = has('gui_running') || (&t_ZH != '' && &t_ZH != '' && !has('win32')) + +if (has('termguicolors') && &termguicolors) || has('gui_running') + let g:terminal_ansi_colors = ['#282923', '#c61e5c', '#81af24', '#fd971f', '#51aebe', '#ae81ff', '#80beb5', '#bababa', '#74705d', '#f92672', '#a6e22e', '#e6db74', '#66d9ef', '#fd5ff0', '#a1efe4', '#f8f8f2'] +endif +hi! link CursorLineFold FoldColumn +hi! link CursorLineSign SignColumn +hi! link MessageWindow Pmenu +hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel +hi! link StatusLineTerm StatusLine +hi! link StatusLineTermNC StatusLineNC +hi! link Terminal Normal +hi! link Delimiter PreProc +hi! link Operator PreProc +hi! link StorageClass PreProc +hi! link Structure PreProc +hi! link Define Identifier +hi! link Label String +hi! link markdownCode Comment +hi! link markdownCodeBlock markdownCode +hi! link markdownCodeDelimiter markdownCode +hi Normal guifg=#f8f8f2 guibg=#282923 gui=NONE cterm=NONE +hi StatusLine guifg=#282923 guibg=#bababa gui=NONE cterm=NONE +hi StatusLineNC guifg=#282923 guibg=#74705d gui=NONE cterm=NONE +hi VertSplit guifg=#74705d guibg=#74705d gui=NONE cterm=NONE +hi TabLine guifg=#282923 guibg=#74705d gui=NONE cterm=NONE +hi TabLineFill guifg=#282923 guibg=#74705d gui=NONE cterm=NONE +hi TabLineSel guifg=#282923 guibg=#bababa gui=bold cterm=bold +hi ToolbarLine guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi ToolbarButton guifg=#74705d guibg=#f8f8f2 gui=bold,reverse cterm=bold,reverse +hi QuickFixLine guifg=#282923 guibg=#51aebe gui=NONE cterm=NONE +hi CursorLineNr guifg=#dadada guibg=NONE gui=bold cterm=bold +hi LineNr guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi LineNrAbove guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi LineNrBelow guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi NonText guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi EndOfBuffer guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi SpecialKey guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi FoldColumn guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi Visual guifg=#a1efe4 guibg=#282923 gui=reverse cterm=reverse +hi VisualNOS guifg=#282923 guibg=#80beb5 gui=NONE cterm=NONE +hi Pmenu guifg=NONE guibg=#585858 gui=NONE cterm=NONE +hi PmenuThumb guifg=NONE guibg=#74705d gui=NONE cterm=NONE +hi PmenuSbar guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi PmenuSel guifg=NONE guibg=#8a8a8a gui=NONE cterm=NONE +hi PmenuKind guifg=#80beb5 guibg=#585858 gui=NONE cterm=NONE +hi PmenuKindSel guifg=#80beb5 guibg=#8a8a8a gui=NONE cterm=NONE +hi PmenuExtra guifg=#bababa guibg=#585858 gui=NONE cterm=NONE +hi PmenuExtraSel guifg=#bababa guibg=#8a8a8a gui=NONE cterm=NONE +hi PmenuMatch guifg=#ffaf5f guibg=#585858 gui=NONE cterm=NONE +hi PmenuMatchSel guifg=#ffaf5f guibg=#8a8a8a gui=NONE cterm=NONE +hi SignColumn guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi Error guifg=#f92672 guibg=#000000 gui=reverse cterm=reverse +hi ErrorMsg guifg=#f92672 guibg=#000000 gui=reverse cterm=reverse +hi ModeMsg guifg=NONE guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold +hi MoreMsg guifg=#81af24 guibg=NONE gui=NONE cterm=NONE +hi Question guifg=#e6db74 guibg=NONE gui=NONE cterm=NONE +hi WarningMsg guifg=#f92672 guibg=NONE gui=NONE cterm=NONE +hi Todo guifg=#dadada guibg=NONE gui=bold cterm=bold +hi MatchParen guifg=#fd971f guibg=NONE gui=bold cterm=bold +hi Search guifg=#66d9ef guibg=#282923 gui=reverse cterm=reverse +hi IncSearch guifg=#ffaf5f guibg=#282923 gui=reverse cterm=reverse +hi CurSearch guifg=#ffaf5f guibg=#282923 gui=reverse cterm=reverse +hi WildMenu guifg=#282923 guibg=#e6db74 gui=bold cterm=bold +hi debugPC guifg=#282923 guibg=#51aebe gui=NONE cterm=NONE +hi debugBreakpoint guifg=#282923 guibg=#f92672 gui=NONE cterm=NONE +hi Cursor guifg=#000000 guibg=#dadada gui=NONE cterm=NONE +hi lCursor guifg=#282923 guibg=#5fff00 gui=NONE cterm=NONE +hi CursorLine guifg=NONE guibg=#3a392f gui=NONE cterm=NONE +hi CursorColumn guifg=NONE guibg=#3a392f gui=NONE cterm=NONE +hi Folded guifg=#bababa guibg=#414141 gui=NONE cterm=NONE +hi ColorColumn guifg=NONE guibg=#585858 gui=NONE cterm=NONE +hi SpellBad guifg=NONE guibg=NONE guisp=#d75f5f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi SpellCap guifg=NONE guibg=NONE guisp=#ffaf5f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi SpellLocal guifg=NONE guibg=NONE guisp=#5fd75f gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi SpellRare guifg=NONE guibg=NONE guisp=#fd5ff0 gui=undercurl ctermfg=NONE ctermbg=NONE cterm=underline +hi Constant guifg=#ae81ff guibg=NONE gui=NONE cterm=NONE +hi Type guifg=#fd971f guibg=NONE gui=bold cterm=bold +hi Character guifg=#a6e22e guibg=NONE gui=NONE cterm=NONE +hi Comment guifg=#74705d guibg=NONE gui=NONE cterm=NONE +hi String guifg=#e6db74 guibg=NONE gui=NONE cterm=NONE +hi Function guifg=#a6e22e guibg=NONE gui=NONE cterm=NONE +hi Identifier guifg=#66d9ef guibg=NONE gui=NONE cterm=NONE +hi PreProc guifg=#f92672 guibg=NONE gui=NONE cterm=NONE +hi Special guifg=#80beb5 guibg=NONE gui=NONE cterm=NONE +hi Statement guifg=#f92672 guibg=NONE gui=bold cterm=bold +hi Underlined guifg=#66d9ef guibg=NONE gui=underline cterm=underline +hi Title guifg=NONE guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=bold +hi Debug guifg=#80beb5 guibg=NONE gui=NONE cterm=NONE +hi Ignore guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi Directory guifg=#a1efe4 guibg=NONE gui=bold cterm=bold +hi Conceal guifg=#8a8a8a guibg=NONE gui=NONE cterm=NONE +hi DiffAdd guifg=#5faf5f guibg=NONE gui=reverse cterm=reverse +hi DiffChange guifg=#5f87af guibg=NONE gui=reverse cterm=reverse +hi DiffText guifg=#af87af guibg=NONE gui=reverse cterm=reverse +hi DiffDelete guifg=#af5f5f guibg=NONE gui=reverse cterm=reverse +hi Added guifg=#5fd75f guibg=NONE gui=NONE cterm=NONE +hi Changed guifg=#ffaf5f guibg=NONE gui=NONE cterm=NONE +hi Removed guifg=#d75f5f guibg=NONE gui=NONE cterm=NONE +hi htmlBold guifg=#f8f8f2 guibg=NONE gui=bold cterm=bold +hi htmlItalic guifg=#f8f8f2 guibg=NONE gui=italic cterm=italic +hi markdownHeadingDelimiter guifg=#f8f8f2 guibg=NONE gui=NONE cterm=NONE +hi markdownH1Delimiter guifg=#f92672 guibg=NONE gui=NONE cterm=NONE +hi markdownH2Delimiter guifg=#e6db74 guibg=NONE gui=NONE cterm=NONE +hi markdownH4Delimiter guifg=#66d9ef guibg=NONE gui=NONE cterm=NONE +hi markdownH6Delimiter guifg=#a6e22e guibg=NONE gui=NONE cterm=NONE +hi markdownH3Delimiter guifg=#fd971f guibg=NONE gui=NONE cterm=NONE +hi markdownH5Delimiter guifg=#51aebe guibg=NONE gui=NONE cterm=NONE +if !s:italics + hi htmlItalic gui=NONE cterm=NONE +endif + +if s:t_Co >= 256 + hi! link CursorLineFold FoldColumn + hi! link CursorLineSign SignColumn + hi! link MessageWindow Pmenu + hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel + hi! link StatusLineTerm StatusLine + hi! link StatusLineTermNC StatusLineNC + hi! link Terminal Normal + hi! link Delimiter PreProc + hi! link Operator PreProc + hi! link StorageClass PreProc + hi! link Structure PreProc + hi! link Define Identifier + hi! link Label String + hi! link markdownCode Comment + hi! link markdownCodeBlock markdownCode + hi! link markdownCodeDelimiter markdownCode + hi Normal ctermfg=255 ctermbg=235 cterm=NONE + hi StatusLine ctermfg=235 ctermbg=250 cterm=NONE + hi StatusLineNC ctermfg=235 ctermbg=244 cterm=NONE + hi VertSplit ctermfg=244 ctermbg=244 cterm=NONE + hi TabLine ctermfg=235 ctermbg=244 cterm=NONE + hi TabLineFill ctermfg=235 ctermbg=244 cterm=NONE + hi TabLineSel ctermfg=235 ctermbg=250 cterm=bold + hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE + hi ToolbarButton ctermfg=244 ctermbg=255 cterm=bold,reverse + hi QuickFixLine ctermfg=235 ctermbg=141 cterm=NONE + hi CursorLineNr ctermfg=253 ctermbg=NONE cterm=bold + hi LineNr ctermfg=245 ctermbg=NONE cterm=NONE + hi LineNrAbove ctermfg=245 ctermbg=NONE cterm=NONE + hi LineNrBelow ctermfg=245 ctermbg=NONE cterm=NONE + hi NonText ctermfg=245 ctermbg=NONE cterm=NONE + hi EndOfBuffer ctermfg=245 ctermbg=NONE cterm=NONE + hi SpecialKey ctermfg=245 ctermbg=NONE cterm=NONE + hi FoldColumn ctermfg=245 ctermbg=NONE cterm=NONE + hi Visual ctermfg=116 ctermbg=235 cterm=reverse + hi VisualNOS ctermfg=235 ctermbg=73 cterm=NONE + hi Pmenu ctermfg=NONE ctermbg=240 cterm=NONE + hi PmenuThumb ctermfg=NONE ctermbg=244 cterm=NONE + hi PmenuSbar ctermfg=NONE ctermbg=NONE cterm=NONE + hi PmenuSel ctermfg=NONE ctermbg=245 cterm=NONE + hi PmenuKind ctermfg=73 ctermbg=240 cterm=NONE + hi PmenuKindSel ctermfg=73 ctermbg=245 cterm=NONE + hi PmenuExtra ctermfg=250 ctermbg=240 cterm=NONE + hi PmenuExtraSel ctermfg=250 ctermbg=245 cterm=NONE + hi PmenuMatch ctermfg=215 ctermbg=240 cterm=NONE + hi PmenuMatchSel ctermfg=215 ctermbg=245 cterm=NONE + hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE + hi Error ctermfg=197 ctermbg=16 cterm=reverse + hi ErrorMsg ctermfg=197 ctermbg=16 cterm=reverse + hi ModeMsg ctermfg=NONE ctermbg=NONE cterm=bold + hi MoreMsg ctermfg=106 ctermbg=NONE cterm=NONE + hi Question ctermfg=185 ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=197 ctermbg=NONE cterm=NONE + hi Todo ctermfg=253 ctermbg=NONE cterm=bold + hi MatchParen ctermfg=208 ctermbg=NONE cterm=bold + hi Search ctermfg=81 ctermbg=235 cterm=reverse + hi IncSearch ctermfg=215 ctermbg=235 cterm=reverse + hi CurSearch ctermfg=215 ctermbg=235 cterm=reverse + hi WildMenu ctermfg=235 ctermbg=185 cterm=bold + hi debugPC ctermfg=235 ctermbg=73 cterm=NONE + hi debugBreakpoint ctermfg=235 ctermbg=197 cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=237 cterm=NONE + hi CursorColumn ctermfg=NONE ctermbg=237 cterm=NONE + hi Folded ctermfg=250 ctermbg=238 cterm=NONE + hi ColorColumn ctermfg=NONE ctermbg=240 cterm=NONE + hi SpellBad ctermfg=167 ctermbg=NONE cterm=underline + hi SpellCap ctermfg=215 ctermbg=NONE cterm=underline + hi SpellLocal ctermfg=77 ctermbg=NONE cterm=underline + hi SpellRare ctermfg=207 ctermbg=NONE cterm=underline + hi Constant ctermfg=141 ctermbg=NONE cterm=NONE + hi Type ctermfg=208 ctermbg=NONE cterm=bold + hi Character ctermfg=112 ctermbg=NONE cterm=NONE + hi Comment ctermfg=244 ctermbg=NONE cterm=NONE + hi String ctermfg=185 ctermbg=NONE cterm=NONE + hi Function ctermfg=112 ctermbg=NONE cterm=NONE + hi Identifier ctermfg=81 ctermbg=NONE cterm=NONE + hi PreProc ctermfg=197 ctermbg=NONE cterm=NONE + hi Special ctermfg=73 ctermbg=NONE cterm=NONE + hi Statement ctermfg=197 ctermbg=NONE cterm=bold + hi Underlined ctermfg=81 ctermbg=NONE cterm=underline + hi Title ctermfg=NONE ctermbg=NONE cterm=bold + hi Debug ctermfg=73 ctermbg=NONE cterm=NONE + hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE + hi Directory ctermfg=116 ctermbg=NONE cterm=bold + hi Conceal ctermfg=245 ctermbg=NONE cterm=NONE + hi DiffAdd ctermfg=71 ctermbg=NONE cterm=reverse + hi DiffChange ctermfg=67 ctermbg=NONE cterm=reverse + hi DiffText ctermfg=139 ctermbg=NONE cterm=reverse + hi DiffDelete ctermfg=131 ctermbg=NONE cterm=reverse + hi Added ctermfg=77 ctermbg=NONE cterm=NONE + hi Changed ctermfg=215 ctermbg=NONE cterm=NONE + hi Removed ctermfg=167 ctermbg=NONE cterm=NONE + hi htmlBold ctermfg=255 ctermbg=NONE cterm=bold + hi htmlItalic ctermfg=255 ctermbg=NONE cterm=underline + hi markdownHeadingDelimiter ctermfg=255 ctermbg=NONE cterm=NONE + hi markdownH1Delimiter ctermfg=197 ctermbg=NONE cterm=NONE + hi markdownH2Delimiter ctermfg=185 ctermbg=NONE cterm=NONE + hi markdownH4Delimiter ctermfg=81 ctermbg=NONE cterm=NONE + hi markdownH6Delimiter ctermfg=112 ctermbg=NONE cterm=NONE + hi markdownH3Delimiter ctermfg=208 ctermbg=NONE cterm=NONE + hi markdownH5Delimiter ctermfg=73 ctermbg=NONE cterm=NONE + unlet s:t_Co s:italics + finish +endif + +if s:t_Co >= 16 + hi Normal ctermfg=white ctermbg=black cterm=NONE + hi StatusLine ctermfg=black ctermbg=gray cterm=NONE + hi StatusLineNC ctermfg=black ctermbg=darkgray cterm=NONE + hi VertSplit ctermfg=darkgray ctermbg=darkgray cterm=NONE + hi TabLine ctermfg=black ctermbg=darkgray cterm=NONE + hi TabLineFill ctermfg=black ctermbg=darkgray cterm=NONE + hi TabLineSel ctermfg=black ctermbg=gray cterm=bold + hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE + hi ToolbarButton ctermfg=darkgray ctermbg=white cterm=bold,reverse + hi QuickFixLine ctermfg=black ctermbg=darkmagenta cterm=NONE + hi CursorLineNr ctermfg=white ctermbg=NONE cterm=bold + hi LineNr ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi LineNrAbove ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi LineNrBelow ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi NonText ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi EndOfBuffer ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi SpecialKey ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi FoldColumn ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi Visual ctermfg=cyan ctermbg=black cterm=reverse + hi VisualNOS ctermfg=black ctermbg=darkcyan cterm=NONE + hi Pmenu ctermfg=black ctermbg=gray cterm=NONE + hi PmenuThumb ctermfg=gray ctermbg=black cterm=NONE + hi PmenuSbar ctermfg=NONE ctermbg=gray cterm=NONE + hi PmenuSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuKind ctermfg=darkred ctermbg=gray cterm=NONE + hi PmenuKindSel ctermfg=darkred ctermbg=darkyellow cterm=NONE + hi PmenuExtra ctermfg=darkgray ctermbg=gray cterm=NONE + hi PmenuExtraSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuMatch ctermfg=black ctermbg=gray cterm=bold + hi PmenuMatchSel ctermfg=black ctermbg=darkyellow cterm=bold + hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE + hi Error ctermfg=red ctermbg=black cterm=reverse + hi ErrorMsg ctermfg=red ctermbg=black cterm=reverse + hi ModeMsg ctermfg=NONE ctermbg=NONE cterm=bold + hi MoreMsg ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Question ctermfg=yellow ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=red ctermbg=NONE cterm=NONE + hi Todo ctermfg=white ctermbg=NONE cterm=bold + hi MatchParen ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Search ctermfg=blue ctermbg=black cterm=reverse + hi IncSearch ctermfg=red ctermbg=black cterm=reverse + hi CurSearch ctermfg=red ctermbg=black cterm=reverse + hi WildMenu ctermfg=black ctermbg=yellow cterm=bold + hi debugPC ctermfg=black ctermbg=darkblue cterm=NONE + hi debugBreakpoint ctermfg=black ctermbg=red cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + hi CursorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi Folded ctermfg=black ctermbg=darkyellow cterm=NONE + hi ColorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi SpellBad ctermfg=darkred ctermbg=NONE cterm=underline + hi SpellCap ctermfg=darkyellow ctermbg=NONE cterm=underline + hi SpellLocal ctermfg=darkgreen ctermbg=NONE cterm=underline + hi SpellRare ctermfg=magenta ctermbg=NONE cterm=underline + hi Constant ctermfg=darkmagenta ctermbg=NONE cterm=NONE + hi Type ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Character ctermfg=green ctermbg=NONE cterm=NONE + hi Comment ctermfg=darkgray ctermbg=NONE cterm=NONE + hi String ctermfg=yellow ctermbg=NONE cterm=NONE + hi Function ctermfg=green ctermbg=NONE cterm=NONE + hi Identifier ctermfg=blue ctermbg=NONE cterm=NONE + hi PreProc ctermfg=red ctermbg=NONE cterm=NONE + hi Special ctermfg=darkcyan ctermbg=NONE cterm=NONE + hi Statement ctermfg=red ctermbg=NONE cterm=bold + hi Underlined ctermfg=blue ctermbg=NONE cterm=underline + hi Title ctermfg=NONE ctermbg=NONE cterm=bold + hi Debug ctermfg=darkcyan ctermbg=NONE cterm=NONE + hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE + hi Directory ctermfg=cyan ctermbg=NONE cterm=bold + hi Conceal ctermfg=darkgrey ctermbg=NONE cterm=NONE + hi DiffAdd ctermfg=darkgreen ctermbg=NONE cterm=reverse + hi DiffChange ctermfg=darkblue ctermbg=NONE cterm=reverse + hi DiffText ctermfg=darkmagenta ctermbg=NONE cterm=reverse + hi DiffDelete ctermfg=darkred ctermbg=NONE cterm=reverse + hi Added ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Changed ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi Removed ctermfg=darkred ctermbg=NONE cterm=NONE + hi htmlBold ctermfg=white ctermbg=NONE cterm=bold + hi htmlItalic ctermfg=white ctermbg=NONE cterm=underline + hi markdownHeadingDelimiter ctermfg=white ctermbg=NONE cterm=NONE + hi markdownH1Delimiter ctermfg=red ctermbg=NONE cterm=NONE + hi markdownH2Delimiter ctermfg=yellow ctermbg=NONE cterm=NONE + hi markdownH4Delimiter ctermfg=blue ctermbg=NONE cterm=NONE + hi markdownH6Delimiter ctermfg=green ctermbg=NONE cterm=NONE + hi markdownH3Delimiter ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi markdownH5Delimiter ctermfg=darkblue ctermbg=NONE cterm=NONE + unlet s:t_Co s:italics + finish +endif + +if s:t_Co >= 8 + hi Normal ctermfg=gray ctermbg=black cterm=NONE + hi StatusLine ctermfg=gray ctermbg=black cterm=bold,reverse + hi StatusLineNC ctermfg=gray ctermbg=black cterm=reverse + hi VertSplit ctermfg=gray ctermbg=gray cterm=NONE + hi TabLine ctermfg=black ctermbg=gray cterm=NONE + hi TabLineFill ctermfg=gray ctermbg=gray cterm=NONE + hi TabLineSel ctermfg=black ctermbg=gray cterm=bold + hi ToolbarLine ctermfg=NONE ctermbg=NONE cterm=NONE + hi ToolbarButton ctermfg=gray ctermbg=black cterm=reverse + hi QuickFixLine ctermfg=black ctermbg=darkyellow cterm=NONE + hi CursorLineNr ctermfg=darkyellow ctermbg=NONE cterm=bold + hi LineNr ctermfg=gray ctermbg=NONE cterm=bold + hi LineNrAbove ctermfg=gray ctermbg=NONE cterm=bold + hi LineNrBelow ctermfg=gray ctermbg=NONE cterm=bold + hi NonText ctermfg=gray ctermbg=NONE cterm=bold + hi EndOfBuffer ctermfg=gray ctermbg=NONE cterm=bold + hi SpecialKey ctermfg=gray ctermbg=NONE cterm=bold + hi FoldColumn ctermfg=gray ctermbg=NONE cterm=bold + hi Visual ctermfg=black ctermbg=darkcyan cterm=NONE + hi VisualNOS ctermfg=black ctermbg=darkcyan cterm=NONE + hi Pmenu ctermfg=black ctermbg=gray cterm=NONE + hi PmenuThumb ctermfg=gray ctermbg=black cterm=NONE + hi PmenuSbar ctermfg=NONE ctermbg=gray cterm=NONE + hi PmenuSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuKind ctermfg=darkred ctermbg=gray cterm=NONE + hi PmenuKindSel ctermfg=darkred ctermbg=darkyellow cterm=NONE + hi PmenuExtra ctermfg=black ctermbg=gray cterm=NONE + hi PmenuExtraSel ctermfg=black ctermbg=darkyellow cterm=NONE + hi PmenuMatch ctermfg=black ctermbg=gray cterm=bold + hi PmenuMatchSel ctermfg=black ctermbg=darkyellow cterm=bold + hi SignColumn ctermfg=NONE ctermbg=NONE cterm=NONE + hi Error ctermfg=darkred ctermbg=gray cterm=bold,reverse + hi ErrorMsg ctermfg=darkred ctermbg=gray cterm=bold,reverse + hi ModeMsg ctermfg=NONE ctermbg=NONE cterm=bold + hi MoreMsg ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Question ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=darkred ctermbg=NONE cterm=NONE + hi Todo ctermfg=gray ctermbg=NONE cterm=bold + hi MatchParen ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Search ctermfg=black ctermbg=darkblue cterm=NONE + hi IncSearch ctermfg=black ctermbg=darkyellow cterm=NONE + hi CurSearch ctermfg=black ctermbg=darkyellow cterm=NONE + hi WildMenu ctermfg=black ctermbg=darkyellow cterm=NONE + hi debugPC ctermfg=black ctermbg=darkblue cterm=NONE + hi debugBreakpoint ctermfg=black ctermbg=darkcyan cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + hi CursorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi Folded ctermfg=black ctermbg=darkyellow cterm=NONE + hi ColorColumn ctermfg=black ctermbg=darkyellow cterm=NONE + hi SpellBad ctermfg=darkred ctermbg=gray cterm=reverse + hi SpellCap ctermfg=darkblue ctermbg=gray cterm=reverse + hi SpellLocal ctermfg=darkgreen ctermbg=black cterm=reverse + hi SpellRare ctermfg=darkmagenta ctermbg=gray cterm=reverse + hi Constant ctermfg=darkmagenta ctermbg=NONE cterm=NONE + hi Type ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Character ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Comment ctermfg=gray ctermbg=NONE cterm=bold + hi String ctermfg=darkyellow ctermbg=NONE cterm=bold + hi Function ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Identifier ctermfg=darkblue ctermbg=NONE cterm=NONE + hi PreProc ctermfg=darkred ctermbg=NONE cterm=NONE + hi Special ctermfg=darkcyan ctermbg=NONE cterm=bold + hi Statement ctermfg=darkred ctermbg=NONE cterm=bold + hi Underlined ctermfg=darkblue ctermbg=NONE cterm=underline + hi Title ctermfg=NONE ctermbg=NONE cterm=bold + hi Debug ctermfg=darkcyan ctermbg=NONE cterm=NONE + hi Ignore ctermfg=NONE ctermbg=NONE cterm=NONE + hi Directory ctermfg=darkcyan ctermbg=NONE cterm=bold + hi Conceal ctermfg=gray ctermbg=NONE cterm=NONE + hi DiffAdd ctermfg=darkgreen ctermbg=NONE cterm=reverse + hi DiffChange ctermfg=darkblue ctermbg=NONE cterm=reverse + hi DiffText ctermfg=darkmagenta ctermbg=NONE cterm=reverse + hi DiffDelete ctermfg=darkred ctermbg=NONE cterm=reverse + hi Added ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi Changed ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi Removed ctermfg=darkred ctermbg=NONE cterm=NONE + hi htmlBold ctermfg=gray ctermbg=NONE cterm=bold + hi htmlItalic ctermfg=gray ctermbg=NONE cterm=underline + hi markdownHeadingDelimiter ctermfg=gray ctermbg=NONE cterm=NONE + hi markdownH1Delimiter ctermfg=darkred ctermbg=NONE cterm=NONE + hi markdownH2Delimiter ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi markdownH4Delimiter ctermfg=darkblue ctermbg=NONE cterm=NONE + hi markdownH6Delimiter ctermfg=darkgreen ctermbg=NONE cterm=NONE + hi markdownH3Delimiter ctermfg=darkyellow ctermbg=NONE cterm=NONE + hi markdownH5Delimiter ctermfg=darkblue ctermbg=NONE cterm=NONE + unlet s:t_Co s:italics + finish +endif + +if s:t_Co >= 0 + hi Normal term=NONE + hi ColorColumn term=reverse + hi Conceal term=NONE + hi Cursor term=reverse + hi CursorColumn term=NONE + hi CursorLine term=underline + hi CursorLineNr term=bold + hi DiffAdd term=reverse + hi DiffChange term=NONE + hi DiffDelete term=reverse + hi DiffText term=reverse + hi Directory term=NONE + hi EndOfBuffer term=NONE + hi ErrorMsg term=bold,reverse + hi FoldColumn term=NONE + hi Folded term=NONE + hi IncSearch term=bold,reverse,underline + hi LineNr term=NONE + hi MatchParen term=bold,underline + hi ModeMsg term=bold + hi MoreMsg term=NONE + hi NonText term=NONE + hi Pmenu term=reverse + hi PmenuSbar term=reverse + hi PmenuSel term=bold + hi PmenuThumb term=NONE + hi Question term=standout + hi Search term=reverse + hi SignColumn term=reverse + hi SpecialKey term=bold + hi SpellBad term=underline + hi SpellCap term=underline + hi SpellLocal term=underline + hi SpellRare term=underline + hi StatusLine term=bold,reverse + hi StatusLineNC term=bold,underline + hi TabLine term=bold,underline + hi TabLineFill term=NONE + hi Terminal term=NONE + hi TabLineSel term=bold,reverse + hi Title term=NONE + hi VertSplit term=NONE + hi Visual term=reverse + hi VisualNOS term=NONE + hi WarningMsg term=standout + hi WildMenu term=bold + hi CursorIM term=NONE + hi ToolbarLine term=reverse + hi ToolbarButton term=bold,reverse + hi CurSearch term=reverse + hi CursorLineFold term=underline + hi CursorLineSign term=underline + hi Comment term=bold + hi Constant term=NONE + hi Error term=bold,reverse + hi Identifier term=NONE + hi Ignore term=NONE + hi PreProc term=NONE + hi Special term=NONE + hi Statement term=NONE + hi Todo term=bold,reverse + hi Type term=NONE + hi Underlined term=underline + unlet s:t_Co s:italics + finish +endif + +" Background: dark +" Color: color00 #282923 235 black +" Color: color08 #74705d 244 darkgray +" Color: color01 #c61e5c 125 darkred +" Color: color09 #f92672 197 red +" Color: color02 #81af24 106 darkgreen +" Color: color10 #a6e22e 112 green +" Color: color03 #fd971f 208 darkyellow +" Color: color11 #e6db74 185 yellow +" Color: color04 #51aebe 73 darkblue +" Color: color12 #66d9ef 81 blue +" Color: color05 #ae81ff 141 darkmagenta +" Color: color13 #fd5ff0 207 magenta +" Color: color06 #80beb5 73 darkcyan +" Color: color14 #a1efe4 116 cyan +" Color: color07 #bababa 250 gray +" Color: color15 #f8f8f2 255 white +" Color: colorLine #3a392f 237 darkgrey +" Color: colorB #585858 240 darkgrey +" Color: colorF #414141 238 darkgrey +" Color: colorNonT #8a8a8a 245 darkgrey +" Color: colorC #ffaf5f 215 red +" Color: colorlC #5fff00 82 green +" Color: colorV #1f3f5f 109 cyan +" Color: colorMP #fd971f 208 darkyellow +" Color: diffAdd #5faf5f 71 darkgreen +" Color: diffDelete #af5f5f 131 darkred +" Color: diffChange #5f87af 67 darkblue +" Color: diffText #af87af 139 darkmagenta +" Color: black #000000 16 black +" Color: white #dadada 253 white +" Color: Added #5fd75f 77 darkgreen +" Color: Changed #ffaf5f 215 darkyellow +" Color: Removed #d75f5f 167 darkred +" Term colors: color00 color01 color02 color03 color04 color05 color06 color07 +" Term colors: color08 color09 color10 color11 color12 color13 color14 color15 +" vim: et ts=8 sw=2 sts=2 diff --git a/runtime/colors/wildcharm.vim b/runtime/colors/wildcharm.vim index 15f3edaf87..085ab52465 100644 --- a/runtime/colors/wildcharm.vim +++ b/runtime/colors/wildcharm.vim @@ -4,7 +4,7 @@ " Maintainer: Maxim Kim " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -20,6 +20,7 @@ hi! link LineNrAbove LineNr hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi! link CurSearch IncSearch if &background ==# 'dark' if (has('termguicolors') && &termguicolors) || has('gui_running') @@ -185,6 +186,7 @@ if s:t_Co >= 256 hi! link LineNrBelow LineNr hi! link MessageWindow PMenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi! link CurSearch IncSearch if &background ==# 'dark' hi Normal ctermfg=252 ctermbg=16 cterm=NONE diff --git a/runtime/colors/zaibatsu.vim b/runtime/colors/zaibatsu.vim index 02997c8177..abb02a0663 100644 --- a/runtime/colors/zaibatsu.vim +++ b/runtime/colors/zaibatsu.vim @@ -4,7 +4,7 @@ " Maintainer: Romain Lafourcade " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -91,6 +91,7 @@ hi! link TabLineFill StatusLineNC hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor +hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement @@ -196,6 +197,7 @@ if s:t_Co >= 256 hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor + hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement @@ -304,6 +306,7 @@ if s:t_Co >= 16 hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor + hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement @@ -412,6 +415,7 @@ if s:t_Co >= 8 hi! link TabLineSel StatusLine hi! link Terminal Normal hi! link lCursor Cursor + hi! link PopupSelected PmenuSel hi! link Boolean Constant hi! link Character Constant hi! link Conditional Statement diff --git a/runtime/colors/zellner.vim b/runtime/colors/zellner.vim index 7f11fbbe91..5b0a72caa4 100644 --- a/runtime/colors/zellner.vim +++ b/runtime/colors/zellner.vim @@ -4,7 +4,7 @@ " Maintainer: Original maintainer Ron Aaron " Website: https://github.com/vim/colorschemes " License: Same as Vim -" Last Change: 2024 Aug 15 +" Last Change: 2025 Jan 07 " Generated by Colortemplate v2.2.3 @@ -26,6 +26,7 @@ hi! link CursorLineFold CursorLine hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo +hi! link PopupSelected PmenuSel hi Normal guifg=#000000 guibg=#ffffff gui=NONE cterm=NONE hi Folded guifg=#00008b guibg=#d3d3d3 gui=NONE cterm=NONE hi CursorLine guifg=NONE guibg=#e5e5e5 gui=NONE cterm=NONE @@ -101,6 +102,7 @@ if s:t_Co >= 256 hi! link CursorLineSign CursorLine hi! link MessageWindow Pmenu hi! link PopupNotification Todo + hi! link PopupSelected PmenuSel hi Normal ctermfg=16 ctermbg=231 cterm=NONE hi Folded ctermfg=18 ctermbg=252 cterm=NONE hi CursorLine ctermfg=NONE ctermbg=254 cterm=NONE From 57f0119358ed7f060d5020309b9043463121435f Mon Sep 17 00:00:00 2001 From: Hirohito Higashi Date: Tue, 14 Jan 2025 17:21:42 +0100 Subject: [PATCH 22/93] patch 9.1.1014: Vim9: variable not found in transitive import Problem: Vim9: variable not found in transitive import Solution: Allow nested import (Hirohito Higashi) fixe: #16379 closes: #16440 Signed-off-by: Hirohito Higashi Signed-off-by: Christian Brabandt --- runtime/doc/options.txt | 3 +- runtime/doc/tags | 1 + runtime/doc/vim9.txt | 17 +++++---- src/errors.h | 3 +- src/testdir/test_vim9_class.vim | 68 ++++++++++++++++++++++++++++++++- src/version.c | 2 + src/vim9compile.c | 14 +++++++ 7 files changed, 97 insertions(+), 11 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 2f64ba3be0..018f10d08d 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Jan 12 +*options.txt* For Vim version 9.1. Last change: 2025 Jan 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -5582,6 +5582,7 @@ A jump table for the options with a short description can be found at |Q_op|. command recursion, see |E169|. See also |:function|. Also used for maximum depth of callback functions. + Also used for maximum depth of import. See |:import-cycle|. *'maxmapdepth'* *'mmd'* *E223* 'maxmapdepth' 'mmd' number (default 1000) diff --git a/runtime/doc/tags b/runtime/doc/tags index 9310df8f7c..05c2126147 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4148,6 +4148,7 @@ E1041 vim9.txt /*E1041* E1042 vim9.txt /*E1042* E1043 vim9.txt /*E1043* E1044 vim9.txt /*E1044* +E1045 vim9.txt /*E1045* E1047 vim9.txt /*E1047* E1048 vim9.txt /*E1048* E1049 vim9.txt /*E1049* diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index a978ea3693..05b451cac3 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 9.1. Last change: 2024 Dec 23 +*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2051,13 +2051,14 @@ prefixing the function with || you should use||. For example: > noremap ,a :call s:that.OtherFunc() < - *:import-cycle* -The `import` commands are executed when encountered. If script A imports -script B, and B (directly or indirectly) imports A, this will be skipped over. -At this point items in A after "import B" will not have been processed and -defined yet. Therefore cyclic imports can exist and not result in an error -directly, but may result in an error for items in A after "import B" not being -defined. This does not apply to autoload imports, see the next section. + *:import-cycle* *E1045* +The `import` commands are executed when encountered. It can be nested up to +'maxfuncdepth' levels deep. If script A imports script B, and B (directly or +indirectly) imports A, this will be skipped over. At this point items in A +after "import B" will not have been processed and defined yet. Therefore +cyclic imports can exist and not result in an error directly, but may result +in an error for items in A after "import B" not being defined. This does not +apply to autoload imports, see the next section. Importing an autoload script ~ diff --git a/src/errors.h b/src/errors.h index ad36e33a63..2811a3275c 100644 --- a/src/errors.h +++ b/src/errors.h @@ -2738,7 +2738,8 @@ EXTERN char e_invalid_command_after_export[] INIT(= N_("E1043: Invalid command after :export")); EXTERN char e_export_with_invalid_argument[] INIT(= N_("E1044: Export with invalid argument")); -// E1045 not used +EXTERN char e_import_nesting_too_deep[] + INIT(= N_("E1045: Import nesting too deep")); // E1046 not used EXTERN char e_syntax_error_in_import_str[] INIT(= N_("E1047: Syntax error in import: %s")); diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index 23281bcad7..fc0edeb5ba 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -3507,7 +3507,73 @@ def Test_extend_imported_class() v9.CheckScriptSuccess(lines) enddef -def Test_abstract_class() +" Test for multi level import +def Test_multi_level_import_normal() + var lines =<< trim END + vim9script + export class Property + public var value: string + endclass + END + writefile(lines, 'aa.vim', 'D') + + lines =<< trim END + vim9script + import './aa.vim' + export class View + var content = aa.Property.new('') + endclass + END + writefile(lines, 'bb.vim', 'D') + + lines =<< trim END + vim9script + import './bb.vim' + class MyView extends bb.View + def new(value: string) + this.content.value = value + enddef + endclass + var myView = MyView.new('This should be ok') + END + v9.CheckScriptSuccess(lines) +enddef + +" Test for multi level import +def Test_multi_level_import_nest_over() + var lines =<< trim END + vim9script + import './xbb.vim' + export class Property + public var value: string + endclass + END + writefile(lines, 'xaa.vim', 'D') + + lines =<< trim END + vim9script + import './xaa.vim' + export class View + var content = aa.Property.new('') + endclass + END + writefile(lines, 'xbb.vim', 'D') + + lines =<< trim END + vim9script + set maxfuncdepth=100 + import './xbb.vim' + class MyView extends bb.View + def new(value: string) + this.content.value = value + enddef + endclass + var myView = MyView.new('This should be ok') + END + v9.CheckSourceFailure(lines, 'E1045: Import nesting too deep', 3) +enddef + +def Test_abtstract_class() var lines =<< trim END vim9script abstract class Base diff --git a/src/version.c b/src/version.c index 2cf4f46978..57d7ec7d40 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1014, /**/ 1013, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index a2dd77a441..fa02871e8b 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -778,6 +778,7 @@ get_script_item_idx( static imported_T * find_imported_in_script(char_u *name, size_t len, int sid) { + static int nesting = 0; scriptitem_T *si; int idx; @@ -792,6 +793,19 @@ find_imported_in_script(char_u *name, size_t len, int sid) : STRLEN(import->imp_name) == len && STRNCMP(name, import->imp_name, len) == 0) return import; + else + { + if (nesting >= p_mfd) + { + emsg(_(e_import_nesting_too_deep)); + return NULL; + } + ++nesting; + import = find_imported_in_script(name, len, import->imp_sid); + --nesting; + if (import != NULL) + return import; + } } return NULL; } From 1ac53b84ada3a992f320566737e66fa00d48611f Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 14 Jan 2025 17:25:02 +0100 Subject: [PATCH 23/93] patch 9.1.1015: Coverity complains about dereferencing NULL value Problem: Coverity complains about dereferencing NULL value Solution: Check that cms2 is not null closes: #16438 Signed-off-by: Christian Brabandt --- src/fold.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fold.c b/src/fold.c index 3353cc55fe..64f9447b72 100644 --- a/src/fold.c +++ b/src/fold.c @@ -1879,7 +1879,7 @@ foldDelMarker(linenr_T lnum, char_u *marker, int markerlen) { // Also delete 'commentstring' if it matches. cms2 = (char_u *)strstr((char *)cms, "%s"); - if (p - line >= cms2 - cms + if (cms2 != NULL && p - line >= cms2 - cms && STRNCMP(p - (cms2 - cms), cms, cms2 - cms) == 0 && STRNCMP(p + len, cms2 + 2, STRLEN(cms2 + 2)) == 0) { diff --git a/src/version.c b/src/version.c index 57d7ec7d40..96a51da802 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1015, /**/ 1014, /**/ From 1aefe1de0b20fe4966863e07efa14b6aa87323ee Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Tue, 14 Jan 2025 17:29:42 +0100 Subject: [PATCH 24/93] patch 9.1.1016: Not possible to convert string2blob and blob2string Problem: Not possible to convert string2blob and blob2string Solution: add support for the blob2str() and str2blob() functions closes: #16373 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- runtime/doc/builtin.txt | 67 +++++++++++++++- runtime/doc/tags | 3 + runtime/doc/usr_41.txt | 4 +- runtime/doc/version9.txt | 4 +- src/errors.h | 2 + src/evalfunc.c | 5 ++ src/mbyte.c | 11 +++ src/proto/mbyte.pro | 1 + src/proto/strings.pro | 2 + src/strings.c | 140 +++++++++++++++++++++++++++++++++ src/testdir/test_functions.vim | 69 ++++++++++++++++ src/version.c | 2 + 12 files changed, 307 insertions(+), 3 deletions(-) diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index a34c63aebc..10970bc51a 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 06 +*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -72,6 +72,7 @@ base64_encode({blob}) String base64 encode the bytes in {blob} bindtextdomain({package}, {path}) Bool bind text domain to specified path blob2list({blob}) List convert {blob} into a list of numbers +blob2str({blob} [, {options}]) String convert {blob} into a String browse({save}, {title}, {initdir}, {default}) String put up a file requester browsedir({title}, {initdir}) String put up a directory requester @@ -609,6 +610,8 @@ split({expr} [, {pat} [, {keepempty}]]) sqrt({expr}) Float square root of {expr} srand([{expr}]) List get seed for |rand()| state([{what}]) String current state of Vim +str2blob({string} [, {options}]) + Blob convert {string} into a Blob str2float({expr} [, {quoted}]) Float convert String to Float str2list({expr} [, {utf8}]) List convert each character of {expr} to ASCII/UTF-8 value @@ -1289,6 +1292,38 @@ blob2list({blob}) *blob2list()* < Return type: list or list + +blob2str({blob} [, {options}]) *blob2str()* + Return a String in the current 'encoding' by converting the + bytes in {blob} into characters. + + If {options} is not supplied, the current 'encoding' value is + used to decode the bytes in {blob}. + + The argument {options} is a |Dict| and supports the following + items: + encoding Decode the bytes in {blob} using this + encoding. The value is a |String|. See + |encoding-names| for the supported values. + *E1515* + An error is given and an empty string is returned if + an invalid byte sequence is encountered in {blob}, + + Returns an empty String if blob is empty. + + See also |str2blob()| + + Examples: > + blob2str(0z6162) returns "ab" + blob2str(0zC2ABC2BB) returns "«»" + blob2str(0zABBB, {'encoding': 'latin1'}) returns "«»" +< + Can also be used as a |method|: > + GetBlob()->blob2str() +< + Return type: |String| + + *browse()* browse({save}, {title}, {initdir}, {default}) Put up a file requester. This only works when "has("browse")" @@ -10556,6 +10591,36 @@ state([{what}]) *state()* Return type: |String| +str2blob({string} [, {options}]) *str2blob()* + Return a Blob by converting the characters in {string} into + bytes. + + If {options} is not supplied, the current 'encoding' value is + used to convert the characters in {string} into bytes. + + The argument {options} is a |Dict| and supports the following + items: + encoding Encode the characters in {string} using this + encoding. The value is a |String|. See + |encoding-names| for the supported values. + + An error is given and an empty blob is returned if the + character encoding fails. + + Returns an empty Blob if {string} is empty. + + See also |blob2str()| + + Examples: > + str2blob("ab") returns 0z6162 + str2blob("«»") returns 0zC2ABC2BB + str2blob("«»", {'encoding': 'latin1'}) returns 0zABBB +< + Can also be used as a |method|: > + GetStr()->str2blob() +< + Return type: |Blob| + str2float({string} [, {quoted}]) *str2float()* Convert String {string} to a Float. This mostly works the same as when using a floating point number in an expression, diff --git a/runtime/doc/tags b/runtime/doc/tags index 05c2126147..fbc8545ec8 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4585,6 +4585,7 @@ E1511 options.txt /*E1511* E1512 options.txt /*E1512* E1513 message.txt /*E1513* E1514 options.txt /*E1514* +E1515 builtin.txt /*E1515* E152 helphelp.txt /*E152* E153 helphelp.txt /*E153* E154 helphelp.txt /*E154* @@ -6192,6 +6193,7 @@ blob-index eval.txt /*blob-index* blob-literal eval.txt /*blob-literal* blob-modification eval.txt /*blob-modification* blob2list() builtin.txt /*blob2list()* +blob2str() builtin.txt /*blob2str()* blockwise-examples visual.txt /*blockwise-examples* blockwise-operators visual.txt /*blockwise-operators* blockwise-put change.txt /*blockwise-put* @@ -10253,6 +10255,7 @@ status-line windows.txt /*status-line* statusmsg-variable eval.txt /*statusmsg-variable* stl-%! options.txt /*stl-%!* stl-%{ options.txt /*stl-%{* +str2blob() builtin.txt /*str2blob()* str2float() builtin.txt /*str2float()* str2list() builtin.txt /*str2list()* str2nr() builtin.txt /*str2nr()* diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index ded30e35d4..cb42257341 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 9.1. Last change: 2025 Jan 02 +*usr_41.txt* For Vim version 9.1. Last change: 2025 Jan 14 VIM USER MANUAL - by Bram Moolenaar @@ -801,6 +801,8 @@ String manipulation: *string-functions* trim() trim characters from a string bindtextdomain() set message lookup translation base path gettext() lookup message translation + str2blob() convert a string into a blob + blob2str() convert a blob into a string List manipulation: *list-functions* get() get an item without error for wrong index diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index e212230e5b..cae287684d 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2025 Jan 12 +*version9.txt* For Vim version 9.1. Last change: 2025 Jan 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41638,6 +41638,7 @@ Functions: ~ |base64_decode()| decode a base64 string into a blob |base64_encode()| encode a blob into a base64 string +|blob2str()| convert a blob into a string |bindtextdomain()| set message lookup translation base path |diff()| diff two Lists of strings |filecopy()| copy a file {from} to {to} @@ -41653,6 +41654,7 @@ Functions: ~ |matchbufline()| all the matches of a pattern in a buffer |matchstrlist()| all the matches of a pattern in a List of strings |popup_setbuf()| switch to a different buffer in a popup +|str2blob()| convert a string into a blob Autocommands: ~ diff --git a/src/errors.h b/src/errors.h index 2811a3275c..6bab826508 100644 --- a/src/errors.h +++ b/src/errors.h @@ -3657,3 +3657,5 @@ EXTERN char e_winfixbuf_cannot_go_to_buffer[] INIT(= N_("E1513: Cannot switch buffer. 'winfixbuf' is enabled")); EXTERN char e_invalid_return_type_from_findfunc[] INIT(= N_("E1514: 'findfunc' did not return a List type")); +EXTERN char e_str_encoding_failed[] + INIT(= N_("E1515: Unable to convert %s '%s' encoding")); diff --git a/src/evalfunc.c b/src/evalfunc.c index ef30792ad1..63142523c5 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1151,6 +1151,7 @@ static argcheck_T arg2_string_number[] = {arg_string, arg_number}; static argcheck_T arg2_string_or_list_dict[] = {arg_string_or_list_any, arg_dict_any}; static argcheck_T arg2_string_or_list_number[] = {arg_string_or_list_any, arg_number}; static argcheck_T arg2_string_string_or_number[] = {arg_string, arg_string_or_nr}; +static argcheck_T arg2_blob_dict[] = {arg_blob, arg_dict_any}; static argcheck_T arg3_any_list_dict[] = {arg_any, arg_list_any, arg_dict_any}; static argcheck_T arg3_buffer_lnum_lnum[] = {arg_buffer, arg_lnum, arg_lnum}; static argcheck_T arg3_buffer_number_number[] = {arg_buffer, arg_number, arg_number}; @@ -1844,6 +1845,8 @@ static funcentry_T global_functions[] = ret_bool, f_bindtextdomain}, {"blob2list", 1, 1, FEARG_1, arg1_blob, ret_list_number, f_blob2list}, + {"blob2str", 1, 2, FEARG_1, arg2_blob_dict, + ret_string, f_blob2str}, {"browse", 4, 4, 0, arg4_browse, ret_string, f_browse}, {"browsedir", 2, 2, 0, arg2_string, @@ -2710,6 +2713,8 @@ static funcentry_T global_functions[] = ret_list_number, f_srand}, {"state", 0, 1, FEARG_1, arg1_string, ret_string, f_state}, + {"str2blob", 1, 2, FEARG_1, arg2_string_dict, + ret_blob, f_str2blob}, {"str2float", 1, 2, FEARG_1, arg2_string_bool, ret_float, f_str2float}, {"str2list", 1, 2, FEARG_1, arg2_string_bool, diff --git a/src/mbyte.c b/src/mbyte.c index 4a7eada25a..1570182666 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -2106,6 +2106,17 @@ utf_byte2len(int b) return utf8len_tab[b]; } +/* + * Return length of UTF-8 character, obtained from the first byte. + * "b" must be between 0 and 255! + * Returns 0 for an invalid first byte value. + */ + int +utf_byte2len_zero(int b) +{ + return utf8len_tab_zero[b]; +} + /* * Get the length of UTF-8 byte sequence "p[size]". Does not include any * following composing characters. diff --git a/src/proto/mbyte.pro b/src/proto/mbyte.pro index bb976e3bf8..7061bab84a 100644 --- a/src/proto/mbyte.pro +++ b/src/proto/mbyte.pro @@ -31,6 +31,7 @@ int utfc_ptr2char_len(char_u *p, int *pcc, int maxlen); int utfc_char2bytes(int off, char_u *buf); int utf_ptr2len(char_u *p); int utf_byte2len(int b); +int utf_byte2len_zero(int b); int utf_ptr2len_len(char_u *p, int size); int utfc_ptr2len(char_u *p); int utfc_ptr2len_len(char_u *p, int size); diff --git a/src/proto/strings.pro b/src/proto/strings.pro index c25555f1cd..ddc53cce0c 100644 --- a/src/proto/strings.pro +++ b/src/proto/strings.pro @@ -31,6 +31,8 @@ void string_reduce(typval_T *argvars, typval_T *expr, typval_T *rettv); void f_byteidx(typval_T *argvars, typval_T *rettv); void f_byteidxcomp(typval_T *argvars, typval_T *rettv); void f_charidx(typval_T *argvars, typval_T *rettv); +void f_blob2str(typval_T *argvars, typval_T *rettv); +void f_str2blob(typval_T *argvars, typval_T *rettv); void f_str2list(typval_T *argvars, typval_T *rettv); void f_str2nr(typval_T *argvars, typval_T *rettv); void f_strgetchar(typval_T *argvars, typval_T *rettv); diff --git a/src/strings.c b/src/strings.c index 54ac17873f..c26914d0d0 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1213,6 +1213,146 @@ f_charidx(typval_T *argvars, typval_T *rettv) rettv->vval.v_number = len > 0 ? len - 1 : 0; } +/* + * Convert the string "str", from encoding "from" to encoding "to". + */ + static char_u * +convert_string(char_u *str, char_u *from, char_u *to) +{ + vimconv_T vimconv; + + vimconv.vc_type = CONV_NONE; + if (convert_setup(&vimconv, from, to) == FAIL) + return NULL; + vimconv.vc_fail = TRUE; + if (vimconv.vc_type == CONV_NONE) + str = vim_strsave(str); + else + str = string_convert(&vimconv, str, NULL); + convert_setup(&vimconv, NULL, NULL); + + return str; +} + +/* + * "blob2str()" function + * Converts a blob to a string, ensuring valid UTF-8 encoding. + */ + void +f_blob2str(typval_T *argvars, typval_T *rettv) +{ + blob_T *blob; + char_u *str; + char_u *p; + int blen; + + if (check_for_blob_arg(argvars, 0) == FAIL + || check_for_opt_dict_arg(argvars, 1) == FAIL) + return; + + blob = argvars->vval.v_blob; + blen = blob_len(blob); + + rettv->v_type = VAR_STRING; + + str = alloc(blen + 1); + if (str == NULL) + return; + + for (int i = 0; i < blen; i++) + str[i] = (char_u)blob_get(blob, i); + str[blen] = NUL; + + p = str; + if (argvars[1].v_type != VAR_UNKNOWN) + { + dict_T *d = argvars[1].vval.v_dict; + if (d != NULL) + { + char_u *enc = dict_get_string(d, "encoding", FALSE); + if (enc != NULL) + { + char_u *from = enc_canonize(enc_skip(enc)); + p = convert_string(str, from, p_enc); + vim_free(str); + if (p == NULL) + { + semsg(_(e_str_encoding_failed), "from", from); + vim_free(from); + return; + } + vim_free(from); + } + } + } + + if (STRCMP(p_enc, "utf-8") == 0 || STRCMP(p_enc, "utf8") == 0) + { + if (!utf_valid_string(p, NULL)) + { + semsg(_(e_str_encoding_failed), "from", p_enc); + vim_free(p); + return; + } + } + + rettv->vval.v_string = p; +} + +/* + * "str2blob()" function + */ + void +f_str2blob(typval_T *argvars, typval_T *rettv) +{ + blob_T *blob; + char_u *p; + size_t len; + + if (check_for_string_arg(argvars, 0) == FAIL + || check_for_opt_dict_arg(argvars, 1) == FAIL) + return; + + if (rettv_blob_alloc(rettv) == FAIL) + return; + + blob = rettv->vval.v_blob; + + p = tv_get_string_chk(&argvars[0]); + if (p == NULL) + return; + + int free_str = FALSE; + if (argvars[1].v_type != VAR_UNKNOWN) + { + dict_T *d = argvars[1].vval.v_dict; + if (d != NULL) + { + char_u *enc = dict_get_string(d, "encoding", FALSE); + if (enc != NULL) + { + char_u *to = enc_canonize(enc_skip(enc)); + p = convert_string(p, p_enc, to); + if (p == NULL) + { + semsg(_(e_str_encoding_failed), "to", to); + vim_free(to); + return; + } + vim_free(to); + free_str = TRUE; + } + } + } + + len = STRLEN(p); + for (size_t i = 0; i < len; i++) + ga_append(&blob->bv_ga, (int)p[i]); + + if (free_str) + vim_free(p); +} + /* * "str2list()" function */ diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index f80754f0a7..8b0af91015 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -4257,4 +4257,73 @@ func Test_base64_encoding() call v9.CheckLegacyAndVim9Success(lines) endfunc +" Tests for the str2blob() function +func Test_str2blob() + let lines =<< trim END + call assert_equal(0z, str2blob("")) + call assert_fails("call str2blob([])", 'E1174: String required for argument 1') + call assert_equal(0z6162, str2blob("ab")) + call assert_equal(0zC2ABC2BB, str2blob("«»")) + call assert_equal(0zC59DC59F, str2blob("ŝş")) + call assert_equal(0zE0AE85E0.AE87, str2blob("அஇ")) + call assert_equal(0zF09F81B0.F09F81B3, str2blob("🁰🁳")) + call assert_equal(0z616263, str2blob('abc', {})) + call assert_equal(0zABBB, str2blob('«»', {'encoding': 'latin1'})) + call assert_equal(0zC2ABC2BB, str2blob('«»', {'encoding': 'utf8'})) + + call assert_fails("call str2blob('abc', [])", 'E1206: Dictionary required for argument 2') + call assert_fails("call str2blob('abc', {'encoding': []})", 'E730: Using a List as a String') + call assert_fails("call str2blob('abc', {'encoding': 'ab12xy'})", 'E1515: Unable to convert to ''ab12xy'' encoding') + call assert_fails("call str2blob('ŝş', {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') + call assert_fails("call str2blob('அஇ', {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') + call assert_fails("call str2blob('🁰🁳', {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') + END + call v9.CheckLegacyAndVim9Success(lines) +endfunc + +" Tests for the blob2str() function +func Test_blob2str() + let lines =<< trim END + call assert_equal("", blob2str(0z)) + call assert_fails("call blob2str([])", 'E1238: Blob required for argument 1') + call assert_equal("ab", blob2str(0z6162)) + call assert_equal("«»", blob2str(0zC2ABC2BB)) + call assert_equal("ŝş", blob2str(0zC59DC59F)) + call assert_equal("அஇ", blob2str(0zE0AE85E0.AE87)) + call assert_equal("🁰🁳", blob2str(0zF09F81B0.F09F81B3)) + call assert_equal('«»', blob2str(0zABBB, {'encoding': 'latin1'})) + call assert_equal('«»', blob2str(0zC2ABC2BB, {'encoding': 'utf8'})) + + #" Invalid encoding + call assert_fails("call blob2str(0z80)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zC0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zE0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zF0)", "E1515: Unable to convert from 'utf-8' encoding") + + call assert_fails("call blob2str(0z6180)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61C0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61E0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61F0)", "E1515: Unable to convert from 'utf-8' encoding") + + call assert_fails("call blob2str(0zC0C0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61C0C0)", "E1515: Unable to convert from 'utf-8' encoding") + + call assert_fails("call blob2str(0zE0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zE080)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zE080C0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61E080C0)", "E1515: Unable to convert from 'utf-8' encoding") + + call assert_fails("call blob2str(0zF08080C0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z61F08080C0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zF0)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zF080)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0zF08080)", "E1515: Unable to convert from 'utf-8' encoding") + + call assert_fails("call blob2str(0z6162, [])", 'E1206: Dictionary required for argument 2') + call assert_fails("call blob2str(0z6162, {'encoding': []})", 'E730: Using a List as a String') + call assert_fails("call blob2str(0z6162, {'encoding': 'ab12xy'})", 'E1515: Unable to convert from ''ab12xy'' encoding') + END + call v9.CheckLegacyAndVim9Success(lines) +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 96a51da802..13ffc5d4e8 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1016, /**/ 1015, /**/ From 9904cbca4132f7376246a1a31305eb53e9530023 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Wed, 15 Jan 2025 18:25:19 +0100 Subject: [PATCH 25/93] patch 9.1.1017: Vim9: Patch 9.1.1013 causes a few problems Problem: Vim9: Patch 9.1.1013 causes a few problems Solution: Translate the function name only when it is a string (Yegappan Lakshmanan) fixes: #16453 closes: #16450 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/evalfunc.c | 15 +++++++++------ src/testdir/test_functions.vim | 2 ++ src/testdir/test_vim9_func.vim | 5 ++++- src/version.c | 2 ++ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/evalfunc.c b/src/evalfunc.c index 63142523c5..71e3448ae3 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -3769,14 +3769,17 @@ f_call(typval_T *argvars, typval_T *rettv) if (func == NULL || *func == NUL) return; // type error, empty name or null function - char_u *p = func; - tofree = trans_function_name(&p, NULL, FALSE, TFN_INT|TFN_QUIET); - if (tofree == NULL) + if (argvars[0].v_type == VAR_STRING) { - emsg_funcname(e_unknown_function_str, func); - return; + char_u *p = func; + tofree = trans_function_name(&p, NULL, FALSE, TFN_INT|TFN_QUIET); + if (tofree == NULL) + { + emsg_funcname(e_unknown_function_str, func); + return; + } + func = tofree; } - func = tofree; if (argvars[2].v_type != VAR_UNKNOWN) { diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 8b0af91015..9fc954c08a 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -2990,6 +2990,8 @@ endfunc func Test_call() call assert_equal(3, call('len', [123])) call assert_equal(3, 'len'->call([123])) + call assert_equal(4, call({ x -> len(x) }, ['xxxx'])) + call assert_equal(2, call(function('len'), ['xx'])) call assert_fails("call call('len', 123)", 'E1211:') call assert_equal(0, call('', [])) call assert_equal(0, call('len', test_null_list())) diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 38832e99d6..4e31f34d6a 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -4729,6 +4729,9 @@ def Test_call_modified_import_func() export def Run() done = 0 Setup() + call(Setup, []) + call("Setup", []) + call(() => Setup(), []) done += 1 enddef END @@ -4749,7 +4752,7 @@ def Test_call_modified_import_func() imp.Run() - assert_equal(1, setup) + assert_equal(4, setup) assert_equal(1, imp.done) END v9.CheckScriptSuccess(lines) diff --git a/src/version.c b/src/version.c index 13ffc5d4e8..39c0aa64ef 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1017, /**/ 1016, /**/ From 6472e583656aced8045fc852282708a684d77cfa Mon Sep 17 00:00:00 2001 From: Maxim Kim Date: Wed, 15 Jan 2025 18:31:05 +0100 Subject: [PATCH 26/93] runtime(doc): fix base64 encode/decode examples Use str2blob()/blob2str() functions in examples given. closes: #16449 Signed-off-by: Maxim Kim Signed-off-by: Christian Brabandt --- runtime/doc/builtin.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 10970bc51a..9ba22dc742 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 14 +*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1244,7 +1244,7 @@ base64_decode({string}) *base64_decode()* " Write the decoded contents to a binary file call writefile(base64_decode(s), 'tools.bmp') " Decode a base64-encoded string - echo list2str(blob2list(base64_decode(encodedstr))) + echo blob2str(base64_decode(encodedstr)) < Can also be used as a |method|: > GetEncodedString()->base64_decode() @@ -1260,7 +1260,7 @@ base64_encode({blob}) *base64_encode()* " Encode the contents of a binary file echo base64_encode(readblob('somefile.bin')) " Encode a string - echo base64_encode(list2blob(str2list(somestr))) + echo base64_encode(str2blob(somestr)) < Can also be used as a |method|: > GetBinaryData()->base64_encode() From 01f6509fb2de1627cc4ec2c109cd0aa2e3346d50 Mon Sep 17 00:00:00 2001 From: Yukihiro Nakadaira Date: Wed, 15 Jan 2025 18:36:43 +0100 Subject: [PATCH 27/93] patch 9.1.1018: v9.1.0743 causes regression with diff mode Problem: v9.1.0743 causes regression with diff mode Solution: Fix the regression with overlapping regions closes: #16454 Signed-off-by: Yukihiro Nakadaira Signed-off-by: Christian Brabandt --- src/diff.c | 10 ++++++++++ .../dumps/Test_diff_overlapped_3.38.dump | 20 +++++++++++++++++++ .../dumps/Test_diff_overlapped_3.39.dump | 20 +++++++++++++++++++ src/testdir/test_diffmode.vim | 6 ++++++ src/version.c | 2 ++ 5 files changed, 58 insertions(+) create mode 100644 src/testdir/dumps/Test_diff_overlapped_3.38.dump create mode 100644 src/testdir/dumps/Test_diff_overlapped_3.39.dump diff --git a/src/diff.c b/src/diff.c index 971ef6520d..7e56641720 100644 --- a/src/diff.c +++ b/src/diff.c @@ -1824,8 +1824,14 @@ diff_read( dp->df_count[idx_new] = hunk->count_new - off; } else + { // second overlap of new block with existing block dp->df_count[idx_new] += hunk->count_new; + if ((dp->df_lnum[idx_new] + dp->df_count[idx_new] - 1) + > curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count) + dp->df_count[idx_new] = curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count + - dp->df_lnum[idx_new] + 1; + } // Adjust the size of the block to include all the lines to the // end of the existing block or the new diff, whatever ends last. @@ -1835,6 +1841,10 @@ diff_read( { // new change ends in existing block, adjust the end dp->df_count[idx_new] += -off; + if ((dp->df_lnum[idx_new] + dp->df_count[idx_new] - 1) + > curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count) + dp->df_count[idx_new] = curtab->tp_diffbuf[idx_new]->b_ml.ml_line_count + - dp->df_lnum[idx_new] + 1; off = 0; } for (i = idx_orig; i < idx_new; ++i) diff --git a/src/testdir/dumps/Test_diff_overlapped_3.38.dump b/src/testdir/dumps/Test_diff_overlapped_3.38.dump new file mode 100644 index 0000000000..6271815e99 --- /dev/null +++ b/src/testdir/dumps/Test_diff_overlapped_3.38.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010| +0&#ffd7ff255@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|d+2#0000000#ff404010| +0&#ffd7ff255@20||+1&#ffffff0| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010| +0&#ffd7ff255@20 +| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010| +0&#ffd7ff255@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|e+2#0000000#ff404010| +0&#ffd7ff255@20||+1&#ffffff0| +0#0000e05#a8a8a8255@1|f+2#0000000#ff404010| +0&#ffd7ff255@20 +| +0#0000e05#a8a8a8255@1|c+0#0000000#5fd7ff255| @21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +|~+0&#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|X+3#0000000&|d|i|f|i|l|e|1| @4|1|,|1| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/dumps/Test_diff_overlapped_3.39.dump b/src/testdir/dumps/Test_diff_overlapped_3.39.dump new file mode 100644 index 0000000000..9f1a5cdc6c --- /dev/null +++ b/src/testdir/dumps/Test_diff_overlapped_3.39.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|a+2#0000000#ff404010| +0&#ffd7ff255@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|d+2#0000000#ff404010| +0&#ffd7ff255@20||+1&#ffffff0| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010| +0&#ffd7ff255@20 +| +0#0000e05#a8a8a8255@1|b+2#0000000#ff404010| +0&#ffd7ff255@21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|e+2#0000000#ff404010| +0&#ffd7ff255@20||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1|c+0#0000000#5fd7ff255| @21||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +|~+0&#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|X+3#0000000&|d|i|f|i|l|e|1| @4|1|,|1| @5|A|l@1| |X+1&&|d|i|f|i|l|e|2| @3|1|,|1| @5|A|l@1| |X|d|i|f|i|l|e|3| @3|1|,|1| @5|A|l@1 +|:+0&&> @73 diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index 1c7233e35a..8939bb80c3 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -2290,6 +2290,12 @@ func Test_diff_overlapped_diff_blocks_will_be_merged() call WriteDiffFiles3(buf, ["a", "b", "c"], ["a", "x", "c"], ["a", "b", "y", "c"]) call VerifyBoth(buf, "Test_diff_overlapped_3.37", "") + call WriteDiffFiles3(buf, ["a", "b", "c"], ["d", "e"], ["b", "f"]) + call VerifyBoth(buf, "Test_diff_overlapped_3.38", "") + + call WriteDiffFiles3(buf, ["a", "b", "c"], ["d", "e"], ["b"]) + call VerifyBoth(buf, "Test_diff_overlapped_3.39", "") + call StopVimInTerminal(buf) endfunc diff --git a/src/version.c b/src/version.c index 39c0aa64ef..51635c7b57 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1018, /**/ 1017, /**/ From 3058087f6f04be788118e94e942e0f0c9fca25f0 Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Wed, 15 Jan 2025 18:46:37 +0100 Subject: [PATCH 28/93] patch 9.1.1019: filetype: fd ignore files are not recognized Problem: filetype: fd ignore files are not recognized Solution: detect .fdignore files as gitignore filetype closes: #16444 Signed-off-by: Wu, Zhenyu Signed-off-by: Christian Brabandt --- runtime/filetype.vim | 6 ++++-- src/testdir/test_filetype.vim | 2 +- src/version.c | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index c4d32398f0..095114ed39 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: The Vim Project -" Last Change: 2025 Jan 08 +" Last Change: 2025 Jan 15 " Former Maintainer: Bram Moolenaar " Listen very carefully, I will say this only once @@ -951,7 +951,9 @@ au BufNewFile,BufRead */.config/git/attributes setf gitattributes au BufNewFile,BufRead */etc/gitattributes setf gitattributes au BufNewFile,BufRead .gitignore,*.git/info/exclude setf gitignore au BufNewFile,BufRead */.config/git/ignore,*.prettierignore setf gitignore -au BufNewFile,BufRead .rgignore,.ignore,.dockerignore,.npmignore,.vscodeignore setf gitignore +au BufNewFile,BufRead */.config/fd/ignore,.fdignore,.ignore setf gitignore +au BufNewFile,BufRead .rgignore,.dockerignore setf gitignore +au BufNewFile,BufRead .npmignore,.vscodeignore setf gitignore au BufNewFile,BufRead git-rebase-todo setf gitrebase au BufRead,BufNewFile .gitsendemail.msg.?????? setf gitsendemail au BufNewFile,BufRead *.git/* diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 3a6306f6f6..1a54db9955 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -309,7 +309,7 @@ def s:GetFilenameChecks(): dict> gitattributes: ['file.git/info/attributes', '.gitattributes', '/.config/git/attributes', '/etc/gitattributes', '/usr/local/etc/gitattributes', 'some.git/info/attributes'] + WhenConfigHome('$XDG_CONFIG_HOME/git/attributes'), gitcommit: ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG', 'NOTES_EDITMSG', 'EDIT_DESCRIPTION'], gitconfig: ['file.git/config', 'file.git/config.worktree', 'file.git/worktrees/x/config.worktree', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config', '/etc/gitconfig', '/usr/local/etc/gitconfig', '/etc/gitconfig.d/file', 'any/etc/gitconfig.d/file', '/.gitconfig.d/file', 'any/.config/git/config', 'any/.gitconfig.d/file', 'some.git/config', 'some.git/modules/any/config'] + WhenConfigHome('$XDG_CONFIG_HOME/git/config'), - gitignore: ['file.git/info/exclude', '.gitignore', '/.config/git/ignore', 'some.git/info/exclude'] + WhenConfigHome('$XDG_CONFIG_HOME/git/ignore') + ['.prettierignore', '.rgignore', '.ignore', '.dockerignore', '.npmignore', '.vscodeignore'], + gitignore: ['file.git/info/exclude', '.gitignore', '/.config/git/ignore', 'some.git/info/exclude'] + WhenConfigHome('$XDG_CONFIG_HOME/git/ignore') + ['.prettierignore', '.fdignore', '/.config/fd/ignore', '.ignore', '.rgignore', '.dockerignore', '.npmignore', '.vscodeignore'], gitolite: ['gitolite.conf', '/gitolite-admin/conf/file', 'any/gitolite-admin/conf/file'], gitrebase: ['git-rebase-todo'], gitsendemail: ['.gitsendemail.msg.xxxxxx'], diff --git a/src/version.c b/src/version.c index 51635c7b57..7ce1a98ef5 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1019, /**/ 1018, /**/ From 037b028a2219d09bc97be04b300b2c0490c4268d Mon Sep 17 00:00:00 2001 From: glepnir Date: Thu, 16 Jan 2025 14:37:44 +0100 Subject: [PATCH 29/93] patch 9.1.1020: no way to get current selected item in a async context Problem: no way to get current selected item in a async context Solution: add completed flag to show the entries of currently selected index item (@glepnir) closes: #16451 Signed-off-by: glepnir Signed-off-by: Christian Brabandt --- runtime/doc/builtin.txt | 5 +-- runtime/doc/todo.txt | 5 +-- src/insexpand.c | 58 +++++++++++++++++++------------ src/testdir/test_ins_complete.vim | 30 ++++++++++++++++ src/version.c | 2 ++ 5 files changed, 72 insertions(+), 28 deletions(-) diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 9ba22dc742..9d56f50822 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 15 +*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1946,7 +1946,8 @@ complete_info([{what}]) *complete_info()* typed text only, or the last completion after no item is selected when using the or keys) - inserted Inserted string. [NOT IMPLEMENTED YET] + completed Return a dictionary containing the entries of + the currently selected index item. *complete_info_mode* mode values are: diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 48937b1041..2d48cc974d 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 9.1. Last change: 2024 Dec 30 +*todo.txt* For Vim version 9.1. Last change: 2025 Jan 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -309,9 +309,6 @@ Problem with Visual highlight when 'linebreak' and 'showbreak' are set. GUI Scroll test fails on FreeBSD when using Motif. See FIXME in Test_scrollbars in src/test_gui.vim -Selected index returned by complete_info() does not match the index in the -list of items. #12230 - Support dark mode for MS-Windows: #12282 Remote command escapes single quote with backslash, should be doubling the diff --git a/src/insexpand.c b/src/insexpand.c index 4a02f0ec8e..e33e15d43b 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -3252,6 +3252,26 @@ ins_compl_update_sequence_numbers(void) } } +/* + * Fill the dict of complete_info + */ + static void +fill_complete_info_dict(dict_T *di, compl_T *match, int add_match) +{ + dict_add_string(di, "word", match->cp_str.string); + dict_add_string(di, "abbr", match->cp_text[CPT_ABBR]); + dict_add_string(di, "menu", match->cp_text[CPT_MENU]); + dict_add_string(di, "kind", match->cp_text[CPT_KIND]); + dict_add_string(di, "info", match->cp_text[CPT_INFO]); + if (add_match) + dict_add_bool(di, "match", match->cp_in_match_array); + if (match->cp_user_data.v_type == VAR_UNKNOWN) + // Add an empty string for backwards compatibility + dict_add_string(di, "user_data", (char_u *)""); + else + dict_add_tv(di, "user_data", &match->cp_user_data); +} + /* * Get complete information */ @@ -3264,13 +3284,13 @@ get_complete_info(list_T *what_list, dict_T *retdict) #define CI_WHAT_PUM_VISIBLE 0x02 #define CI_WHAT_ITEMS 0x04 #define CI_WHAT_SELECTED 0x08 -#define CI_WHAT_INSERTED 0x10 +#define CI_WHAT_COMPLETED 0x10 #define CI_WHAT_MATCHES 0x20 #define CI_WHAT_ALL 0xff int what_flag; if (what_list == NULL) - what_flag = CI_WHAT_ALL & ~CI_WHAT_MATCHES; + what_flag = CI_WHAT_ALL & ~(CI_WHAT_MATCHES | CI_WHAT_COMPLETED); else { what_flag = 0; @@ -3287,8 +3307,8 @@ get_complete_info(list_T *what_list, dict_T *retdict) what_flag |= CI_WHAT_ITEMS; else if (STRCMP(what, "selected") == 0) what_flag |= CI_WHAT_SELECTED; - else if (STRCMP(what, "inserted") == 0) - what_flag |= CI_WHAT_INSERTED; + else if (STRCMP(what, "completed") == 0) + what_flag |= CI_WHAT_COMPLETED; else if (STRCMP(what, "matches") == 0) what_flag |= CI_WHAT_MATCHES; } @@ -3300,8 +3320,8 @@ get_complete_info(list_T *what_list, dict_T *retdict) if (ret == OK && (what_flag & CI_WHAT_PUM_VISIBLE)) ret = dict_add_number(retdict, "pum_visible", pum_visible()); - if (ret == OK && (what_flag & CI_WHAT_ITEMS || what_flag & CI_WHAT_SELECTED - || what_flag & CI_WHAT_MATCHES)) + if (ret == OK && (what_flag & (CI_WHAT_ITEMS | CI_WHAT_SELECTED + | CI_WHAT_MATCHES | CI_WHAT_COMPLETED))) { list_T *li = NULL; dict_T *di; @@ -3309,6 +3329,7 @@ get_complete_info(list_T *what_list, dict_T *retdict) int selected_idx = -1; int has_items = what_flag & CI_WHAT_ITEMS; int has_matches = what_flag & CI_WHAT_MATCHES; + int has_completed = what_flag & CI_WHAT_COMPLETED; if (has_items || has_matches) { @@ -3338,18 +3359,7 @@ get_complete_info(list_T *what_list, dict_T *retdict) ret = list_append_dict(li, di); if (ret != OK) return; - dict_add_string(di, "word", match->cp_str.string); - dict_add_string(di, "abbr", match->cp_text[CPT_ABBR]); - dict_add_string(di, "menu", match->cp_text[CPT_MENU]); - dict_add_string(di, "kind", match->cp_text[CPT_KIND]); - dict_add_string(di, "info", match->cp_text[CPT_INFO]); - if (has_matches && has_items) - dict_add_bool(di, "match", match->cp_in_match_array); - if (match->cp_user_data.v_type == VAR_UNKNOWN) - // Add an empty string for backwards compatibility - dict_add_string(di, "user_data", (char_u *)""); - else - dict_add_tv(di, "user_data", &match->cp_user_data); + fill_complete_info_dict(di, match, has_matches && has_items); } if (compl_curr_match != NULL && compl_curr_match->cp_number == match->cp_number) @@ -3362,11 +3372,15 @@ get_complete_info(list_T *what_list, dict_T *retdict) } if (ret == OK && (what_flag & CI_WHAT_SELECTED)) ret = dict_add_number(retdict, "selected", selected_idx); - } - if (ret == OK && (what_flag & CI_WHAT_INSERTED)) - { - // TODO + if (ret == OK && selected_idx != -1 && has_completed) + { + di = dict_alloc(); + if (di == NULL) + return; + fill_complete_info_dict(di, compl_curr_match, FALSE); + ret = dict_add_dict(retdict, "completed", di); + } } } diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 8b266667da..289a281885 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -2975,4 +2975,34 @@ func Test_complete_info_matches() set cot& endfunc +func Test_complete_info_completed() + func ShownInfo() + let g:compl_info = complete_info(['completed']) + return '' + endfunc + set completeopt+=noinsert + + new + call setline(1, ['aaa', 'aab', 'aba', 'abb']) + inoremap =ShownInfo() + + call feedkeys("Go\\\\dd", 'tx') + call assert_equal({'word': 'aaa', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}, g:compl_info['completed']) + + call feedkeys("Go\\\\\dd", 'tx') + call assert_equal({'word': 'aab', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}, g:compl_info['completed']) + + call feedkeys("Go\\\\\\\dd", 'tx') + call assert_equal({'word': 'abb', 'menu': '', 'user_data': '', 'info': '', 'kind': '', 'abbr': ''}, g:compl_info['completed']) + + set completeopt+=noselect + call feedkeys("Go\\\\dd", 'tx') + call assert_equal({}, g:compl_info) + + bw! + bw! + delfunc ShownInfo + set cot& +endfunc + " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/version.c b/src/version.c index 7ce1a98ef5..5a47806a52 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1020, /**/ 1019, /**/ From 70dfc374ec72634a0a61aea8344178779675d516 Mon Sep 17 00:00:00 2001 From: John Marriott Date: Thu, 16 Jan 2025 18:58:20 +0100 Subject: [PATCH 30/93] patch 9.1.1021: string might be used without a trailing NUL Problem: string might be used without a trailing NUL (after v9.1.0997) Solution: Make sure that the buffer is NUL terminated closes: #16457 Signed-off-by: John Marriott Signed-off-by: Christian Brabandt --- src/drawscreen.c | 5 ++++- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/drawscreen.c b/src/drawscreen.c index 36034cc9df..a08cea3d61 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -479,7 +479,10 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) || bufIsChanged(wp->w_buffer) || wp->w_buffer->b_p_ro) && plen < MAXPATHL - 1) - *(p + plen++) = ' '; + { + *(p + plen++) = ' '; // replace NUL with space + *(p + plen) = NUL; // NUL terminate the string + } if (bt_help(wp->w_buffer)) plen += vim_snprintf((char *)p + plen, MAXPATHL - plen, "%s", _("[Help]")); #ifdef FEAT_QUICKFIX diff --git a/src/version.c b/src/version.c index 5a47806a52..c360a2416b 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1021, /**/ 1020, /**/ From 9162e636b31dcac57876cbdec15a683cedd9760e Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Thu, 16 Jan 2025 19:03:40 +0100 Subject: [PATCH 31/93] patch 9.1.1022: linematch option value not completed Problem: linematch option value not completed (after v9.1.1009) Solution: Update diffoption completion values related: #9661 closes: #16437 Signed-off-by: Christian Brabandt --- src/optionstr.c | 2 +- src/testdir/test_options.vim | 4 ++++ src/version.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/optionstr.c b/src/optionstr.c index 92474336a3..86c7967e53 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -30,7 +30,7 @@ static char *(p_briopt_values[]) = {"shift:", "min:", "sbr", "list:", "column:", #endif #if defined(FEAT_DIFF) // Note: Keep this in sync with diffopt_changed() -static char *(p_dip_values[]) = {"filler", "context:", "iblank", "icase", "iwhite", "iwhiteall", "iwhiteeol", "horizontal", "vertical", "closeoff", "hiddenoff", "foldcolumn:", "followwrap", "internal", "indent-heuristic", "algorithm:", NULL}; +static char *(p_dip_values[]) = {"filler", "context:", "iblank", "icase", "iwhite", "iwhiteall", "iwhiteeol", "horizontal", "vertical", "closeoff", "hiddenoff", "foldcolumn:", "followwrap", "internal", "indent-heuristic", "algorithm:", "linematch:", NULL}; static char *(p_dip_algorithm_values[]) = {"myers", "minimal", "patience", "histogram", NULL}; #endif static char *(p_nf_values[]) = {"bin", "octal", "hex", "alpha", "unsigned", "blank", NULL}; diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 24bdc42fe1..a7621f5d08 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -701,6 +701,10 @@ func Test_set_completion_string_values() " Test empty option set diffopt= call assert_equal([], getcompletion('set diffopt-=', 'cmdline')) + " Test all possible values + call assert_equal(['filler', 'context:', 'iblank', 'icase', 'iwhite', 'iwhiteall', 'iwhiteeol', 'horizontal', + \ 'vertical', 'closeoff', 'hiddenoff', 'foldcolumn:', 'followwrap', 'internal', 'indent-heuristic', 'algorithm:', 'linematch:'], + \ getcompletion('set diffopt=', 'cmdline')) set diffopt& " Test escaping output diff --git a/src/version.c b/src/version.c index c360a2416b..f2d77568f8 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1022, /**/ 1021, /**/ From a9f77be9223f8b886d89f7fac778d363586beb85 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Thu, 16 Jan 2025 19:06:57 +0100 Subject: [PATCH 32/93] patch 9.1.1023: Coverity complains about dereferencing NULL pointer Problem: Coverity complains about dereferencing NULL pointer Solution: Verify curdiff is not null before dereferencing it closes: #16437 Signed-off-by: Christian Brabandt --- src/diff.c | 7 +++++-- src/version.c | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/diff.c b/src/diff.c index 7e56641720..c348894ec9 100644 --- a/src/diff.c +++ b/src/diff.c @@ -2062,8 +2062,11 @@ count_filler_lines_and_topline( else { (*linesfiller) = 0; - ch_virtual_lines = get_max_diff_length(curdif); - isfiller = (curdif->df_count[toidx] ? FALSE : TRUE); + if (curdif) + { + ch_virtual_lines = get_max_diff_length(curdif); + isfiller = (curdif->df_count[toidx] ? FALSE : TRUE); + } if (isfiller) { while (curdif && curdif->df_next && diff --git a/src/version.c b/src/version.c index f2d77568f8..92bba85007 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1023, /**/ 1022, /**/ From a234a46651ef174549792bd64d4bef64a32072bb Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Thu, 16 Jan 2025 19:12:48 +0100 Subject: [PATCH 33/93] runtime(doc): fix typo in usr_02.txt fixes: #16455 Signed-off-by: Christian Brabandt --- runtime/doc/usr_02.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt index a02835d86b..00d496253e 100644 --- a/runtime/doc/usr_02.txt +++ b/runtime/doc/usr_02.txt @@ -1,4 +1,4 @@ -*usr_02.txt* For Vim version 9.1. Last change: 2025 Jan 11 +*usr_02.txt* For Vim version 9.1. Last change: 2025 Jan 16 VIM USER MANUAL - by Bram Moolenaar @@ -694,8 +694,8 @@ Summary: *help-summary* > :help E128 < takes you to the |:function| command -27) Documenction for packages distributed with Vim have the form package-. - So > +27) Documentation for packages distributed with Vim have the form + package-. So > :help package-comment < will bring you to the help section for the included comment plugin and how to From a11b23c4d52aa704a95067085741a4d66146f92b Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Thu, 16 Jan 2025 19:16:42 +0100 Subject: [PATCH 34/93] patch 9.1.1024: blob2str/str2blob() do not support list of strings Problem: blob2str/str2blob() do not support list of strings (after v9.1.1016) Solution: Add support for using a list of strings (Yegappan Lakshmanan) closes: #16459 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- runtime/doc/builtin.txt | 58 ++++++---- runtime/doc/usr_41.txt | 6 +- runtime/doc/version9.txt | 6 +- src/evalfunc.c | 3 +- src/strings.c | 200 ++++++++++++++++++++++++--------- src/testdir/test_functions.vim | 64 ++++++----- src/version.c | 2 + 7 files changed, 229 insertions(+), 110 deletions(-) diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 9d56f50822..d60d61f0d0 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -72,7 +72,7 @@ base64_encode({blob}) String base64 encode the bytes in {blob} bindtextdomain({package}, {path}) Bool bind text domain to specified path blob2list({blob}) List convert {blob} into a list of numbers -blob2str({blob} [, {options}]) String convert {blob} into a String +blob2str({blob} [, {options}]) String convert {blob} into a list of strings browse({save}, {title}, {initdir}, {default}) String put up a file requester browsedir({title}, {initdir}) String put up a directory requester @@ -610,8 +610,8 @@ split({expr} [, {pat} [, {keepempty}]]) sqrt({expr}) Float square root of {expr} srand([{expr}]) List get seed for |rand()| state([{what}]) String current state of Vim -str2blob({string} [, {options}]) - Blob convert {string} into a Blob +str2blob({list} [, {options}]) + Blob convert list of strings into a Blob str2float({expr} [, {quoted}]) Float convert String to Float str2list({expr} [, {utf8}]) List convert each character of {expr} to ASCII/UTF-8 value @@ -1260,7 +1260,7 @@ base64_encode({blob}) *base64_encode()* " Encode the contents of a binary file echo base64_encode(readblob('somefile.bin')) " Encode a string - echo base64_encode(str2blob(somestr)) + echo base64_encode(str2blob([somestr])) < Can also be used as a |method|: > GetBinaryData()->base64_encode() @@ -1294,8 +1294,12 @@ blob2list({blob}) *blob2list()* blob2str({blob} [, {options}]) *blob2str()* - Return a String in the current 'encoding' by converting the - bytes in {blob} into characters. + Return a List of Strings in the current 'encoding' by + converting the bytes in {blob} into characters. + + Each byte in the blob is interpreted as the end of a + string and a new list item is added. Each byte in the + blob is converted into a character. If {options} is not supplied, the current 'encoding' value is used to decode the bytes in {blob}. @@ -1306,22 +1310,22 @@ blob2str({blob} [, {options}]) *blob2str()* encoding. The value is a |String|. See |encoding-names| for the supported values. *E1515* - An error is given and an empty string is returned if + An error is given and an empty List is returned if an invalid byte sequence is encountered in {blob}, - Returns an empty String if blob is empty. + Returns an empty List if blob is empty. See also |str2blob()| Examples: > - blob2str(0z6162) returns "ab" - blob2str(0zC2ABC2BB) returns "«»" - blob2str(0zABBB, {'encoding': 'latin1'}) returns "«»" + blob2str(0z6162) returns ["ab"] + blob2str(0zC2ABC2BB) returns ["«»"] + blob2str(0zABBB, {'encoding': 'latin1'}) returns ["«»"] < Can also be used as a |method|: > GetBlob()->blob2str() < - Return type: |String| + Return type: list *browse()* @@ -10592,33 +10596,39 @@ state([{what}]) *state()* Return type: |String| -str2blob({string} [, {options}]) *str2blob()* - Return a Blob by converting the characters in {string} into - bytes. +str2blob({list} [, {options}]) *str2blob()* + Return a Blob by converting the characters in the List of + strings in {list} into bytes. + + A byte is added to the blob after each list item. A + newline character in the string is translated into a + byte in the blob. If {options} is not supplied, the current 'encoding' value is - used to convert the characters in {string} into bytes. + used to convert the characters into bytes. The argument {options} is a |Dict| and supports the following items: - encoding Encode the characters in {string} using this - encoding. The value is a |String|. See - |encoding-names| for the supported values. + encoding Encode the characters using this encoding. + The value is a |String|. See |encoding-names| + for the supported values. An error is given and an empty blob is returned if the character encoding fails. - Returns an empty Blob if {string} is empty. + Returns an empty Blob if {list} is empty. See also |blob2str()| Examples: > - str2blob("ab") returns 0z6162 - str2blob("«»") returns 0zC2ABC2BB - str2blob("«»", {'encoding': 'latin1'}) returns 0zABBB + str2blob(["ab"]) returns 0z6162 + str2blob(["«»"]) returns 0zC2ABC2BB + str2blob(["a\nb"]) returns 0z610A62 + str2blob(readfile('myfile.txt')) + str2blob(["«»"], {'encoding': 'latin1'}) returns 0zABBB < Can also be used as a |method|: > - GetStr()->str2blob() + GetListOfStrings()->str2blob() < Return type: |Blob| diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index cb42257341..35aba02501 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 9.1. Last change: 2025 Jan 14 +*usr_41.txt* For Vim version 9.1. Last change: 2025 Jan 16 VIM USER MANUAL - by Bram Moolenaar @@ -801,8 +801,8 @@ String manipulation: *string-functions* trim() trim characters from a string bindtextdomain() set message lookup translation base path gettext() lookup message translation - str2blob() convert a string into a blob - blob2str() convert a blob into a string + str2blob() convert a list of strings into a blob + blob2str() convert a blob into a list of strings List manipulation: *list-functions* get() get an item without error for wrong index diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index cae287684d..ecdb555dc2 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2025 Jan 14 +*version9.txt* For Vim version 9.1. Last change: 2025 Jan 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41638,7 +41638,7 @@ Functions: ~ |base64_decode()| decode a base64 string into a blob |base64_encode()| encode a blob into a base64 string -|blob2str()| convert a blob into a string +|blob2str()| convert a blob into a List of strings |bindtextdomain()| set message lookup translation base path |diff()| diff two Lists of strings |filecopy()| copy a file {from} to {to} @@ -41654,7 +41654,7 @@ Functions: ~ |matchbufline()| all the matches of a pattern in a buffer |matchstrlist()| all the matches of a pattern in a List of strings |popup_setbuf()| switch to a different buffer in a popup -|str2blob()| convert a string into a blob +|str2blob()| convert a List of strings into a blob Autocommands: ~ diff --git a/src/evalfunc.c b/src/evalfunc.c index 71e3448ae3..2b630cafc2 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1129,6 +1129,7 @@ static argcheck_T arg2_list_any_number[] = {arg_list_any, arg_number}; static argcheck_T arg2_list_any_string[] = {arg_list_any, arg_string}; static argcheck_T arg2_list_number[] = {arg_list_number, arg_list_number}; static argcheck_T arg2_list_number_bool[] = {arg_list_number, arg_bool}; +static argcheck_T arg2_list_string_dict[] = {arg_list_string, arg_dict_any}; static argcheck_T arg2_listblobmod_item[] = {arg_list_or_blob_mod, arg_item_of_prev}; static argcheck_T arg2_lnum[] = {arg_lnum, arg_lnum}; static argcheck_T arg2_lnum_number[] = {arg_lnum, arg_number}; @@ -2713,7 +2714,7 @@ static funcentry_T global_functions[] = ret_list_number, f_srand}, {"state", 0, 1, FEARG_1, arg1_string, ret_string, f_state}, - {"str2blob", 1, 2, FEARG_1, arg2_string_dict, + {"str2blob", 1, 2, FEARG_1, arg2_list_string_dict, ret_blob, f_str2blob}, {"str2float", 1, 2, FEARG_1, arg2_string_bool, ret_float, f_str2float}, diff --git a/src/strings.c b/src/strings.c index c26914d0d0..a71ac9192a 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1234,6 +1234,67 @@ convert_string(char_u *str, char_u *from, char_u *to) return str; } +/* + * Add the bytes from "str" to "blob". + */ + static void +blob_from_string(char_u *str, blob_T *blob) +{ + size_t len = STRLEN(str); + + for (size_t i = 0; i < len; i++) + { + int ch = str[i]; + + if (str[i] == NL) + // Translate newlines in the string to NUL character + ch = NUL; + + ga_append(&blob->bv_ga, ch); + } +} + +/* + * Return a string created from the bytes in blob starting at "start_idx". + * A NL character in the blob indicates end of string. + * A NUL character in the blob is translated to a NL. + * On return, "start_idx" points to next byte to process in blob. + */ + static char_u * +string_from_blob(blob_T *blob, long *start_idx) +{ + garray_T str_ga; + long blen; + long idx; + + ga_init2(&str_ga, sizeof(char), 80); + + blen = blob_len(blob); + + for (idx = *start_idx; idx < blen; idx++) + { + char_u byte = (char_u)blob_get(blob, idx); + if (byte == NL) + { + idx++; + break; + } + + if (byte == NUL) + byte = NL; + + ga_append(&str_ga, byte); + } + + ga_append(&str_ga, NUL); + + char_u *ret_str = vim_strsave(str_ga.ga_data); + *start_idx = idx; + + ga_clear(&str_ga); + return ret_str; +} + /* * "blob2str()" function * Converts a blob to a string, ensuring valid UTF-8 encoding. @@ -1241,29 +1302,24 @@ convert_string(char_u *str, char_u *from, char_u *to) void f_blob2str(typval_T *argvars, typval_T *rettv) { - blob_T *blob; - char_u *str; - char_u *p; - int blen; + blob_T *blob; + int blen; + long idx; + int utf8_inuse = FALSE; if (check_for_blob_arg(argvars, 0) == FAIL || check_for_opt_dict_arg(argvars, 1) == FAIL) return; - blob = argvars->vval.v_blob; - blen = blob_len(blob); - - rettv->v_type = VAR_STRING; - - str = alloc(blen + 1); - if (str == NULL) + if (rettv_list_alloc(rettv) == FAIL) return; - for (int i = 0; i < blen; i++) - str[i] = (char_u)blob_get(blob, i); - str[blen] = NUL; + blob = argvars->vval.v_blob; + if (blob == NULL) + return; + blen = blob_len(blob); - p = str; + char_u *from_encoding = NULL; if (argvars[1].v_type != VAR_UNKNOWN) { dict_T *d = argvars[1].vval.v_dict; @@ -1271,32 +1327,52 @@ f_blob2str(typval_T *argvars, typval_T *rettv) { char_u *enc = dict_get_string(d, "encoding", FALSE); if (enc != NULL) - { - char_u *from = enc_canonize(enc_skip(enc)); - p = convert_string(str, from, p_enc); - vim_free(str); - if (p == NULL) - { - semsg(_(e_str_encoding_failed), "from", from); - vim_free(from); - return; - } - vim_free(from); - } + from_encoding = enc_canonize(enc_skip(enc)); } } if (STRCMP(p_enc, "utf-8") == 0 || STRCMP(p_enc, "utf8") == 0) + utf8_inuse = TRUE; + + idx = 0; + while (idx < blen) { - if (!utf_valid_string(p, NULL)) + char_u *str; + char_u *converted_str; + + str = string_from_blob(blob, &idx); + if (str == NULL) + break; + + converted_str = str; + if (from_encoding != NULL) { - semsg(_(e_str_encoding_failed), "from", p_enc); - vim_free(p); - return; + converted_str = convert_string(str, from_encoding, p_enc); + vim_free(str); + if (converted_str == NULL) + { + semsg(_(e_str_encoding_failed), "from", from_encoding); + goto done; + } + } + + if (utf8_inuse) + { + if (!utf_valid_string(converted_str, NULL)) + { + semsg(_(e_str_encoding_failed), "from", p_enc); + vim_free(converted_str); + goto done; + } } + + if (list_append_string(rettv->vval.v_list, converted_str, -1) == FAIL) + break; + vim_free(converted_str); } - rettv->vval.v_string = p; +done: + vim_free(from_encoding); } /* @@ -1306,10 +1382,10 @@ f_blob2str(typval_T *argvars, typval_T *rettv) f_str2blob(typval_T *argvars, typval_T *rettv) { blob_T *blob; - char_u *p; - size_t len; + list_T *list; + listitem_T *li; - if (check_for_string_arg(argvars, 0) == FAIL + if (check_for_list_arg(argvars, 0) == FAIL || check_for_opt_dict_arg(argvars, 1) == FAIL) return; @@ -1318,11 +1394,11 @@ f_str2blob(typval_T *argvars, typval_T *rettv) blob = rettv->vval.v_blob; - p = tv_get_string_chk(&argvars[0]); - if (p == NULL) + list = argvars[0].vval.v_list; + if (list == NULL) return; - int free_str = FALSE; + char_u *to_encoding = NULL; if (argvars[1].v_type != VAR_UNKNOWN) { dict_T *d = argvars[1].vval.v_dict; @@ -1330,27 +1406,43 @@ f_str2blob(typval_T *argvars, typval_T *rettv) { char_u *enc = dict_get_string(d, "encoding", FALSE); if (enc != NULL) + to_encoding = enc_canonize(enc_skip(enc)); + } + } + + FOR_ALL_LIST_ITEMS(list, li) + { + if (li->li_tv.v_type != VAR_STRING) + continue; + + char_u *str = li->li_tv.vval.v_string; + + if (str == NULL) + continue; + + if (to_encoding != NULL) + { + str = convert_string(str, p_enc, to_encoding); + if (str == NULL) { - char_u *to = enc_canonize(enc_skip(enc)); - p = convert_string(p, p_enc, to); - if (p == NULL) - { - semsg(_(e_str_encoding_failed), "to", to); - vim_free(to); - return; - } - vim_free(to); - free_str = TRUE; + semsg(_(e_str_encoding_failed), "to", to_encoding); + goto done; } } - } - len = STRLEN(p); - for (size_t i = 0; i < len; i++) - ga_append(&blob->bv_ga, (int)p[i]); + if (li != list->lv_first) + // Each list string item is separated by a newline in the blob + ga_append(&blob->bv_ga, NL); + + blob_from_string(str, blob); + + if (to_encoding != NULL) + vim_free(str); + } - if (free_str) - vim_free(p); +done: + if (to_encoding != NULL) + vim_free(to_encoding); } /* diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 9fc954c08a..5e0fd7da7b 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -4262,23 +4262,32 @@ endfunc " Tests for the str2blob() function func Test_str2blob() let lines =<< trim END - call assert_equal(0z, str2blob("")) - call assert_fails("call str2blob([])", 'E1174: String required for argument 1') - call assert_equal(0z6162, str2blob("ab")) - call assert_equal(0zC2ABC2BB, str2blob("«»")) - call assert_equal(0zC59DC59F, str2blob("ŝş")) - call assert_equal(0zE0AE85E0.AE87, str2blob("அஇ")) - call assert_equal(0zF09F81B0.F09F81B3, str2blob("🁰🁳")) - call assert_equal(0z616263, str2blob('abc', {})) - call assert_equal(0zABBB, str2blob('«»', {'encoding': 'latin1'})) - call assert_equal(0zC2ABC2BB, str2blob('«»', {'encoding': 'utf8'})) - - call assert_fails("call str2blob('abc', [])", 'E1206: Dictionary required for argument 2') - call assert_fails("call str2blob('abc', {'encoding': []})", 'E730: Using a List as a String') - call assert_fails("call str2blob('abc', {'encoding': 'ab12xy'})", 'E1515: Unable to convert to ''ab12xy'' encoding') - call assert_fails("call str2blob('ŝş', {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') - call assert_fails("call str2blob('அஇ', {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') - call assert_fails("call str2blob('🁰🁳', {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') + call assert_equal(0z, str2blob([""])) + call assert_equal(0z, str2blob([])) + call assert_equal(0z, str2blob(test_null_list())) + call assert_equal(0z, str2blob([test_null_string(), test_null_string()])) + call assert_fails("call str2blob('')", 'E1211: List required for argument 1') + call assert_equal(0z61, str2blob(["a"])) + call assert_equal(0z6162, str2blob(["ab"])) + call assert_equal(0z610062, str2blob(["a\nb"])) + call assert_equal(0z61620A6364, str2blob(["ab", "cd"])) + call assert_equal(0z0A, str2blob(["", ""])) + + call assert_equal(0zC2ABC2BB, str2blob(["«»"])) + call assert_equal(0zC59DC59F, str2blob(["ŝş"])) + call assert_equal(0zE0AE85E0.AE87, str2blob(["அஇ"])) + call assert_equal(0zF09F81B0.F09F81B3, str2blob(["🁰🁳"])) + call assert_equal(0z616263, str2blob(['abc'], {})) + call assert_equal(0zABBB, str2blob(['«»'], {'encoding': 'latin1'})) + call assert_equal(0zABBB0AABBB, str2blob(['«»', '«»'], {'encoding': 'latin1'})) + call assert_equal(0zC2ABC2BB, str2blob(['«»'], {'encoding': 'utf8'})) + + call assert_fails("call str2blob(['abc'], [])", 'E1206: Dictionary required for argument 2') + call assert_fails("call str2blob(['abc'], {'encoding': []})", 'E730: Using a List as a String') + call assert_fails("call str2blob(['abc'], {'encoding': 'ab12xy'})", 'E1515: Unable to convert to ''ab12xy'' encoding') + call assert_fails("call str2blob(['ŝş'], {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') + call assert_fails("call str2blob(['அஇ'], {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') + call assert_fails("call str2blob(['🁰🁳'], {'encoding': 'latin1'})", 'E1515: Unable to convert to ''latin1'' encoding') END call v9.CheckLegacyAndVim9Success(lines) endfunc @@ -4286,18 +4295,23 @@ endfunc " Tests for the blob2str() function func Test_blob2str() let lines =<< trim END - call assert_equal("", blob2str(0z)) + call assert_equal([], blob2str(0z)) + call assert_equal([], blob2str(test_null_blob())) call assert_fails("call blob2str([])", 'E1238: Blob required for argument 1') - call assert_equal("ab", blob2str(0z6162)) - call assert_equal("«»", blob2str(0zC2ABC2BB)) - call assert_equal("ŝş", blob2str(0zC59DC59F)) - call assert_equal("அஇ", blob2str(0zE0AE85E0.AE87)) - call assert_equal("🁰🁳", blob2str(0zF09F81B0.F09F81B3)) - call assert_equal('«»', blob2str(0zABBB, {'encoding': 'latin1'})) - call assert_equal('«»', blob2str(0zC2ABC2BB, {'encoding': 'utf8'})) + call assert_equal(["ab"], blob2str(0z6162)) + call assert_equal(["a\nb"], blob2str(0z610062)) + call assert_equal(["ab", "cd"], blob2str(0z61620A6364)) + + call assert_equal(["«»"], blob2str(0zC2ABC2BB)) + call assert_equal(["ŝş"], blob2str(0zC59DC59F)) + call assert_equal(["அஇ"], blob2str(0zE0AE85E0.AE87)) + call assert_equal(["🁰🁳"], blob2str(0zF09F81B0.F09F81B3)) + call assert_equal(['«»'], blob2str(0zABBB, {'encoding': 'latin1'})) + call assert_equal(['«»'], blob2str(0zC2ABC2BB, {'encoding': 'utf8'})) #" Invalid encoding call assert_fails("call blob2str(0z80)", "E1515: Unable to convert from 'utf-8' encoding") + call assert_fails("call blob2str(0z610A80)", "E1515: Unable to convert from 'utf-8' encoding") call assert_fails("call blob2str(0zC0)", "E1515: Unable to convert from 'utf-8' encoding") call assert_fails("call blob2str(0zE0)", "E1515: Unable to convert from 'utf-8' encoding") call assert_fails("call blob2str(0zF0)", "E1515: Unable to convert from 'utf-8' encoding") diff --git a/src/version.c b/src/version.c index 92bba85007..b002210866 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1024, /**/ 1023, /**/ From 166b1754a9b2046d678f59dedea7a3d693067047 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Fri, 17 Jan 2025 11:48:12 +0100 Subject: [PATCH 35/93] patch 9.1.1025: wrong return type of blob2str() Problem: wrong return type of blob2str() Solution: update return to list of string (Yegappan Lakshmanan) closes: #16461 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- runtime/doc/builtin.txt | 4 ++-- src/evalfunc.c | 2 +- src/testdir/test_vim9_builtin.vim | 17 +++++++++++++++++ src/version.c | 2 ++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index d60d61f0d0..1837661bd5 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 16 +*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -72,7 +72,7 @@ base64_encode({blob}) String base64 encode the bytes in {blob} bindtextdomain({package}, {path}) Bool bind text domain to specified path blob2list({blob}) List convert {blob} into a list of numbers -blob2str({blob} [, {options}]) String convert {blob} into a list of strings +blob2str({blob} [, {options}]) List convert {blob} into a list of strings browse({save}, {title}, {initdir}, {default}) String put up a file requester browsedir({title}, {initdir}) String put up a directory requester diff --git a/src/evalfunc.c b/src/evalfunc.c index 2b630cafc2..8886088561 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1847,7 +1847,7 @@ static funcentry_T global_functions[] = {"blob2list", 1, 1, FEARG_1, arg1_blob, ret_list_number, f_blob2list}, {"blob2str", 1, 2, FEARG_1, arg2_blob_dict, - ret_string, f_blob2str}, + ret_list_string, f_blob2str}, {"browse", 4, 4, 0, arg4_browse, ret_string, f_browse}, {"browsedir", 2, 2, 0, arg2_string, diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index c82608b465..cfaf0ace21 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -357,6 +357,16 @@ def Test_blob2list() v9.CheckSourceDefAndScriptFailure(['blob2list(10)'], ['E1013: Argument 1: type mismatch, expected blob but got number', 'E1238: Blob required for argument 1']) enddef +def Test_blob2str() + 0z6162->blob2str()->assert_equal(["ab"]) + blob2str(0z)->assert_equal([]) + + var l: list = blob2str(0zC2ABC2BB) + assert_equal(["«»"], l) + + v9.CheckSourceDefAndScriptFailure(['blob2str("ab")'], ['E1013: Argument 1: type mismatch, expected blob but got string', 'E1238: Blob required for argument 1']) +enddef + def Test_browse() CheckFeature browse @@ -4325,6 +4335,13 @@ def Test_state() assert_equal('', state('a')) enddef +def Test_str2blob() + ["ab"]->str2blob()->assert_equal(0z6162) + str2blob([""])->assert_equal(0z) + + v9.CheckSourceDefAndScriptFailure(['str2blob("ab")'], ['E1013: Argument 1: type mismatch, expected list but got string', 'E1211: List required for argument 1']) +enddef + def Test_str2float() str2float("1.00")->assert_equal(1.00) str2float("2e-2")->assert_equal(0.02) diff --git a/src/version.c b/src/version.c index b002210866..93f94c1364 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1025, /**/ 1024, /**/ From 9cfdabb074feefc9848e9f7a4538f201e28c7f06 Mon Sep 17 00:00:00 2001 From: Luca Saccarola Date: Fri, 17 Jan 2025 13:03:53 +0100 Subject: [PATCH 36/93] runtime(netrw): change netrw maintainer Dr. Chip retired some time ago and is no longer maintaining the netrw plugin. However as a runtime plugin distributed by Vim, it important to maintain the netrw plugin in the future and fix bugs as they are reported. So, split out the netrw plugin as an additional package, however include some stubs to make sure the plugin is still loaded by default and the documentation is accessible as well. closes: #16368 Signed-off-by: Luca Saccarola Signed-off-by: Christian Brabandt --- Filelist | 8 + runtime/doc/pi_netrw.txt | 4407 +---------------- runtime/doc/tags | 5 +- runtime/pack/dist/opt/netrw/LICENSE.txt | 16 + runtime/pack/dist/opt/netrw/README.md | 544 ++ .../dist/opt/netrw}/autoload/netrw.vim | 60 +- .../opt/netrw}/autoload/netrwSettings.vim | 15 +- .../opt/netrw}/autoload/netrw_gitignore.vim | 4 + runtime/pack/dist/opt/netrw/doc/netrw.txt | 3803 ++++++++++++++ .../dist/opt/netrw/plugin/netrwPlugin.vim | 222 + .../dist/opt/netrw}/syntax/netrw.vim | 13 +- runtime/plugin/netrwPlugin.vim | 235 +- 12 files changed, 4618 insertions(+), 4714 deletions(-) mode change 100644 => 120000 runtime/doc/pi_netrw.txt create mode 100644 runtime/pack/dist/opt/netrw/LICENSE.txt create mode 100644 runtime/pack/dist/opt/netrw/README.md rename runtime/{ => pack/dist/opt/netrw}/autoload/netrw.vim (99%) rename runtime/{ => pack/dist/opt/netrw}/autoload/netrwSettings.vim (95%) rename runtime/{ => pack/dist/opt/netrw}/autoload/netrw_gitignore.vim (89%) create mode 100644 runtime/pack/dist/opt/netrw/doc/netrw.txt create mode 100644 runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim rename runtime/{ => pack/dist/opt/netrw}/syntax/netrw.vim (94%) diff --git a/Filelist b/Filelist index aefed89d88..25ffa626bc 100644 --- a/Filelist +++ b/Filelist @@ -809,6 +809,14 @@ RT_ALL = \ runtime/pack/dist/opt/shellmenu/plugin/shellmenu.vim \ runtime/pack/dist/opt/swapmouse/plugin/swapmouse.vim \ runtime/pack/dist/opt/termdebug/plugin/termdebug.vim \ + runtime/pack/dist/opt/netrw/LICENSE.txt \ + runtime/pack/dist/opt/netrw/README.md \ + runtime/pack/dist/opt/netrw/autoload/netrw.vim \ + runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim \ + runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim \ + runtime/pack/dist/opt/netrw/doc/netrw.txt \ + runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim \ + runtime/pack/dist/opt/netrw/syntax/netrw.vim # Runtime files for all distributions without CR/LF translation. RT_ALL_BIN = \ diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt deleted file mode 100644 index c22aad3544..0000000000 --- a/runtime/doc/pi_netrw.txt +++ /dev/null @@ -1,4406 +0,0 @@ -*pi_netrw.txt* For Vim version 9.1. Last change: 2024 Nov 23 - - ------------------------------------------------ - NETRW REFERENCE MANUAL by Charles E. Campbell - ------------------------------------------------ -Original Author: Charles E. Campbell - -Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright* - The VIM LICENSE applies to the files in this package, including - netrw.vim, pi_netrw.txt, netrwSettings.vim, and - syntax/netrw.vim. Like anything else that's free, netrw.vim and its - associated files are provided *as is* and comes with no warranty of - any kind, either expressed or implied. No guarantees of - merchantability. No guarantees of suitability for any purpose. By - using this plugin, you agree that in no event will the copyright - holder be liable for any damages resulting from the use of this - software. Use at your own risk! For bug reports, see |bugs|. - - *netrw* - *dav* *ftp* *netrw-file* *rcp* *scp* - *davs* *http* *netrw.vim* *rsync* *sftp* - *fetch* *network* - -============================================================================== -1. Contents *netrw-contents* {{{1 - -1. Contents..............................................|netrw-contents| -2. Starting With Netrw...................................|netrw-start| -3. Netrw Reference.......................................|netrw-ref| - EXTERNAL APPLICATIONS AND PROTOCOLS.................|netrw-externapp| - READING.............................................|netrw-read| - WRITING.............................................|netrw-write| - SOURCING............................................|netrw-source| - DIRECTORY LISTING...................................|netrw-dirlist| - CHANGING THE USERID AND PASSWORD....................|netrw-chgup| - VARIABLES AND SETTINGS..............................|netrw-variables| - PATHS...............................................|netrw-path| -4. Network-Oriented File Transfer........................|netrw-xfer| - NETRC...............................................|netrw-netrc| - PASSWORD............................................|netrw-passwd| -5. Activation............................................|netrw-activate| -6. Transparent Remote File Editing.......................|netrw-transparent| -7. Ex Commands...........................................|netrw-ex| -8. Variables and Options.................................|netrw-variables| -9. Browsing..............................................|netrw-browse| - Introduction To Browsing............................|netrw-intro-browse| - Quick Reference: Maps...............................|netrw-browse-maps| - Quick Reference: Commands...........................|netrw-browse-cmds| - Banner Display......................................|netrw-I| - Bookmarking A Directory.............................|netrw-mb| - Browsing............................................|netrw-cr| - Squeezing the Current Tree-Listing Directory........|netrw-s-cr| - Browsing With A Horizontally Split Window...........|netrw-o| - Browsing With A New Tab.............................|netrw-t| - Browsing With A Vertically Split Window.............|netrw-v| - Change Listing Style (thin wide long tree)..........|netrw-i| - Changing To A Bookmarked Directory..................|netrw-gb| - Quick hide/unhide of dot-files......................|netrw-gh| - Changing local-only File Permission.................|netrw-gp| - Changing To A Predecessor Directory.................|netrw-u| - Changing To A Successor Directory...................|netrw-U| - Customizing Browsing With A Special Handler.........|netrw-x| - Deleting Bookmarks..................................|netrw-mB| - Deleting Files Or Directories.......................|netrw-D| - Directory Exploring Commands........................|netrw-explore| - Exploring With Stars and Patterns...................|netrw-star| - Displaying Information About File...................|netrw-qf| - Edit File Or Directory Hiding List..................|netrw-ctrl-h| - Editing The Sorting Sequence........................|netrw-S| - Forcing treatment as a file or directory............|netrw-gd| |netrw-gf| - Going Up............................................|netrw--| - Hiding Files Or Directories.........................|netrw-a| - Improving Browsing..................................|netrw-ssh-hack| - Listing Bookmarks And History.......................|netrw-qb| - Making A New Directory..............................|netrw-d| - Making The Browsing Directory The Current Directory.|netrw-cd| - Marking Files.......................................|netrw-mf| - Unmarking Files.....................................|netrw-mF| - Marking Files By Location List......................|netrw-qL| - Marking Files By QuickFix List......................|netrw-qF| - Marking Files By Regular Expression.................|netrw-mr| - Marked Files: Arbitrary Shell Command...............|netrw-mx| - Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX| - Marked Files: Arbitrary Vim Command.................|netrw-mv| - Marked Files: Argument List.........................|netrw-ma| |netrw-mA| - Marked Files: Buffer List...........................|netrw-cb| |netrw-cB| - Marked Files: Compression And Decompression.........|netrw-mz| - Marked Files: Copying...............................|netrw-mc| - Marked Files: Diff..................................|netrw-md| - Marked Files: Editing...............................|netrw-me| - Marked Files: Grep..................................|netrw-mg| - Marked Files: Hiding and Unhiding by Suffix.........|netrw-mh| - Marked Files: Moving................................|netrw-mm| - Marked Files: Printing..............................|netrw-mp| - Marked Files: Sourcing..............................|netrw-ms| - Marked Files: Setting the Target Directory..........|netrw-mt| - Marked Files: Tagging...............................|netrw-mT| - Marked Files: Target Directory Using Bookmarks......|netrw-Tb| - Marked Files: Target Directory Using History........|netrw-Th| - Marked Files: Unmarking.............................|netrw-mu| - Netrw Browser Variables.............................|netrw-browser-var| - Netrw Browsing And Option Incompatibilities.........|netrw-incompatible| - Netrw Settings Window...............................|netrw-settings-window| - Obtaining A File....................................|netrw-O| - Preview Window......................................|netrw-p| - Previous Window.....................................|netrw-P| - Refreshing The Listing..............................|netrw-ctrl-l| - Reversing Sorting Order.............................|netrw-r| - Renaming Files Or Directories.......................|netrw-R| - Selecting Sorting Style.............................|netrw-s| - Setting Editing Window..............................|netrw-C| -10. Problems and Fixes....................................|netrw-problems| -11. Debugging Netrw Itself................................|netrw-debug| -12. History...............................................|netrw-history| -13. Todo..................................................|netrw-todo| -14. Credits...............................................|netrw-credits| - -============================================================================== -2. Starting With Netrw *netrw-start* {{{1 - -Netrw makes reading files, writing files, browsing over a network, and -local browsing easy! First, make sure that you have plugins enabled, so -you'll need to have at least the following in your <.vimrc>: -(or see |netrw-activate|) > - - set nocp " 'compatible' is not set - filetype plugin on " plugins are enabled -< -(see |'cp'| and |:filetype-plugin-on|) - -Netrw supports "transparent" editing of files on other machines using urls -(see |netrw-transparent|). As an example of this, let's assume you have an -account on some other machine; if you can use scp, try: > - - vim scp://hostname/path/to/file -< -Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|! - -So, what if you have ftp, not ssh/scp? That's easy, too; try > - - vim ftp://hostname/path/to/file -< -Want to make ftp simpler to use? See if your ftp supports a file called -<.netrc> -- typically it goes in your home directory, has read/write -permissions for only the user to read (ie. not group, world, other, etc), -and has lines resembling > - - machine HOSTNAME login USERID password "PASSWORD" - machine HOSTNAME login USERID password "PASSWORD" - ... - default login USERID password "PASSWORD" -< -Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: > - - let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE' -< -Netrw will substitute the host's machine name for "MACHINE" from the URL it is -attempting to open, and so one may specify > - userid - password -for each site in a separate file: c:\Users\MyUserName\MachineName. - -Now about browsing -- when you just want to look around before editing a -file. For browsing on your current host, just "edit" a directory: > - - vim . - vim /home/userid/path -< -For browsing on a remote host, "edit" a directory (but make sure that -the directory name is followed by a "/"): > - - vim scp://hostname/ - vim ftp://hostname/path/to/dir/ -< -See |netrw-browse| for more! - -There are more protocols supported by netrw than just scp and ftp, too: see the -next section, |netrw-externapp|, on how to use these external applications with -netrw and vim. - -PREVENTING LOADING *netrw-noload* - -If you want to use plugins, but for some reason don't wish to use netrw, then -you need to avoid loading both the plugin and the autoload portions of netrw. -You may do so by placing the following two lines in your <.vimrc>: > - - :let g:loaded_netrw = 1 - :let g:loaded_netrwPlugin = 1 -< - -============================================================================== -3. Netrw Reference *netrw-ref* {{{1 - - Netrw supports several protocols in addition to scp and ftp as mentioned - in |netrw-start|. These include dav, fetch, http,... well, just look - at the list in |netrw-externapp|. Each protocol is associated with a - variable which holds the default command supporting that protocol. - -EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2 - - Protocol Variable Default Value - -------- ---------------- ------------- - dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable - dav: g:netrw_dav_cmd = "curl -o" elseif curl is available - fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available - ftp: *g:netrw_ftp_cmd* = "ftp" - http: *g:netrw_http_cmd* = "elinks" if elinks is available - http: g:netrw_http_cmd = "links" elseif links is available - http: g:netrw_http_cmd = "curl" elseif curl is available - http: g:netrw_http_cmd = "wget" elseif wget is available - http: g:netrw_http_cmd = "fetch" elseif fetch is available - http: *g:netrw_http_put_cmd* = "curl -T" - rcp: *g:netrw_rcp_cmd* = "rcp" - rsync: *g:netrw_rsync_cmd* = "rsync" (see |g:netrw_rsync_sep|) - scp: *g:netrw_scp_cmd* = "scp -q" - sftp: *g:netrw_sftp_cmd* = "sftp" - file: *g:netrw_file_cmd* = "elinks" or "links" - - *g:netrw_http_xcmd* : the option string for http://... protocols are - specified via this variable and may be independently overridden. By - default, the option arguments for the http-handling commands are: > - - elinks : "-source >" - links : "-dump >" - curl : "-L -o" - wget : "-q -O" - fetch : "-o" -< - For example, if your system has elinks, and you'd rather see the - page using an attempt at rendering the text, you may wish to have > - let g:netrw_http_xcmd= "-dump >" -< in your .vimrc. - - g:netrw_http_put_cmd: this option specifies both the executable and - any needed options. This command does a PUT operation to the url. - - -READING *netrw-read* *netrw-nread* {{{2 - - Generally, one may just use the URL notation with a normal editing - command, such as > - - :e ftp://[user@]machine/path -< - Netrw also provides the Nread command: - - :Nread ? give help - :Nread "machine:path" uses rcp - :Nread "machine path" uses ftp w/ <.netrc> - :Nread "machine id password path" uses ftp - :Nread "dav://machine[:port]/path" uses cadaver - :Nread "fetch://[user@]machine/path" uses fetch - :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> - :Nread "http://[user@]machine/path" uses http uses wget - :Nread "rcp://[user@]machine/path" uses rcp - :Nread "rsync://[user@]machine[:port]/path" uses rsync - :Nread "scp://[user@]machine[[:#]port]/path" uses scp - :Nread "sftp://[user@]machine/path" uses sftp - -WRITING *netrw-write* *netrw-nwrite* {{{2 - - One may just use the URL notation with a normal file writing - command, such as > - - :w ftp://[user@]machine/path -< - Netrw also provides the Nwrite command: - - :Nwrite ? give help - :Nwrite "machine:path" uses rcp - :Nwrite "machine path" uses ftp w/ <.netrc> - :Nwrite "machine id password path" uses ftp - :Nwrite "dav://machine[:port]/path" uses cadaver - :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> - :Nwrite "rcp://[user@]machine/path" uses rcp - :Nwrite "rsync://[user@]machine[:port]/path" uses rsync - :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp - :Nwrite "sftp://[user@]machine/path" uses sftp - http: not supported! - -SOURCING *netrw-source* {{{2 - - One may just use the URL notation with the normal file sourcing - command, such as > - - :so ftp://[user@]machine/path -< - Netrw also provides the Nsource command: - - :Nsource ? give help - :Nsource "dav://machine[:port]/path" uses cadaver - :Nsource "fetch://[user@]machine/path" uses fetch - :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> - :Nsource "http://[user@]machine/path" uses http uses wget - :Nsource "rcp://[user@]machine/path" uses rcp - :Nsource "rsync://[user@]machine[:port]/path" uses rsync - :Nsource "scp://[user@]machine[[:#]port]/path" uses scp - :Nsource "sftp://[user@]machine/path" uses sftp - -DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2 - - One may browse a directory to get a listing by simply attempting to - edit the directory: > - - :e scp://[user]@hostname/path/ - :e ftp://[user]@hostname/path/ -< - For remote directory listings (ie. those using scp or ftp), that - trailing "/" is necessary (the slash tells netrw to treat the argument - as a directory to browse instead of as a file to download). - - The Nread command may also be used to accomplish this (again, that - trailing slash is necessary): > - - :Nread [protocol]://[user]@hostname/path/ -< - *netrw-login* *netrw-password* -CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2 - - Attempts to use ftp will prompt you for a user-id and a password. - These will be saved in global variables |g:netrw_uid| and - |s:netrw_passwd|; subsequent use of ftp will re-use those two strings, - thereby simplifying use of ftp. However, if you need to use a - different user id and/or password, you'll want to call |NetUserPass()| - first. To work around the need to enter passwords, check if your ftp - supports a <.netrc> file in your home directory. Also see - |netrw-passwd| (and if you're using ssh/scp hoping to figure out how - to not need to use passwords for scp, look at |netrw-ssh-hack|). - - :NetUserPass [uid [password]] -- prompts as needed - :call NetUserPass() -- prompts for uid and password - :call NetUserPass("uid") -- prompts for password - :call NetUserPass("uid","password") -- sets global uid and password - -(Related topics: |ftp| |netrw-userpass| |netrw-start|) - -NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2 - (Also see: - |netrw-browser-var| : netrw browser option variables - |netrw-protocol| : file transfer protocol option variables - |netrw-settings| : additional file transfer options - |netrw-browser-options| : these options affect browsing directories - ) - -Netrw provides a lot of variables which allow you to customize netrw to your -preferences. One way to look at them is via the command :NetrwSettings (see -|netrw-settings|) which will display your current netrw settings. Most such -settings are described below, in |netrw-browser-options|, and in -|netrw-externapp|: - - *b:netrw_lastfile* last file Network-read/written retained on a - per-buffer basis (supports plain :Nw ) - - *g:netrw_bufsettings* the settings that netrw buffers have - (default) noma nomod nonu nowrap ro nobl - - *g:netrw_chgwin* specifies a window number where subsequent file edits - will take place. (also see |netrw-C|) - (default) -1 - - *g:Netrw_funcref* specifies a function (or functions) to be called when - netrw edits a file. The file is first edited, and - then the function reference (|Funcref|) is called. - This variable may also hold a |List| of Funcrefs. - (default) not defined. (the capital in g:Netrw... - is required by its holding a function reference) -> - Example: place in .vimrc; affects all file opening - fun! MyFuncRef() - endfun - let g:Netrw_funcref= function("MyFuncRef") - -< - *g:Netrw_UserMaps* specifies a function or |List| of functions which can - be used to set up user-specified maps and functionality. - See |netrw-usermaps| - - *g:netrw_ftp* if it doesn't exist, use default ftp - =0 use default ftp (uid password) - =1 use alternate ftp method (user uid password) - If you're having trouble with ftp, try changing the - value of this variable to see if the alternate ftp - method works for your setup. - - *g:netrw_ftp_options* Chosen by default, these options are supposed to - turn interactive prompting off and to restrain ftp - from attempting auto-login upon initial connection. - However, it appears that not all ftp implementations - support this (ex. ncftp). - ="-i -n" - - *g:netrw_ftpextracmd* default: doesn't exist - If this variable exists, then any string it contains - will be placed into the commands set to your ftp - client. As an example: - ="passive" - - *g:netrw_ftpmode* ="binary" (default) - ="ascii" - - *g:netrw_ignorenetrc* =0 (default for linux, cygwin) - =1 If you have a <.netrc> file but it doesn't work and - you want it ignored, then set this variable as - shown. (default for Windows + cmd.exe) - - *g:netrw_menu* =0 disable netrw's menu - =1 (default) netrw's menu enabled - - *g:netrw_nogx* if this variable exists, then the "gx" map will not - be available (see |netrw-gx|) - - *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis - *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis - - *g:netrw_preview* =0 (default) preview window shown in a horizontally - split window - =1 preview window shown in a vertically split window. - Also affects the "previous window" (see |netrw-P|) - in the same way. - The |g:netrw_alto| variable may be used to provide - additional splitting control: - g:netrw_preview g:netrw_alto result - 0 0 |:aboveleft| - 0 1 |:belowright| - 1 0 |:topleft| - 1 1 |:botright| - To control sizing, see |g:netrw_winsize| - - *g:netrw_scpport* = "-P" : option to use to set port for scp - *g:netrw_sshport* = "-p" : option to use to set port for ssh - - *g:netrw_sepchr* =\0xff - =\0x01 for enc == euc-jp (and perhaps it should be for - others, too, please let me know) - Separates priority codes from filenames internally. - See |netrw-p12|. - - *g:netrw_silent* =0 : transfers done normally - =1 : transfers done silently - - *g:netrw_use_errorwindow* =2: messages from netrw will use a popup window - Move the mouse and pause to remove the popup window. - (default value if popup windows are available) - =1 : messages from netrw will use a separate one - line window. This window provides reliable - delivery of messages. - (default value if popup windows are not available) - =0 : messages from netrw will use echoerr ; - messages don't always seem to show up this - way, but one doesn't have to quit the window. - - *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also - permits network browsing to use ls with time and - size sorting (default if windows) - =0 assume Windows' scp accepts windows-style paths - Network browsing uses dir instead of ls - This option is ignored if you're using unix - - *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP - =1 use WinNT's rcp in binary mode (default) - -PATHS *netrw-path* {{{2 - -Paths to files are generally user-directory relative for most protocols. -It is possible that some protocol will make paths relative to some -associated directory, however. -> - example: vim scp://user@host/somefile - example: vim scp://user@host/subdir1/subdir2/somefile -< -where "somefile" is in the "user"'s home directory. If you wish to get a -file using root-relative paths, use the full path: -> - example: vim scp://user@host//somefile - example: vim scp://user@host//subdir1/subdir2/somefile -< - -============================================================================== -4. Network-Oriented File Transfer *netrw-xfer* {{{1 - -Network-oriented file transfer under Vim is implemented by a vim script -() using plugin techniques. It currently supports both reading and -writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, -dav/cadaver, rsync, or sftp. - -http is currently supported read-only via use of wget or fetch. - - is a standard plugin which acts as glue between Vim and the -various file transfer programs. It uses autocommand events (BufReadCmd, -FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. > - - ex. vim ftp://hostname/path/to/file -< -The characters preceding the colon specify the protocol to use; in the -example, it's ftp. The script then formulates a command or a -series of commands (typically ftp) which it issues to an external program -(ftp, scp, etc) which does the actual file transfer/protocol. Files are read -from/written to a temporary file (under Unix/Linux, /tmp/...) which the - script will clean up. - -Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first, -ftp is not a secure protocol. User names and passwords are transmitted "in -the clear" over the internet; any snooper tool can pick these up; this is not -a netrw thing, this is a ftp thing. If you're concerned about this, please -try to use scp or sftp instead. - -Netrw re-uses the user id and password during the same vim session and so long -as the remote hostname remains the same. - -Jan seems to be a bit confused about how netrw handles ftp; normally multiple -commands are performed in a "ftp session", and he seems to feel that the -uid/password should only be retained over one ftp session. However, netrw -does every ftp operation in a separate "ftp session"; so remembering the -uid/password for just one "ftp session" would be the same as not remembering -the uid/password at all. IMHO this would rapidly grow tiresome as one -browsed remote directories, for example. - -On the other hand, thanks go to Jan M. for pointing out the many -vulnerabilities that netrw (and vim itself) had had in handling "crafted" -filenames. The |shellescape()| and |fnameescape()| functions were written in -response by Bram Moolenaar to handle these sort of problems, and netrw has -been modified to use them. Still, my advice is, if the "filename" looks like -a vim command that you aren't comfortable with having executed, don't open it. - - *netrw-putty* *netrw-pscp* *netrw-psftp* -One may modify any protocol's implementing external application by setting a -variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to -"scp -q"). As an example, consider using PuTTY: > - - let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch' - let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"' -< -(note: it has been reported that windows 7 with putty v0.6's "-batch" option - doesn't work, so its best to leave it off for that system) - -See |netrw-p8| for more about putty, pscp, psftp, etc. - -Ftp, an old protocol, seems to be blessed by numerous implementations. -Unfortunately, some implementations are noisy (ie., add junk to the end of the -file). Thus, concerned users may decide to write a NetReadFixup() function -that will clean up after reading with their ftp. Some Unix systems (ie., -FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is -not noisy and more convenient, actually, for to use. -Consequently, if "fetch" is available (ie. executable), it may be preferable -to use it for ftp://... based transfers. - -For rcp, scp, sftp, and http, one may use network-oriented file transfers -transparently; ie. -> - vim rcp://[user@]machine/path - vim scp://[user@]machine/path -< -If your ftp supports <.netrc>, then it too can be transparently used -if the needed triad of machine name, user id, and password are present in -that file. Your ftp must be able to use the <.netrc> file on its own, however. -> - vim ftp://[user@]machine[[:#]portnumber]/path -< -Windows provides an ftp (typically c:\Windows\System32\ftp.exe) which uses -an option, -s:filename (filename can and probably should be a full path) -which contains ftp commands which will be automatically run whenever ftp -starts. You may use this feature to enter a user and password for one site: > - userid - password -< *netrw-windows-netrc* *netrw-windows-s* -If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines -only) netrw will substitute the current machine name requested for ftp -connections for MACHINE. Hence one can have multiple machine.ftp files -containing login and password for ftp. Example: > - - let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' - vim ftp://myhost.somewhere.net/ - -will use a file > - - C:\Users\Myself\myhost.ftp -< -Often, ftp will need to query the user for the userid and password. -The latter will be done "silently"; ie. asterisks will show up instead of -the actually-typed-in password. Netrw will retain the userid and password -for subsequent read/writes from the most recent transfer so subsequent -transfers (read/write) to or from that machine will take place without -additional prompting. - - *netrw-urls* - +=================================+============================+============+ - | Reading | Writing | Uses | - +=================================+============================+============+ - | DAV: | | | - | dav://host/path | | cadaver | - | :Nread dav://host/path | :Nwrite dav://host/path | cadaver | - +---------------------------------+----------------------------+------------+ - | DAV + SSL: | | | - | davs://host/path | | cadaver | - | :Nread davs://host/path | :Nwrite davs://host/path | cadaver | - +---------------------------------+----------------------------+------------+ - | FETCH: | | | - | fetch://[user@]host/path | | | - | fetch://[user@]host:http/path | Not Available | fetch | - | :Nread fetch://[user@]host/path| | | - +---------------------------------+----------------------------+------------+ - | FILE: | | | - | file:///* | file:///* | | - | file://localhost/* | file://localhost/* | | - +---------------------------------+----------------------------+------------+ - | FTP: (*3) | (*3) | | - | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) | - | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc | - | :Nread host path | :Nwrite host path | ftp+.netrc | - | :Nread host uid pass path | :Nwrite host uid pass path | ftp | - +---------------------------------+----------------------------+------------+ - | HTTP: wget is executable: (*4) | | | - | http://[user@]host/path | Not Available | wget | - +---------------------------------+----------------------------+------------+ - | HTTP: fetch is executable (*4) | | | - | http://[user@]host/path | Not Available | fetch | - +---------------------------------+----------------------------+------------+ - | RCP: | | | - | rcp://[user@]host/path | rcp://[user@]host/path | rcp | - +---------------------------------+----------------------------+------------+ - | RSYNC: | | | - | rsync://[user@]host/path | rsync://[user@]host/path | rsync | - | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync | - | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp | - +---------------------------------+----------------------------+------------+ - | SCP: | | | - | scp://[user@]host/path | scp://[user@]host/path | scp | - | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) | - +---------------------------------+----------------------------+------------+ - | SFTP: | | | - | sftp://[user@]host/path | sftp://[user@]host/path | sftp | - | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) | - +=================================+============================+============+ - - (*1) For an absolute path use scp://machine//path. - - (*2) if <.netrc> is present, it is assumed that it will - work with your ftp client. Otherwise the script will - prompt for user-id and password. - - (*3) for ftp, "machine" may be machine#port or machine:port - if a different port is needed than the standard ftp port - - (*4) for http:..., if wget is available it will be used. Otherwise, - if fetch is available it will be used. - -Both the :Nread and the :Nwrite ex-commands can accept multiple filenames. - - -NETRC *netrw-netrc* - -The <.netrc> file, typically located in your home directory, contains lines -therein which map a hostname (machine name) to the user id and password you -prefer to use with it. - -The typical syntax for lines in a <.netrc> file is given as shown below. -Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't. -> - machine {full machine name} login {user-id} password "{password}" - default login {user-id} password "{password}" - -Your ftp client must handle the use of <.netrc> on its own, but if the -<.netrc> file exists, an ftp transfer will not ask for the user-id or -password. - - Note: - Since this file contains passwords, make very sure nobody else can - read this file! Most programs will refuse to use a .netrc that is - readable for others. Don't forget that the system administrator can - still read the file! Ie. for Linux/Unix: chmod 600 .netrc - -Even though Windows' ftp clients typically do not support .netrc, netrw has -a work-around: see |netrw-windows-s|. - - -PASSWORD *netrw-passwd* - -The script attempts to get passwords for ftp invisibly using |inputsecret()|, -a built-in Vim function. See |netrw-userpass| for how to change the password -after one has set it. - -Unfortunately there doesn't appear to be a way for netrw to feed a password to -scp. Thus every transfer via scp will require re-entry of the password. -However, |netrw-ssh-hack| can help with this problem. - - -============================================================================== -5. Activation *netrw-activate* {{{1 - -Network-oriented file transfers are available by default whenever Vim's -|'nocompatible'| mode is enabled. Netrw's script files reside in your -system's plugin, autoload, and syntax directories; just the -plugin/netrwPlugin.vim script is sourced automatically whenever you bring up -vim. The main script in autoload/netrw.vim is only loaded when you actually -use netrw. I suggest that, at a minimum, you have at least the following in -your <.vimrc> customization file: > - - set nocp - if version >= 600 - filetype plugin indent on - endif -< -By also including the following lines in your .vimrc, one may have netrw -immediately activate when using [g]vim without any filenames, showing the -current directory: > - - " Augroup VimStartup: - augroup VimStartup - au! - au VimEnter * if expand("%") == "" | e . | endif - augroup END -< - -============================================================================== -6. Transparent Remote File Editing *netrw-transparent* {{{1 - -Transparent file transfers occur whenever a regular file read or write -(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd| -events) is made. Thus one may read, write, or source files across networks -just as easily as if they were local files! > - - vim ftp://[user@]machine/path - ... - :wq - -See |netrw-activate| for more on how to encourage your vim to use plugins -such as netrw. - -For password-free use of scp:, see |netrw-ssh-hack|. - - -============================================================================== -7. Ex Commands *netrw-ex* {{{1 - -The usual read/write commands are supported. There are also a few -additional commands available. Often you won't need to use Nwrite or -Nread as shown in |netrw-transparent| (ie. simply use > - :e URL - :r URL - :w URL -instead, as appropriate) -- see |netrw-urls|. In the explanations -below, a {netfile} is a URL to a remote file. - - *:Nwrite* *:Nw* -:[range]Nw[rite] Write the specified lines to the current - file as specified in b:netrw_lastfile. - (related: |netrw-nwrite|) - -:[range]Nw[rite] {netfile} [{netfile}]... - Write the specified lines to the {netfile}. - - *:Nread* *:Nr* -:Nr[ead] Read the lines from the file specified in b:netrw_lastfile - into the current buffer. (related: |netrw-nread|) - -:Nr[ead] {netfile} {netfile}... - Read the {netfile} after the current line. - - *:Nsource* *:Ns* -:Ns[ource] {netfile} - Source the {netfile}. - To start up vim using a remote .vimrc, one may use - the following (all on one line) (tnx to Antoine Mechelynck) > - vim -u NORC -N - --cmd "runtime plugin/netrwPlugin.vim" - --cmd "source scp://HOSTNAME/.vimrc" -< (related: |netrw-source|) - -:call NetUserPass() *NetUserPass()* - If g:netrw_uid and s:netrw_passwd don't exist, - this function will query the user for them. - (related: |netrw-userpass|) - -:call NetUserPass("userid") - This call will set the g:netrw_uid and, if - the password doesn't exist, will query the user for it. - (related: |netrw-userpass|) - -:call NetUserPass("userid","passwd") - This call will set both the g:netrw_uid and s:netrw_passwd. - The user-id and password are used by ftp transfers. One may - effectively remove the user-id and password by using empty - strings (ie. ""). - (related: |netrw-userpass|) - -:NetrwSettings This command is described in |netrw-settings| -- used to - display netrw settings and change netrw behavior. - - -============================================================================== -8. Variables and Options *netrw-var* *netrw-settings* {{{1 - -(also see: |netrw-options| |netrw-variables| |netrw-protocol| - |netrw-browser-settings| |netrw-browser-options| ) - -The script provides several variables which act as options to -affect 's file transfer behavior. These variables typically may be -set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|) - *netrw-options* -> - ------------- - Netrw Options - ------------- - Option Meaning - -------------- ----------------------------------------------- -< - b:netrw_col Holds current cursor position (during NetWrite) - g:netrw_cygwin =1 assume scp under windows is from cygwin - (default/windows) - =0 assume scp under windows accepts windows - style paths (default/else) - g:netrw_ftp =0 use default ftp (uid password) - g:netrw_ftpmode ="binary" (default) - ="ascii" (your choice) - g:netrw_ignorenetrc =1 (default) - if you have a <.netrc> file but you don't - want it used, then set this variable. Its - mere existence is enough to cause <.netrc> - to be ignored. - b:netrw_lastfile Holds latest method/machine/path. - b:netrw_line Holds current line number (during NetWrite) - g:netrw_silent =0 transfers done normally - =1 transfers done silently - g:netrw_uid Holds current user-id for ftp. - g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) - =1 use WinNT/2K/XP's rcp, binary mode - ----------------------------------------------------------------------- -< - *netrw-internal-variables* -The script will also make use of the following variables internally, albeit -temporarily. -> - ------------------- - Temporary Variables - ------------------- - Variable Meaning - -------- ------------------------------------ -< - b:netrw_method Index indicating rcp/ftp+.netrc/ftp - w:netrw_method (same as b:netrw_method) - g:netrw_machine Holds machine name parsed from input - b:netrw_fname Holds filename being accessed > - ------------------------------------------------------------ -< - *netrw-protocol* - -Netrw supports a number of protocols. These protocols are invoked using the -variables listed below, and may be modified by the user. -> - ------------------------ - Protocol Control Options - ------------------------ - Option Type Setting Meaning - --------- -------- -------------- --------------------------- -< netrw_ftp variable =doesn't exist userid set by "user userid" - =0 userid set by "user userid" - =1 userid set by "userid" - NetReadFixup function =doesn't exist no change - =exists Allows user to have files - read via ftp automatically - transformed however they wish - by NetReadFixup() - g:netrw_dav_cmd var ="cadaver" if cadaver is executable - g:netrw_dav_cmd var ="curl -o" elseif curl is executable - g:netrw_fetch_cmd var ="fetch -o" if fetch is available - g:netrw_ftp_cmd var ="ftp" - g:netrw_http_cmd var ="fetch -o" if fetch is available - g:netrw_http_cmd var ="wget -O" else if wget is available - g:netrw_http_put_cmd var ="curl -T" - |g:netrw_list_cmd| var ="ssh USEPORT HOSTNAME ls -Fa" - g:netrw_rcp_cmd var ="rcp" - g:netrw_rsync_cmd var ="rsync" - *g:netrw_rsync_sep* var ="/" used to separate the hostname - from the file spec - g:netrw_scp_cmd var ="scp -q" - g:netrw_sftp_cmd var ="sftp" > - ------------------------------------------------------------------------- -< - *netrw-ftp* - -The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|) -specify the external program to use handle the ftp protocol. They may -include command line options (such as -p for passive mode). Example: > - - let g:netrw_ftp_cmd= "ftp -p" -< -Browsing is supported by using the |g:netrw_list_cmd|; the substring -"HOSTNAME" will be changed via substitution with whatever the current request -is for a hostname. - -Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's -that give trouble . In order to best understand how to use these options if -ftp is giving you troubles, a bit of discussion is provided on how netrw does -ftp reads. - -For ftp, netrw typically builds up lines of one of the following formats in a -temporary file: -> - IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 - ---------------------------------- ------------------------------ -< - open machine [port] open machine [port] - user userid password userid password - [g:netrw_ftpmode] password - [g:netrw_ftpextracmd] [g:netrw_ftpmode] - get filename tempfile [g:netrw_extracmd] - get filename tempfile > - --------------------------------------------------------------------- -< -The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional. - -Netrw then executes the lines above by use of a filter: -> - :%! {g:netrw_ftp_cmd} -i [-n] -< -where - g:netrw_ftp_cmd is usually "ftp", - -i tells ftp not to be interactive - -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>) - -If <.netrc> exists it will be used to avoid having to query the user for -userid and password. The transferred file is put into a temporary file. -The temporary file is then read into the main editing session window that -requested it and the temporary file deleted. - -If your ftp doesn't accept the "user" command and immediately just demands a -userid, then try putting "let netrw_ftp=1" in your <.vimrc>. - - *netrw-cadaver* -To handle the SSL certificate dialog for untrusted servers, one may pull -down the certificate and place it into /usr/ssl/cert.pem. This operation -renders the server treatment as "trusted". - - *netrw-fixup* *netreadfixup* -If your ftp for whatever reason generates unwanted lines (such as AUTH -messages) you may write a NetReadFixup() function: -> - function! NetReadFixup(method,line1,line2) - " a:line1: first new line in current file - " a:line2: last new line in current file - if a:method == 1 "rcp - elseif a:method == 2 "ftp + <.netrc> - elseif a:method == 3 "ftp + machine,uid,password,filename - elseif a:method == 4 "scp - elseif a:method == 5 "http/wget - elseif a:method == 6 "dav/cadaver - elseif a:method == 7 "rsync - elseif a:method == 8 "fetch - elseif a:method == 9 "sftp - else " complain - endif - endfunction -> -The NetReadFixup() function will be called if it exists and thus allows you to -customize your reading process. - -(Related topics: |ftp| |netrw-userpass| |netrw-start|) - -============================================================================== -9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1 - *netrw-browser* *netrw-dir* *netrw-list* - -INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2 - (Quick References: |netrw-quickmaps| |netrw-quickcoms|) - -Netrw supports the browsing of directories on your local system and on remote -hosts; browsing includes listing files and directories, entering directories, -editing files therein, deleting files/directories, making new directories, -moving (renaming) files and directories, copying files and directories, etc. -One may mark files and execute any system command on them! The Netrw browser -generally implements the previous explorer's maps and commands for remote -directories, although details (such as pertinent global variable names) -necessarily differ. To browse a directory, simply "edit" it! > - - vim /your/directory/ - vim . - vim c:\your\directory\ -< -(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t| - |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| ) - -The Netrw remote file and directory browser handles two protocols: ssh and -ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp -in its remote browsing. Specifying any other protocol will cause it to be -used for file transfers; but the ssh protocol will be used to do remote -browsing. - -To use Netrw's remote directory browser, simply attempt to read a "file" with -a trailing slash and it will be interpreted as a request to list a directory: -> - vim [protocol]://[user@]hostname/path/ -< -where [protocol] is typically scp or ftp. As an example, try: > - - vim ftp://ftp.home.vim.org/pub/vim/ -< -For local directories, the trailing slash is not required. Again, because it's -easy to miss: to browse remote directories, the URL must terminate with a -slash! - -If you'd like to avoid entering the password repeatedly for remote directory -listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with -ftp, see |netrw-netrc| (if your ftp supports it). - -There are several things you can do to affect the browser's display of files: - - * To change the listing style, press the "i" key (|netrw-i|). - Currently there are four styles: thin, long, wide, and tree. - To make that change "permanent", see |g:netrw_liststyle|. - - * To hide files (don't want to see those xyz~ files anymore?) see - |netrw-ctrl-h|. - - * Press s to sort files by name, time, or size. - -See |netrw-browse-cmds| for all the things you can do with netrw! - - *netrw-getftype* *netrw-filigree* *netrw-ftype* -The |getftype()| function is used to append a bit of filigree to indicate -filetype to locally listed files: - - directory : / - executable : * - fifo : | - links : @ - sockets : = - -The filigree also affects the |g:netrw_sort_sequence|. - - -QUICK HELP *netrw-quickhelp* {{{2 - (Use ctrl-] to select a topic)~ - Intro to Browsing...............................|netrw-intro-browse| - Quick Reference: Maps.........................|netrw-quickmap| - Quick Reference: Commands.....................|netrw-browse-cmds| - Hiding - Edit hiding list..............................|netrw-ctrl-h| - Hiding Files or Directories...................|netrw-a| - Hiding/Unhiding by suffix.....................|netrw-mh| - Hiding dot-files.............................|netrw-gh| - Listing Style - Select listing style (thin/long/wide/tree)....|netrw-i| - Associated setting variable...................|g:netrw_liststyle| - Shell command used to perform listing.........|g:netrw_list_cmd| - Quick file info...............................|netrw-qf| - Sorted by - Select sorting style (name/time/size).........|netrw-s| - Editing the sorting sequence..................|netrw-S| - Sorting options...............................|g:netrw_sort_options| - Associated setting variable...................|g:netrw_sort_sequence| - Reverse sorting order.........................|netrw-r| - - - *netrw-quickmap* *netrw-quickmaps* -QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 -> - --- ----------------- ---- - Map Quick Explanation Link - --- ----------------- ---- -< Causes Netrw to issue help - Netrw will enter the directory or read the file |netrw-cr| - Netrw will attempt to remove the file/directory |netrw-del| - Edit file hiding list |netrw-ctrl-h| - Causes Netrw to refresh the directory listing |netrw-ctrl-l| - Browse using a gvim server |netrw-ctrl-r| - Shrink/expand a netrw/explore window |netrw-c-tab| - - Makes Netrw go up one directory |netrw--| - a Cycles between normal display, |netrw-a| - hiding (suppress display of files matching g:netrw_list_hide) - and showing (display only files which match g:netrw_list_hide) - cd Make browsing directory the current directory |netrw-cd| - C Setting the editing window |netrw-C| - d Make a directory |netrw-d| - D Attempt to remove the file(s)/directory(ies) |netrw-D| - gb Go to previous bookmarked directory |netrw-gb| - gd Force treatment as directory |netrw-gd| - gf Force treatment as file |netrw-gf| - gh Quick hide/unhide of dot-files |netrw-gh| - gn Make top of tree the directory below the cursor |netrw-gn| - gp Change local-only file permissions |netrw-gp| - i Cycle between thin, long, wide, and tree listings |netrw-i| - I Toggle the displaying of the banner |netrw-I| - mb Bookmark current directory |netrw-mb| - mc Copy marked files to marked-file target directory |netrw-mc| - md Apply diff to marked files (up to 3) |netrw-md| - me Place marked files on arg list and edit them |netrw-me| - mf Mark a file |netrw-mf| - mF Unmark files |netrw-mF| - mg Apply vimgrep to marked files |netrw-mg| - mh Toggle marked file suffices' presence on hiding list |netrw-mh| - mm Move marked files to marked-file target directory |netrw-mm| - mp Print marked files |netrw-mp| - mr Mark files using a shell-style |regexp| |netrw-mr| - mt Current browsing directory becomes markfile target |netrw-mt| - mT Apply ctags to marked files |netrw-mT| - mu Unmark all marked files |netrw-mu| - mv Apply arbitrary vim command to marked files |netrw-mv| - mx Apply arbitrary shell command to marked files |netrw-mx| - mX Apply arbitrary shell command to marked files en bloc|netrw-mX| - mz Compress/decompress marked files |netrw-mz| - o Enter the file/directory under the cursor in a new |netrw-o| - browser window. A horizontal split is used. - O Obtain a file specified by cursor |netrw-O| - p Preview the file |netrw-p| - P Browse in the previously used window |netrw-P| - qb List bookmarked directories and history |netrw-qb| - qf Display information on file |netrw-qf| - qF Mark files using a quickfix list |netrw-qF| - qL Mark files using a |location-list| |netrw-qL| - r Reverse sorting order |netrw-r| - R Rename the designated file(s)/directory(ies) |netrw-R| - s Select sorting style: by name, time, or file size |netrw-s| - S Specify suffix priority for name-sorting |netrw-S| - t Enter the file/directory under the cursor in a new tab|netrw-t| - u Change to recently-visited directory |netrw-u| - U Change to subsequently-visited directory |netrw-U| - v Enter the file/directory under the cursor in a new |netrw-v| - browser window. A vertical split is used. - x View file with an associated program |netrw-x| - X Execute filename under cursor via |system()| |netrw-X| - - % Open a new file in netrw's current directory |netrw-%| - - *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse* - (gvim only) selects word under mouse as if a - had been pressed (ie. edit file, change directory) - (gvim only) same as P selecting word under mouse; - see |netrw-P| - (gvim only) delete file/directory using word under - mouse - <2-leftmouse> (gvim only) when: - * in a netrw-selected file, AND - * |g:netrw_retmap| == 1 AND - * the user doesn't already have a <2-leftmouse> - mapping defined before netrw is autoloaded, - then a double clicked leftmouse button will return - to the netrw browser window. See |g:netrw_retmap|. - (gvim only) like mf, will mark files. Dragging - the shifted leftmouse will mark multiple files. - (see |netrw-mf|) - - (to disable mouse buttons while browsing: |g:netrw_mousemaps|) - - *netrw-quickcom* *netrw-quickcoms* -QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2 - :NetrwClean[!]............................................|netrw-clean| - :NetrwSettings............................................|netrw-settings| - :Ntree....................................................|netrw-ntree| - :Explore[!] [dir] Explore directory of current file......|netrw-explore| - :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore| - :Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore| - :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| - :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| - :Rexplore Return to Explorer.....................|netrw-explore| - :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore| - :Texplore[!] [dir] Tab & Explore..........................|netrw-explore| - :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| - - -BANNER DISPLAY *netrw-I* - -One may toggle the displaying of the banner by pressing "I". - -Also See: |g:netrw_banner| - - -BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2 - -One may easily "bookmark" the currently browsed directory by using > - - mb -< - *.netrwbook* -Bookmarks are retained in between sessions of vim in a file called .netrwbook -as a |List|, which is typically stored in the first directory on the user's -'runtimepath'; entries are kept in sorted order. - -If there are marked files and/or directories, mb will add them to the bookmark -list. - - *netrw-:NetrwMB* -Additionally, one may use :NetrwMB to bookmark files or directories. > - - :NetrwMB[!] [files/directories] - -< No bang: enters files/directories into Netrw's bookmark system - - No argument and in netrw buffer: - if there are marked files : bookmark marked files - otherwise : bookmark file/directory under cursor - No argument and not in netrw buffer: bookmarks current open file - Has arguments : |glob()|s each arg and bookmarks them - - With bang: deletes files/directories from Netrw's bookmark system - -The :NetrwMB command is available outside of netrw buffers (once netrw has been -invoked in the session). - -The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By -default, its stored on the first directory on the user's |'runtimepath'|. - -Related Topics: - |netrw-gb| how to return (go) to a bookmark - |netrw-mB| how to delete bookmarks - |netrw-qb| how to list bookmarks - |g:netrw_home| controls where .netrwbook is kept - - -BROWSING *netrw-enter* *netrw-cr* {{{2 - -Browsing is simple: move the cursor onto a file or directory of interest. -Hitting the (the return key) will select the file or directory. -Directories will themselves be listed, and files will be opened using the -protocol given in the original read request. - - CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that - two or more spaces delimit filenames and directory names for the long and - wide listing formats. Thus, if your filename or directory name has two or - more sequential spaces embedded in it, or any trailing spaces, then you'll - need to use the "thin" format to select it. - -The |g:netrw_browse_split| option, which is zero by default, may be used to -cause the opening of files to be done in a new window or tab instead of the -default. When the option is one or two, the splitting will be taken -horizontally or vertically, respectively. When the option is set to three, a - will cause the file to appear in a new tab. - - -When using the gui (gvim), one may select a file by pressing the -button. In addition, if - - * |g:netrw_retmap| == 1 AND (its default value is 0) - * in a netrw-selected file, AND - * the user doesn't already have a <2-leftmouse> mapping defined before - netrw is loaded - -then a doubly-clicked leftmouse button will return to the netrw browser -window. - -Netrw attempts to speed up browsing, especially for remote browsing where one -may have to enter passwords, by keeping and re-using previously obtained -directory listing buffers. The |g:netrw_fastbrowse| variable is used to -control this behavior; one may have slow browsing (no buffer re-use), medium -speed browsing (re-use directory buffer listings only for remote directories), -and fast browsing (re-use directory buffer listings as often as possible). -The price for such re-use is that when changes are made (such as new files -are introduced into a directory), the listing may become out-of-date. One may -always refresh directory listing buffers by pressing ctrl-L (see -|netrw-ctrl-l|). - - *netrw-s-cr* -Squeezing the Current Tree-Listing Directory~ - -When the tree listing style is enabled (see |netrw-i|) and one is using -gvim, then the mapping may be used to squeeze (close) the -directory currently containing the cursor. - -Otherwise, one may remap a key combination of one's own choice to get -this effect: > - - nmap YOURKEYCOMBO NetrwTreeSqueeze -< -Put this line in $HOME/ftplugin/netrw/netrw.vim; it needs to be generated -for netrw buffers only. - -Related topics: - |netrw-ctrl-r| |netrw-o| |netrw-p| - |netrw-P| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_browse_split| |g:netrw_fastbrowse| - |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| - |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_browse_reject| - |g:netrw_ssh_cmd| |g:netrw_use_noswf| - - -BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2 - -Normally one enters a file or directory using the . However, the "o" map -allows one to open a new window to hold the new directory listing or file. A -horizontal split is used. (for vertical splitting, see |netrw-v|) - -Normally, the o key splits the window horizontally with the new window and -cursor at the top. - -Associated setting variables: |g:netrw_alto| |g:netrw_winsize| - -Related topics: - |netrw-ctrl-r| |netrw-o| |netrw-p| - |netrw-P| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_alto| control above/below splitting - |g:netrw_winsize| control initial sizing - -BROWSING WITH A NEW TAB *netrw-t* {{{2 - -Normally one enters a file or directory using the . The "t" map -allows one to open a new window holding the new directory listing or file in -a new tab. - -If you'd like to have the new listing in a background tab, use |gT|. - -Related topics: - |netrw-ctrl-r| |netrw-o| |netrw-p| - |netrw-P| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_winsize| control initial sizing - -BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2 - -Normally one enters a file or directory using the . However, the "v" map -allows one to open a new window to hold the new directory listing or file. A -vertical split is used. (for horizontal splitting, see |netrw-o|) - -Normally, the v key splits the window vertically with the new window and -cursor at the left. - -There is only one tree listing buffer; using "v" on a displayed subdirectory -will split the screen, but the same buffer will be shown twice. - -Related topics: - |netrw-ctrl-r| |netrw-o| |netrw-p| - |netrw-P| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_altv| control right/left splitting - |g:netrw_winsize| control initial sizing - - -BROWSING USING A GVIM SERVER *netrw-ctrl-r* {{{2 - -One may keep a browsing gvim separate from the gvim being used to edit. -Use the map on a file (not a directory) in the netrw browser, and it -will use a gvim server (see |g:netrw_servername|). Subsequent use of -(see |netrw-cr|) will re-use that server for editing files. - -Related topics: - |netrw-ctrl-r| |netrw-o| |netrw-p| - |netrw-P| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_servername| : sets name of server - |g:netrw_browse_split| : controls how will open files - - -CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2 - -The "i" map cycles between the thin, long, wide, and tree listing formats. - -The thin listing format gives just the files' and directories' names. - -The long listing is either based on the "ls" command via ssh for remote -directories or displays the filename, file size (in bytes), and the time and -date of last modification for local directories. With the long listing -format, netrw is not able to recognize filenames which have trailing spaces. -Use the thin listing format for such files. - -The wide listing format uses two or more contiguous spaces to delineate -filenames; when using that format, netrw won't be able to recognize or use -filenames which have two or more contiguous spaces embedded in the name or any -trailing spaces. The thin listing format will, however, work with such files. -The wide listing format is the most compact. - -The tree listing format has a top directory followed by files and directories -preceded by one or more "|"s, which indicate the directory depth. One may -open and close directories by pressing the key while atop the directory -name. - -One may make a preferred listing style your default; see |g:netrw_liststyle|. -As an example, by putting the following line in your .vimrc, > - let g:netrw_liststyle= 3 -the tree style will become your default listing style. - -One typical way to use the netrw tree display is to: > - - vim . - (use i until a tree display shows) - navigate to a file - v (edit as desired in vertically split window) - ctrl-w h (to return to the netrw listing) - P (edit newly selected file in the previous window) - ctrl-w h (to return to the netrw listing) - P (edit newly selected file in the previous window) - ...etc... -< -Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen| - |g:netrw_timefmt| |g:netrw_list_cmd| - -CHANGE FILE PERMISSION *netrw-gp* {{{2 - -"gp" will ask you for a new permission for the file named under the cursor. -Currently, this only works for local files. - -Associated setting variables: |g:netrw_chgperm| - - -CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2 - -To change directory back to a bookmarked directory, use - - {cnt}gb - -Any count may be used to reference any of the bookmarks. -Note that |netrw-qb| shows both bookmarks and history; to go -to a location stored in the history see |netrw-u| and |netrw-U|. - -Related Topics: - |netrw-mB| how to delete bookmarks - |netrw-mb| how to make a bookmark - |netrw-qb| how to list bookmarks - - -CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2 - -Every time you change to a new directory (new for the current session), netrw -will save the directory in a recently-visited directory history list (unless -|g:netrw_dirhistmax| is zero; by default, it holds ten entries). With the "u" -map, one can change to an earlier directory (predecessor). To do the -opposite, see |netrw-U|. - -The "u" map also accepts counts to go back in the history several slots. For -your convenience, qb (see |netrw-qb|) lists the history number which may be -used in that count. - - *.netrwhist* -See |g:netrw_dirhistmax| for how to control the quantity of history stack -slots. The file ".netrwhist" holds history when netrw (and vim) is not -active. By default, its stored on the first directory on the user's -|'runtimepath'|. - -Related Topics: - |netrw-U| changing to a successor directory - |g:netrw_home| controls where .netrwhist is kept - - -CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2 - -With the "U" map, one can change to a later directory (successor). -This map is the opposite of the "u" map. (see |netrw-u|) Use the -qb map to list both the bookmarks and history. (see |netrw-qb|) - -The "U" map also accepts counts to go forward in the history several slots. - -See |g:netrw_dirhistmax| for how to control the quantity of history stack -slots. - - -CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2 - -One may specify a new tree top for tree listings using > - - :Ntree [dirname] - -Without a "dirname", the current line is used (and any leading depth -information is elided). -With a "dirname", the specified directory name is used. - -The "gn" map will take the word below the cursor and use that for -changing the top of the tree listing. - - -NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2 - -With :NetrwClean one may easily remove netrw from one's home directory; -more precisely, from the first directory on your |'runtimepath'|. - -With :NetrwClean!, netrw will attempt to remove netrw from all directories on -your |'runtimepath'|. Of course, you have to have write/delete permissions -correct to do this. - -With either form of the command, netrw will first ask for confirmation -that the removal is in fact what you want to do. If netrw doesn't have -permission to remove a file, it will issue an error message. - -CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2 - -Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are -best seen with a special handler (ie. a tool provided with your computer's -operating system). Netrw allows one to invoke such special handlers by: - - * hitting gx with the cursor atop the file path or alternatively x - in a netrw buffer; the former can be disabled by defining the - |g:netrw_nogx| variable - * when in command line, typing :Open , see |:Open| below. - -One may also use visual mode (see |visual-start|) to select the text that the -special handler will use. Normally gx checks for a close-by URL or file name -to pick up the text under the cursor; one may change what |expand()| uses via the -|g:netrw_gx| variable (options include "", ""). Note that -expand("") depends on the |'isfname'| setting. Alternatively, one may -select the text to be used by gx by making a visual selection (see -|visual-block|) and then pressing gx. - -The selection function can be adapted for each filetype by adding a function -`Netrw_get_URL_`, where is given by the 'filetype'. -The function should return the URL or file name to be used by gx, and will -fall back to the default behavior if it returns an empty string. -For example, special handlers for links Markdown and HTML are - -" make gx work on concealed links regardless of exact cursor position: > - - function Netrw_get_URL_markdown() - " markdown URL such as [link text](http://ya.ru 'yandex search') - try - let save_view = winsaveview() - if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0 - return matchstr(getline('.')[col('.')-1:], - \ '\[.\{-}\](\zs' .. g:netrw_regex_url .. '\ze\(\s\+.\{-}\)\?)') - endif - return '' - finally - call winrestview(save_view) - endtry - endfunction - - function Netrw_get_URL_html() - " HTML URL such as Python is here - " - try - let save_view = winsaveview() - if searchpair('\|/>\)\zs', 'cbW', '', line('.')) > 0 - return matchstr(getline('.')[col('.') - 1 : ], - \ 'href=["'.."'"..']\?\zs\S\{-}\ze["'.."'"..']\?/\?>') - endif - return '' - finally - call winrestview(save_view) - endtry - endfunction -< -Other than a file path, the text under the cursor may be a URL. Netrw uses -by default the following regular expression to determine if the text under the -cursor is a URL: -> - :let g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}' -< -Associated setting variables: - |g:netrw_gx| control how gx picks up the text under the cursor - |g:netrw_nogx| prevent gx map while editing - |g:netrw_suppress_gx_mesg| controls gx's suppression of browser messages - -OPENING FILES AND LAUNCHING APPS *netrw-gx* *:Open* *:Launch* {{{2 - -Netrw determines which special handler by the following method: - - * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to - view files. - If the viewer you wish to use does not support handling of a remote URL - directory, set |g:netrw_browsex_support_remote| to 0. - * otherwise: - - * for Windows : explorer.exe is used - * for Mac OS X : open is used. - * for Linux : xdg-open is used. - -To open a path (or URL) by the appropriate handler, type > - - :Open -< -No escaping, neither for the shell nor for Vim's command-line, is needed. - -To launch a specific application , often being > - - :Launch . - -Since can be arbitrarily complex, in particular contain many file -paths, the escaping is left to the user. - -If you disabled the netrw plugin by setting g:loaded_netrwPlugin (see -|netrw-noload|), then you can use > - - :call netrw#Launch(' ') - :call netrw#Open('') -< - *netrw-curdir* -DELETING BOOKMARKS *netrw-mB* {{{2 - -To delete a bookmark, use > - - {cnt}mB - -If there are marked files, then mB will remove them from the -bookmark list. - -Alternatively, one may use :NetrwMB! (see |netrw-:NetrwMB|). > - - :NetrwMB! [files/directories] - -Related Topics: - |netrw-gb| how to return (go) to a bookmark - |netrw-mb| how to make a bookmark - |netrw-qb| how to list bookmarks - - -DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2 - -If files have not been marked with |netrw-mf|: (local marked file list) - - Deleting/removing files and directories involves moving the cursor to the - file/directory to be deleted and pressing "D". Directories must be empty - first before they can be successfully removed. If the directory is a - softlink to a directory, then netrw will make two requests to remove the - directory before succeeding. Netrw will ask for confirmation before doing - the removal(s). You may select a range of lines with the "V" command - (visual selection), and then pressing "D". - -If files have been marked with |netrw-mf|: (local marked file list) - - Marked files (and empty directories) will be deleted; again, you'll be - asked to confirm the deletion before it actually takes place. - -A further approach is to delete files which match a pattern. - - * use :MF pattern (see |netrw-:MF|); then press "D". - - * use mr (see |netrw-mr|) which will prompt you for pattern. - This will cause the matching files to be marked. Then, - press "D". - -Please note that only empty directories may be deleted with the "D" mapping. -Regular files are deleted with |delete()|, too. - -The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are -used to control the attempts to remove remote files and directories. The -g:netrw_rm_cmd is used with files, and its default value is: - - g:netrw_rm_cmd: ssh HOSTNAME rm - -The g:netrw_rmdir_cmd variable is used to support the removal of directories. -Its default value is: - - |g:netrw_rmdir_cmd|: ssh HOSTNAME rmdir - -If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt -to remove it again using the g:netrw_rmf_cmd variable. Its default value is: - - |g:netrw_rmf_cmd|: ssh HOSTNAME rm -f - -Related topics: |netrw-d| -Associated setting variable: |g:netrw_rm_cmd| |g:netrw_ssh_cmd| - - -*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore* -*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore* *netrw-lexplore* -DIRECTORY EXPLORATION COMMANDS {{{2 - - :[N]Explore[!] [dir]... Explore directory of current file *:Explore* - :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore* - :[N]Lexplore[!] [dir]... Left Explorer Toggle *:Lexplore* - :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore* - :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore* - :Texplore [dir]... Tab & Explore *:Texplore* - :Rexplore ... Return to/from Explorer *:Rexplore* - - Used with :Explore **/pattern : (also see |netrw-starstar|) - :Nexplore............. go to next matching file *:Nexplore* - :Pexplore............. go to previous matching file *:Pexplore* - - *netrw-:Explore* -:Explore will open the local-directory browser on the current file's - directory (or on directory [dir] if specified). The window will be - split only if the file has been modified and |'hidden'| is not set, - otherwise the browsing window will take over that window. Normally - the splitting is taken horizontally. - Also see: |netrw-:Rexplore| -:Explore! is like :Explore, but will use vertical splitting. - - *netrw-:Hexplore* -:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting. -:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting. - - *netrw-:Lexplore* -:[N]Lexplore [dir] toggles a full height Explorer window on the left hand side - of the current tab. It will open a netrw window on the current - directory if [dir] is omitted; a :Lexplore [dir] will show the - specified directory in the left-hand side browser display no matter - from which window the command is issued. - - By default, :Lexplore will change an uninitialized |g:netrw_chgwin| - to 2; edits will thus preferentially be made in window#2. - - The [N] specifies a |g:netrw_winsize| just for the new :Lexplore - window. That means that - if [N] < 0 : use |N| columns for the Lexplore window - if [N] = 0 : a normal split is made - if [N] > 0 : use N% of the current window will be used for the - new window - - Those who like this method often also like tree style displays; - see |g:netrw_liststyle|. - -:[N]Lexplore! [dir] is similar to :Lexplore, except that the full-height - Explorer window will open on the right hand side and an - uninitialized |g:netrw_chgwin| will be set to 1 (eg. edits will - preferentially occur in the leftmost window). - - Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw| - |netrw-p| |netrw-P| |g:netrw_chgwin| - |netrw-c-tab| |g:netrw_winsize| - - *netrw-:Sexplore* -:[N]Sexplore will always split the window before invoking the local-directory - browser. As with Explore, the splitting is normally done - horizontally. -:[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically. - - *netrw-:Texplore* -:Texplore [dir] does a |:tabnew| before generating the browser window - - *netrw-:Vexplore* -:[N]Vexplore [dir] does an :Explore with |:leftabove| vertical splitting. -:[N]Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting. - -The optional parameters are: - - [N]: This parameter will override |g:netrw_winsize| to specify the quantity of - rows and/or columns the new explorer window should have. - Otherwise, the |g:netrw_winsize| variable, if it has been specified by the - user, is used to control the quantity of rows and/or columns new - explorer windows should have. - - [dir]: By default, these explorer commands use the current file's directory. - However, one may explicitly provide a directory (path) to use instead; - ie. > - - :Explore /some/path -< - *netrw-:Rexplore* -:Rexplore This command is a little different from the other Explore commands - as it doesn't necessarily open an Explorer window. - - Return to Explorer~ - When one edits a file using netrw which can occur, for example, - when pressing while the cursor is atop a filename in a netrw - browser window, a :Rexplore issued while editing that file will - return the display to that of the last netrw browser display in - that window. - - Return from Explorer~ - Conversely, when one is editing a directory, issuing a :Rexplore - will return to editing the file that was last edited in that - window. - - The <2-leftmouse> map (which is only available under gvim and - cooperative terms) does the same as :Rexplore. - -Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize| - - -*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* *netrw-grep* -EXPLORING WITH STARS AND PATTERNS {{{2 - -When Explore, Sexplore, Hexplore, or Vexplore are used with one of the -following four patterns Explore generates a list of files which satisfy the -request for the local file system. These exploration patterns will not work -with remote file browsing. - - */filepat files in current directory which satisfy filepat - **/filepat files in current directory or below which satisfy the - file pattern - *//pattern files in the current directory which contain the - pattern (vimgrep is used) - **//pattern files in the current directory or below which contain - the pattern (vimgrep is used) -< -The cursor will be placed on the first file in the list. One may then -continue to go to subsequent files on that list via |:Nexplore| or to -preceding files on that list with |:Pexplore|. Explore will update the -directory and place the cursor appropriately. - -A plain > - :Explore -will clear the explore list. - -If your console or gui produces recognizable shift-up or shift-down sequences, -then you'll likely find using shift-downarrow and shift-uparrow convenient. -They're mapped by netrw as follows: - - == Nexplore, and - == Pexplore. - -As an example, consider -> - :Explore */*.c - :Nexplore - :Nexplore - :Pexplore -< -The status line will show, on the right hand side of the status line, a -message like "Match 3 of 20". - -Associated setting variables: - |g:netrw_keepdir| |g:netrw_browse_split| - |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject| - |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| - |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd| - |g:netrw_liststyle| - - -DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2 - -With the cursor atop a filename, pressing "qf" will reveal the file's size -and last modification timestamp. Currently this capability is only available -for local files. - - -EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2 - -The "" map brings up a requestor allowing the user to change the -file/directory hiding list contained in |g:netrw_list_hide|. The hiding list -consists of one or more patterns delimited by commas. Files and/or -directories satisfying these patterns will either be hidden (ie. not shown) or -be the only ones displayed (see |netrw-a|). - -The "gh" mapping (see |netrw-gh|) quickly alternates between the usual -hiding list and the hiding of files or directories that begin with ".". - -As an example, > - let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' -Effectively, this makes the effect of a |netrw-gh| command the initial setting. -What it means: - - \(^\|\s\s\) : if the line begins with the following, -or- - two consecutive spaces are encountered - \zs : start the hiding match now - \. : if it now begins with a dot - \S\+ : and is followed by one or more non-whitespace - characters - -Associated setting variables: |g:netrw_hide| |g:netrw_list_hide| -Associated topics: |netrw-a| |netrw-gh| |netrw-mh| - - *netrw-sort-sequence* -EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2 - -When "Sorted by" is name, one may specify priority via the sorting sequence -(g:netrw_sort_sequence). The sorting sequence typically prioritizes the -name-listing by suffix, although any pattern will do. Patterns are delimited -by commas. The default sorting sequence is (all one line): - -For Unix: > - '[\/]$,\ - '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$, - \.swp$,\.bak$,\~$' -< -The lone * is where all filenames not covered by one of the other patterns -will end up. One may change the sorting sequence by modifying the -g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by -using the "S" map. - -Related topics: |netrw-s| |netrw-S| -Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options| - - -EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X* {{{2 - -Pressing X while the cursor is atop an executable file will yield a prompt -using the filename asking for any arguments. Upon pressing a [return], netrw -will then call |system()| with that command and arguments. The result will be -displayed by |:echomsg|, and so |:messages| will repeat display of the result. -Ansi escape sequences will be stripped out. - -See |cmdline-window| for directions for more on how to edit the arguments. - - -FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2 - -Remote symbolic links (ie. those listed via ssh or ftp) are problematic -in that it is difficult to tell whether they link to a file or to a -directory. - -To force treatment as a file: use > - gf -< -To force treatment as a directory: use > - gd -< - -GOING UP *netrw--* {{{2 - -To go up a directory, press "-" or press the when atop the ../ directory -entry in the listing. - -Netrw will use the command in |g:netrw_list_cmd| to perform the directory -listing operation after changing HOSTNAME to the host specified by the -user-prpvided url. By default netrw provides the command as: > - - ssh HOSTNAME ls -FLa -< -where the HOSTNAME becomes the [user@]hostname as requested by the attempt to -read. Naturally, the user may override this command with whatever is -preferred. The NetList function which implements remote browsing -expects that directories will be flagged by a trailing slash. - - -HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2 - -Netrw's browsing facility allows one to use the hiding list in one of three -ways: ignore it, hide files which match, and show only those files which -match. - -If no files have been marked via |netrw-mf|: - -The "a" map allows the user to cycle through the three hiding modes. - -The |g:netrw_list_hide| variable holds a comma delimited list of patterns -based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list. -(also see |netrw-ctrl-h|) To set the hiding list, use the map. As an -example, to hide files which begin with a ".", one may use the map to -set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*' -in one's <.vimrc>). One may then use the "a" key to show all files, hide -matching files, or to show only the matching files. - - Example: \.[ch]$ - This hiding list command will hide/show all *.c and *.h files. - - Example: \.c$,\.h$ - This hiding list command will also hide/show all *.c and *.h - files. - -Don't forget to use the "a" map to select the mode (normal/hiding/show) you -want! - -If files have been marked using |netrw-mf|, then this command will: - - if showing all files or non-hidden files: - modify the g:netrw_list_hide list by appending the marked files to it - and showing only non-hidden files. - - else if showing hidden files only: - modify the g:netrw_list_hide list by removing the marked files from it - and showing only non-hidden files. - endif - - *netrw-gh* *netrw-hide* -As a quick shortcut, one may press > - gh -to toggle between hiding files which begin with a period (dot) and not hiding -them. - -Associated setting variables: |g:netrw_list_hide| |g:netrw_hide| -Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh| - - *netrw-gitignore* -Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with -|g:netrw_list_hide| automatically hides all git-ignored files. - -'netrw_gitignore#Hide' searches for patterns in the following files: > - - './.gitignore' - './.git/info/exclude' - global gitignore file: `git config --global core.excludesfile` - system gitignore file: `git config --system core.excludesfile` -< -Files that do not exist, are ignored. -Git-ignore patterns are taken from existing files, and converted to patterns for -hiding files. For example, if you had '*.log' in your '.gitignore' file, it -would be converted to '.*\.log'. - -To use this function, simply assign its output to |g:netrw_list_hide| option. > - - Example: let g:netrw_list_hide= netrw_gitignore#Hide() - Git-ignored files are hidden in Netrw. - - Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file') - Function can take additional files with git-ignore patterns. - - Example: let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' - Combining 'netrw_gitignore#Hide' with custom patterns. -< - -IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2 - -Especially with the remote directory browser, constantly entering the password -is tedious. - -For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength -tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip -for setting up no-password ssh and scp and discusses associated security -issues. It used to be available at http://hacks.oreilly.com/pub/h/66 , -but apparently that address is now being redirected to some "hackzine". -I'll attempt a summary based on that article and on a communication from -Ben Schmidt: - - 1. Generate a public/private key pair on the local machine - (ssh client): > - ssh-keygen -t rsa - (saving the file in ~/.ssh/id_rsa as prompted) -< - 2. Just hit the when asked for passphrase (twice) for no - passphrase. If you do use a passphrase, you will also need to use - ssh-agent so you only have to type the passphrase once per session. - If you don't use a passphrase, simply logging onto your local - computer or getting access to the keyfile in any way will suffice - to access any ssh servers which have that key authorized for login. - - 3. This creates two files: > - ~/.ssh/id_rsa - ~/.ssh/id_rsa.pub -< - 4. On the target machine (ssh server): > - cd - mkdir -p .ssh - chmod 0700 .ssh -< - 5. On your local machine (ssh client): (one line) > - ssh {serverhostname} - cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub -< - or, for OpenSSH, (one line) > - ssh {serverhostname} - cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub -< -You can test it out with > - ssh {serverhostname} -and you should be log onto the server machine without further need to type -anything. - -If you decided to use a passphrase, do: > - ssh-agent $SHELL - ssh-add - ssh {serverhostname} -You will be prompted for your key passphrase when you use ssh-add, but not -subsequently when you use ssh. For use with vim, you can use > - ssh-agent vim -and, when next within vim, use > - :!ssh-add -Alternatively, you can apply ssh-agent to the terminal you're planning on -running vim in: > - ssh-agent xterm & -and do ssh-add whenever you need. - -For Windows, folks on the vim mailing list have mentioned that Pageant helps -with avoiding the constant need to enter the password. - -Kingston Fung wrote about another way to avoid constantly needing to enter -passwords: - - In order to avoid the need to type in the password for scp each time, you - provide a hack in the docs to set up a non password ssh account. I found a - better way to do that: I can use a regular ssh account which uses a - password to access the material without the need to key-in the password - each time. It's good for security and convenience. I tried ssh public key - authorization + ssh-agent, implementing this, and it works! - - - Ssh hints: - - Thomer Gil has provided a hint on how to speed up netrw+ssh: - http://thomer.com/howtos/netrw_ssh.html - - Alex Young has several hints on speeding ssh up: - http://usevim.com/2012/03/16/editing-remote-files/ - - -LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2 - -Pressing "qb" (query bookmarks) will list both the bookmarked directories and -directory traversal history. - -Related Topics: - |netrw-gb| how to return (go) to a bookmark - |netrw-mb| how to make a bookmark - |netrw-mB| how to delete bookmarks - |netrw-u| change to a predecessor directory via the history stack - |netrw-U| change to a successor directory via the history stack - -MAKING A NEW DIRECTORY *netrw-d* {{{2 - -With the "d" map one may make a new directory either remotely (which depends -on the global variable g:netrw_mkdir_cmd) or locally (which depends on the -global variable g:netrw_localmkdir). Netrw will issue a request for the new -directory's name. A bare at that point will abort the making of the -directory. Attempts to make a local directory that already exists (as either -a file or a directory) will be detected, reported on, and ignored. - -Related topics: |netrw-D| -Associated setting variables: |g:netrw_localmkdir| |g:netrw_mkdir_cmd| - |g:netrw_remote_mkdir| |netrw-%| - - -MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-cd* {{{2 - -By default, |g:netrw_keepdir| is 1. This setting means that the current -directory will not track the browsing directory. (done for backwards -compatibility with v6's file explorer). - -Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory -track netrw's browsing directory. - -However, given the default setting for g:netrw_keepdir of 1 where netrw -maintains its own separate notion of the current directory, in order to make -the two directories the same, use the "cd" map (type cd). That map will -set Vim's notion of the current directory to netrw's current browsing -directory. - -|netrw-cd| : This map's name was changed from "c" to cd (see |netrw-cd|). - This change was done to allow for |netrw-cb| and |netrw-cB| maps. - -Associated setting variable: |g:netrw_keepdir| - -MARKING FILES *netrw-:MF* *netrw-mf* {{{2 - (also see |netrw-mr|) - -Netrw provides several ways to mark files: - - * One may mark files with the cursor atop a filename and - then pressing "mf". - - * With gvim, in addition one may mark files with - . (see |netrw-mouse|) - - * One may use the :MF command, which takes a list of - files (for local directories, the list may include - wildcards -- see |glob()|) > - - :MF *.c -< - (Note that :MF uses || to break the line - at spaces) - - * Mark files using the |argument-list| (|netrw-mA|) - - * Mark files based upon a |location-list| (|netrw-qL|) - - * Mark files based upon the quickfix list (|netrw-qF|) - (|quickfix-error-lists|) - -The following netrw maps make use of marked files: - - |netrw-a| Hide marked files/directories - |netrw-D| Delete marked files/directories - |netrw-ma| Move marked files' names to |arglist| - |netrw-mA| Move |arglist| filenames to marked file list - |netrw-mb| Append marked files to bookmarks - |netrw-mB| Delete marked files from bookmarks - |netrw-mc| Copy marked files to target - |netrw-md| Apply vimdiff to marked files - |netrw-me| Edit marked files - |netrw-mF| Unmark marked files - |netrw-mg| Apply vimgrep to marked files - |netrw-mm| Move marked files to target - |netrw-mp| Print marked files - |netrw-ms| Netrw will source marked files - |netrw-mt| Set target for |netrw-mm| and |netrw-mc| - |netrw-mT| Generate tags using marked files - |netrw-mv| Apply vim command to marked files - |netrw-mx| Apply shell command to marked files - |netrw-mX| Apply shell command to marked files, en bloc - |netrw-mz| Compress/Decompress marked files - |netrw-O| Obtain marked files - |netrw-R| Rename marked files - -One may unmark files one at a time the same way one marks them; ie. place -the cursor atop a marked file and press "mf". This process also works -with using gvim. One may unmark all files by pressing -"mu" (see |netrw-mu|). - -Marked files are highlighted using the "netrwMarkFile" highlighting group, -which by default is linked to "Identifier" (see Identifier under -|group-name|). You may change the highlighting group by putting something -like > - - highlight clear netrwMarkFile - hi link netrwMarkFile ..whatever.. -< -into $HOME/.vim/after/syntax/netrw.vim . - -If the mouse is enabled and works with your vim, you may use to -mark one or more files. You may mark multiple files by dragging the shifted -leftmouse. (see |netrw-mouse|) - - *markfilelist* *global_markfilelist* *local_markfilelist* -All marked files are entered onto the global marked file list; there is only -one such list. In addition, every netrw buffer also has its own buffer-local -marked file list; since netrw buffers are associated with specific -directories, this means that each directory has its own local marked file -list. The various commands which operate on marked files use one or the other -of the marked file lists. - -Known Problem: if one is using tree mode (|g:netrw_liststyle|) and several -directories have files with the same name, then marking such a file will -result in all such files being highlighted as if they were all marked. The -|markfilelist|, however, will only have the selected file in it. This problem -is unlikely to be fixed. - - -UNMARKING FILES *netrw-mF* {{{2 - (also see |netrw-mf|, |netrw-mu|) - -The "mF" command will unmark all files in the current buffer. One may also use -mf (|netrw-mf|) on a specific, already marked, file to unmark just that file. - -MARKING FILES BY LOCATION LIST *netrw-qL* {{{2 - (also see |netrw-mf|) - -One may convert |location-list|s into a marked file list using "qL". -You may then proceed with commands such as me (|netrw-me|) to edit them. - - -MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2 - (also see |netrw-mf|) - -One may convert |quickfix-error-lists| into a marked file list using "qF". -You may then proceed with commands such as me (|netrw-me|) to edit them. -Quickfix error lists are generated, for example, by calls to |:vimgrep|. - - -MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2 - (also see |netrw-mf|) - -One may also mark files by pressing "mr"; netrw will then issue a prompt, -"Enter regexp: ". You may then enter a shell-style regular expression such -as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw -converts "*" into ".*" (see |regexp|) and marks files based on that. In the -future I may make it possible to use |regexp|s instead of glob()-style -expressions (yet-another-option). - -See |cmdline-window| for directions on more on how to edit the regular -expression. - - -MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked-file list) - -The "mv" map causes netrw to execute an arbitrary vim command on each file on -the local marked file list, individually: - - * 1split - * sil! keepalt e file - * run vim command - * sil! keepalt wq! - -A prompt, "Enter vim command: ", will be issued to elicit the vim command you -wish used. See |cmdline-window| for directions for more on how to edit the -command. - - -MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked-file list) - -Upon activation of the "mx" map, netrw will query the user for some (external) -command to be applied to all marked files. All "%"s in the command will be -substituted with the name of each marked file in turn. If no "%"s are in the -command, then the command will be followed by a space and a marked filename. - -Example: - (mark files) - mx - Enter command: cat - - The result is a series of shell commands: - cat 'file1' - cat 'file2' - ... - - -MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked-file list) - -Upon activation of the 'mX' map, netrw will query the user for some (external) -command to be applied to all marked files on the global marked file list. The -"en bloc" means that one command will be executed on all the files at once: > - - command files - -This approach is useful, for example, to select files and make a tarball: > - - (mark files) - mX - Enter command: tar cf mynewtarball.tar -< -The command that will be run with this example: - - tar cf mynewtarball.tar 'file1' 'file2' ... - - -MARKED FILES: ARGUMENT LIST *netrw-ma* *netrw-mA* - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked-file list) - -Using ma, one moves filenames from the marked file list to the argument list. -Using mA, one moves filenames from the argument list to the marked file list. - -See Also: |netrw-cb| |netrw-cB| |netrw-qF| |argument-list| |:args| - - -MARKED FILES: BUFFER LIST *netrw-cb* *netrw-cB* - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked-file list) - -Using cb, one moves filenames from the marked file list to the buffer list. -Using cB, one copies filenames from the buffer list to the marked file list. - -See Also: |netrw-ma| |netrw-mA| |netrw-qF| |buffer-list| |:buffers| - - -MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked file list) - -If any marked files are compressed, then "mz" will decompress them. -If any marked files are decompressed, then "mz" will compress them -using the command specified by |g:netrw_compress|; by default, -that's "gzip". - -For decompression, netrw uses a |Dictionary| of suffices and their -associated decompressing utilities; see |g:netrw_decompress|. - -Remember that one can mark multiple files by regular expression -(see |netrw-mr|); this is particularly useful to facilitate compressing and -decompressing a large number of files. - -Associated setting variables: |g:netrw_compress| |g:netrw_decompress| - -MARKED FILES: COPYING *netrw-mc* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (Uses the global marked file list) - -Select a target directory with mt (|netrw-mt|). Then change directory, -select file(s) (see |netrw-mf|), and press "mc". The copy is done -from the current window (where one does the mf) to the target. - -If one does not have a target directory set with |netrw-mt|, then netrw -will query you for a directory to copy to. - -One may also copy directories and their contents (local only) to a target -directory. - -Associated setting variables: - |g:netrw_localcopycmd| |g:netrw_localcopycmdopt| - |g:netrw_localcopydircmd| |g:netrw_localcopydircmdopt| - |g:netrw_ssh_cmd| - -MARKED FILES: DIFF *netrw-md* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked file list) - -Use |vimdiff| to visualize difference between selected files (two or -three may be selected for this). Uses the global marked file list. - -MARKED FILES: EDITING *netrw-me* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked file list) - -The "me" command will place the marked files on the |arglist| and commence -editing them. One may return the to explorer window with |:Rexplore|. -(use |:n| and |:p| to edit next and previous files in the arglist) - -MARKED FILES: GREP *netrw-mg* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked file list) - -The "mg" command will apply |:vimgrep| to the marked files. -The command will ask for the requested pattern; one may then enter: > - - /pattern/[g][j] - ! /pattern/[g][j] - pattern -< -With /pattern/, editing will start with the first item on the |quickfix| list -that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|, |:cclose|). The |:vimgrep| -command is in use, so without 'g' each line is added to quickfix list only -once; with 'g' every match is included. - -With /pattern/j, "mg" will winnow the current marked file list to just those -marked files also possessing the specified pattern. Thus, one may use > - - mr ...file-pattern... - mg /pattern/j -< -to have a marked file list satisfying the file-pattern but also restricted to -files containing some desired pattern. - - -MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked file list) - -The "mh" command extracts the suffices of the marked files and toggles their -presence on the hiding list. Please note that marking the same suffix -this way multiple times will result in the suffix's presence being toggled -for each file (so an even quantity of marked files having the same suffix -is the same as not having bothered to select them at all). - -Related topics: |netrw-a| |g:netrw_list_hide| - -MARKED FILES: MOVING *netrw-mm* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked file list) - - WARNING: moving files is more dangerous than copying them. - A file being moved is first copied and then deleted; if the - copy operation fails and the delete succeeds, you will lose - the file. Either try things out with unimportant files - first or do the copy and then delete yourself using mc and D. - Use at your own risk! - -Select a target directory with mt (|netrw-mt|). Then change directory, -select file(s) (see |netrw-mf|), and press "mm". The move is done -from the current window (where one does the mf) to the target. - -Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd| - -MARKED FILES: PRINTING *netrw-mp* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked file list) - -When "mp" is used, netrw will apply the |:hardcopy| command to marked files. -What netrw does is open each file in a one-line window, execute hardcopy, then -close the one-line window. - - -MARKED FILES: SOURCING *netrw-ms* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked file list) - -With "ms", netrw will source the marked files (using vim's |:source| command) - - -MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - -Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|): - - * If the cursor is atop a file name, then the netrw window's currently - displayed directory is used for the copy/move-to target. - - * Also, if the cursor is in the banner, then the netrw window's currently - displayed directory is used for the copy/move-to target. - Unless the target already is the current directory. In which case, - typing "mf" clears the target. - - * However, if the cursor is atop a directory name, then that directory is - used for the copy/move-to target - - * One may use the :MT [directory] command to set the target *netrw-:MT* - This command uses ||, so spaces in the directory name are - permitted without escaping. - - * With mouse-enabled vim or with gvim, one may select a target by using - - -There is only one copy/move-to target at a time in a vim session; ie. the -target is a script variable (see |s:var|) and is shared between all netrw -windows (in an instance of vim). - -When using menus and gvim, netrw provides a "Targets" entry which allows one -to pick a target from the list of bookmarks and history. - -Related topics: - Marking Files......................................|netrw-mf| - Marking Files by Regular Expression................|netrw-mr| - Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| - Marked Files: Target Directory Using History.......|netrw-Th| - - -MARKED FILES: TAGGING *netrw-mT* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the global marked file list) - -The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is -"ctags") to marked files. For remote browsing, in order to create a tags file -netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for -this to work on remote systems. For your local system, see |ctags| on how to -get a version. I myself use hdrtags, currently available at -http://www.drchip.org/astronaut/src/index.html , and have > - - let g:netrw_ctags= "hdrtag" -< -in my <.vimrc>. - -When a remote set of files are tagged, the resulting tags file is "obtained"; -ie. a copy is transferred to the local system's directory. The now local tags -file is then modified so that one may use it through the network. The -modification made concerns the names of the files in the tags; each filename is -preceded by the netrw-compatible URL used to obtain it. When one subsequently -uses one of the go to tag actions (|tags|), the URL will be used by netrw to -edit the desired file and go to the tag. - -Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd| - -MARKED FILES: TARGET DIRECTORY USING BOOKMARKS *netrw-Tb* {{{2 - -Sets the marked file copy/move-to target. - -The |netrw-qb| map will give you a list of bookmarks (and history). -One may choose one of the bookmarks to become your marked file -target by using [count]Tb (default count: 1). - -Related topics: - Copying files to target............................|netrw-mc| - Listing Bookmarks and History......................|netrw-qb| - Marked Files: Setting The Target Directory.........|netrw-mt| - Marked Files: Target Directory Using History.......|netrw-Th| - Marking Files......................................|netrw-mf| - Marking Files by Regular Expression................|netrw-mr| - Moving files to target.............................|netrw-mm| - - -MARKED FILES: TARGET DIRECTORY USING HISTORY *netrw-Th* {{{2 - -Sets the marked file copy/move-to target. - -The |netrw-qb| map will give you a list of history (and bookmarks). -One may choose one of the history entries to become your marked file -target by using [count]Th (default count: 0; ie. the current directory). - -Related topics: - Copying files to target............................|netrw-mc| - Listing Bookmarks and History......................|netrw-qb| - Marked Files: Setting The Target Directory.........|netrw-mt| - Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| - Marking Files......................................|netrw-mf| - Marking Files by Regular Expression................|netrw-mr| - Moving files to target.............................|netrw-mm| - - -MARKED FILES: UNMARKING *netrw-mu* {{{2 - (See |netrw-mf|, |netrw-mF|) - -The "mu" mapping will unmark all currently marked files. This command differs -from "mF" as the latter only unmarks files in the current directory whereas -"mu" will unmark global and all buffer-local marked files. -(see |netrw-mF|) - - - *netrw-browser-settings* -NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2 - -(if you're interested in the netrw file transfer settings, see |netrw-options| - and |netrw-protocol|) - -The browser provides settings in the form of variables which -you may modify; by placing these settings in your <.vimrc>, you may customize -your browsing preferences. (see also: |netrw-settings|) -> - --- ----------- - Var Explanation - --- ----------- -< *g:netrw_altfile* some like |CTRL-^| to return to the last - edited file. Choose that by setting this - parameter to 1. - Others like |CTRL-^| to return to the - netrw browsing buffer. Choose that by setting - this parameter to 0. - default: =0 - - *g:netrw_alto* change from above splitting to below splitting - by setting this variable (see |netrw-o|) - default: =&sb (see |'sb'|) - - *g:netrw_altv* change from left splitting to right splitting - by setting this variable (see |netrw-v|) - default: =&spr (see |'spr'|) - - *g:netrw_banner* enable/suppress the banner - =0: suppress the banner - =1: banner is enabled (default) - - *g:netrw_bannerbackslash* if this variable exists and is not zero, the - banner will be displayed with backslashes - rather than forward slashes. - - *g:netrw_browse_split* when browsing, will open the file by: - =0: re-using the same window (default) - =1: horizontally splitting the window first - =2: vertically splitting the window first - =3: open file in new tab - =4: act like "P" (ie. open previous window) - Note that |g:netrw_preview| may be used - to get vertical splitting instead of - horizontal splitting. - =[servername,tab-number,window-number] - Given a |List| such as this, a remote server - named by the "servername" will be used for - editing. It will also use the specified tab - and window numbers to perform editing - (see |clientserver|, |netrw-ctrl-r|) - This option does not affect the production of - |:Lexplore| windows. - - Related topics: - |g:netrw_alto| |g:netrw_altv| - |netrw-C| |netrw-cr| - |netrw-ctrl-r| - - *g:netrw_browsex_viewer* specify user's preference for a viewer: > - "kfmclient exec" - "gnome-open" -< - *g:netrw_browsex_support_remote* - specify if the specified viewer supports a - remote URL. (see |netrw-handler|). - - *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME" - Windows: "cacls FILENAME /e /p PERM" - Used to change access permission for a file. - - *g:netrw_clipboard* =1 - By default, netrw will attempt to insure that - the clipboard's values will remain unchanged. - However, some users report that they have - speed problems with this; consequently, this - option, when set to zero, lets such users - prevent netrw from saving and restoring the - clipboard (the latter is done only as needed). - That means that if the clipboard is changed - (inadvertently) by normal netrw operation that - it will not be restored to its prior state. - - *g:netrw_compress* ="gzip" - Will compress marked files with this - command - - *g:Netrw_corehandler* Allows one to specify something additional - to do when handling files via netrw's - browser's "x" command (see |netrw-x|). If - present, g:Netrw_corehandler specifies - either one or more function references - (see |Funcref|). (the capital g:Netrw... - is required its holding a function reference) - - - *g:netrw_ctags* ="ctags" - The default external program used to create - tags - - *g:netrw_cursor* = 2 (default) - This option controls the use of the - |'cursorline'| (cul) and |'cursorcolumn'| - (cuc) settings by netrw: - - Value Thin-Long-Tree Wide - =0 u-cul u-cuc u-cul u-cuc - =1 u-cul u-cuc cul u-cuc - =2 cul u-cuc cul u-cuc - =3 cul u-cuc cul cuc - =4 cul cuc cul cuc - =5 U-cul U-cuc U-cul U-cuc - =6 U-cul U-cuc cul U-cuc - =7 cul U-cuc cul U-cuc - =8 cul U-cuc cul cuc - - Where - u-cul : user's |'cursorline'| initial setting used - u-cuc : user's |'cursorcolumn'| initial setting used - U-cul : user's |'cursorline'| current setting used - U-cuc : user's |'cursorcolumn'| current setting used - cul : |'cursorline'| will be locally set - cuc : |'cursorcolumn'| will be locally set - - The "initial setting" means the values of - the |'cuc'| and |'cul'| settings in effect when - netrw last saw |g:netrw_cursor| >= 5 or when - netrw was initially run. - - *g:netrw_decompress* = { '.lz4': 'lz4 -d', - '.lzo': 'lzop -d', - '.lz': 'lzip -dk', - '.7z': '7za x', - '.001': '7za x', - '.tar.bz': 'tar -xvjf', - '.tar.bz2': 'tar -xvjf', - '.tbz': 'tar -xvjf', - '.tbz2': 'tar -xvjf', - '.tar.gz': 'tar -xvzf', - '.tgz': 'tar -xvzf', - '.tar.zst': 'tar --use-compress-program=unzstd -xvf', - '.tzst': 'tar --use-compress-program=unzstd -xvf', - '.tar': 'tar -xvf', - '.zip': 'unzip', - '.bz': 'bunzip2 -k', - '.bz2': 'bunzip2 -k', - '.gz': 'gunzip -k', - '.lzma': 'unlzma -T0 -k', - '.xz': 'unxz -T0 -k', - '.zst': 'zstd -T0 -d', - '.Z': 'uncompress -k', - '.rar': 'unrar x -ad', - '.tar.lzma': 'tar --lzma -xvf', - '.tlz': 'tar --lzma -xvf', - '.tar.xz': 'tar -xvJf', - '.txz': 'tar -xvJf'} - - A dictionary mapping suffices to - decompression programs. - - *g:netrw_dirhistmax* =10: controls maximum quantity of past - history. May be zero to suppress - history. - (related: |netrw-qb| |netrw-u| |netrw-U|) - - *g:netrw_dynamic_maxfilenamelen* =32: enables dynamic determination of - |g:netrw_maxfilenamelen|, which affects - local file long listing. - - *g:netrw_errorlvl* =0: error levels greater than or equal to - this are permitted to be displayed - 0: notes - 1: warnings - 2: errors - - *g:netrw_fastbrowse* =0: slow speed directory browsing; - never re-uses directory listings; - always obtains directory listings. - =1: medium speed directory browsing; - re-use directory listings only - when remote directory browsing. - (default value) - =2: fast directory browsing; - only obtains directory listings when the - directory hasn't been seen before - (or |netrw-ctrl-l| is used). - - Fast browsing retains old directory listing - buffers so that they don't need to be - re-acquired. This feature is especially - important for remote browsing. However, if - a file is introduced or deleted into or from - such directories, the old directory buffer - becomes out-of-date. One may always refresh - such a directory listing with |netrw-ctrl-l|. - This option gives the user the choice of - trading off accuracy (ie. up-to-date listing) - versus speed. - - *g:netrw_ffkeep* (default: doesn't exist) - If this variable exists and is zero, then - netrw will not do a save and restore for - |'fileformat'|. - - *g:netrw_fname_escape* =' ?&;%' - Used on filenames before remote reading/writing - - *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings - that can show up as "directories" and "files" - in the listing. This pattern is used to - remove such embedded messages. By default its - value is: - '^total\s\+\d\+$\| - ^Trying\s\+\d\+.*$\| - ^KERBEROS_V\d rejected\| - ^Security extensions not\| - No such file\| - : connect to address [0-9a-fA-F:]* - : No route to host$' - - *g:netrw_ftp_list_cmd* options for passing along to ftp for directory - listing. Defaults: - unix or g:netrw_cygwin set: : "ls -lF" - otherwise "dir" - - - *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory - listing, sorted by size of file. - Defaults: - unix or g:netrw_cygwin set: : "ls -slF" - otherwise "dir" - - *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory - listing, sorted by time of last modification. - Defaults: - unix or g:netrw_cygwin set: : "ls -tlF" - otherwise "dir" - - *g:netrw_glob_escape* ='[]*?`{~$' (unix) - ='[]*?`{$' (windows - These characters in directory names are - escaped before applying glob() - - *g:netrw_gx* ="" - This option controls how gx (|netrw-gx|) picks - up the text under the cursor. See |expand()| - for possibilities. - - *g:netrw_hide* Controlled by the "a" map (see |netrw-a|) - =0 : show all - =1 : show not-hidden files - =2 : show hidden files only - default: =1 - - *g:netrw_home* The home directory for where bookmarks and - history are saved (as .netrwbook and - .netrwhist). - Netrw uses |expand()|on the string. - default: the first directory on the - |'runtimepath'| - - *g:netrw_keepdir* =1 (default) keep current directory immune from - the browsing directory. - =0 keep the current directory the same as the - browsing directory. - The current browsing directory is contained in - b:netrw_curdir (also see |netrw-cd|) - - *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the - |:jumps| table unaffected. - ="" netrw will not use |:keepjumps| with - exceptions only for the - saving/restoration of position. - - *g:netrw_list_cmd* command for listing remote directories - default: (if ssh is executable) - "ssh HOSTNAME ls -FLa" - - *g:netrw_list_cmd_options* If this variable exists, then its contents are - appended to the g:netrw_list_cmd. For - example, use "2>/dev/null" to get rid of banner - messages on unix systems. - - - *g:netrw_liststyle* Set the default listing style: - = 0: thin listing (one file per line) - = 1: long listing (one file per line with time - stamp information and file size) - = 2: wide listing (multiple files in columns) - = 3: tree style listing - - *g:netrw_list_hide* comma-separated pattern list for hiding files - Patterns are regular expressions (see |regexp|) - There's some special support for git-ignore - files: you may add the output from the helper - function 'netrw_gitignore#Hide() automatically - hiding all gitignored files. - For more details see |netrw-gitignore|. - - Examples: - let g:netrw_list_hide= '.*\.swp$' - let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' - default: "" - - *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin - =expand("$COMSPEC") Windows - Copies marked files (|netrw-mf|) to target - directory (|netrw-mt|, |netrw-mc|) - - *g:netrw_localcopycmdopt* ='' Linux/Unix/MacOS/Cygwin - =' \c copy' Windows - Options for the |g:netrw_localcopycmd| - - *g:netrw_localcopydircmd* ="cp" Linux/Unix/MacOS/Cygwin - =expand("$COMSPEC") Windows - Copies directories to target directory. - (|netrw-mc|, |netrw-mt|) - - *g:netrw_localcopydircmdopt* =" -R" Linux/Unix/MacOS/Cygwin - =" /c xcopy /e /c /h/ /i /k" Windows - Options for |g:netrw_localcopydircmd| - - *g:netrw_localmkdir* ="mkdir" Linux/Unix/MacOS/Cygwin - =expand("$COMSPEC") Windows - command for making a local directory - - *g:netrw_localmkdiropt* ="" Linux/Unix/MacOS/Cygwin - =" /c mkdir" Windows - Options for |g:netrw_localmkdir| - - *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin - =expand("$COMSPEC") Windows - Moves marked files (|netrw-mf|) to target - directory (|netrw-mt|, |netrw-mm|) - - *g:netrw_localmovecmdopt* ="" Linux/Unix/MacOS/Cygwin - =" /c move" Windows - Options for |g:netrw_localmovecmd| - - *g:netrw_maxfilenamelen* =32 by default, selected so as to make long - listings fit on 80 column displays. - If your screen is wider, and you have file - or directory names longer than 32 bytes, - you may set this option to keep listings - columnar. - - *g:netrw_mkdir_cmd* command for making a remote directory - via ssh (also see |g:netrw_remote_mkdir|) - default: "ssh USEPORT HOSTNAME mkdir" - - *g:netrw_mousemaps* =1 (default) enables mouse buttons while - browsing to: - leftmouse : open file/directory - shift-leftmouse : mark file - middlemouse : same as P - rightmouse : remove file/directory - =0: disables mouse maps - - *g:netrw_nobeval* doesn't exist (default) - If this variable exists, then balloon - evaluation will be suppressed - (see |'ballooneval'|) - - *g:netrw_sizestyle* not defined: actual bytes (default) - ="b" : actual bytes (default) - ="h" : human-readable (ex. 5k, 4m, 3g) - uses 1000 base - ="H" : human-readable (ex. 5K, 4M, 3G) - uses 1024 base - The long listing (|netrw-i|) and query-file - maps (|netrw-qf|) will display file size - using the specified style. - - *g:netrw_usetab* if this variable exists and is non-zero, then - the map supporting shrinking/expanding a - Lexplore or netrw window will be enabled. - (see |netrw-c-tab|) - - *g:netrw_remote_mkdir* command for making a remote directory - via ftp (also see |g:netrw_mkdir_cmd|) - default: "mkdir" - - *g:netrw_retmap* if it exists and is set to one, then: - * if in a netrw-selected file, AND - * no normal-mode <2-leftmouse> mapping exists, - then the <2-leftmouse> will be mapped for easy - return to the netrw browser window. - example: click once to select and open a file, - double-click to return. - - Note that one may instead choose to: - * let g:netrw_retmap= 1, AND - * nmap YourChoice NetrwReturn - and have another mapping instead of - <2-leftmouse> to invoke the return. - - You may also use the |:Rexplore| command to do - the same thing. - - default: =0 - - *g:netrw_rm_cmd* command for removing remote files - default: "ssh USEPORT HOSTNAME rm" - - *g:netrw_rmdir_cmd* command for removing remote directories - default: "ssh USEPORT HOSTNAME rmdir" - - *g:netrw_rmf_cmd* command for removing remote softlinks - default: "ssh USEPORT HOSTNAME rm -f" - - *g:netrw_servername* use this variable to provide a name for - |netrw-ctrl-r| to use for its server. - default: "NETRWSERVER" - - *g:netrw_sort_by* sort by "name", "time", "size", or - "exten". - default: "name" - - *g:netrw_sort_direction* sorting direction: "normal" or "reverse" - default: "normal" - - *g:netrw_sort_options* sorting is done using |:sort|; this - variable's value is appended to the - sort command. Thus one may ignore case, - for example, with the following in your - .vimrc: > - let g:netrw_sort_options="i" -< default: "" - - *g:netrw_sort_sequence* when sorting by name, first sort by the - comma-separated pattern sequence. Note that - any filigree added to indicate filetypes - should be accounted for in your pattern. - default: '[\/]$,*,\.bak$,\.o$,\.h$, - \.info$,\.swp$,\.obj$' - - *g:netrw_special_syntax* If true, then certain files will be shown - using special syntax in the browser: - - netrwBak : *.bak - netrwCompress: *.gz *.bz2 *.Z *.zip - netrwCoreDump: core.\d\+ - netrwData : *.dat - netrwDoc : *.doc,*.txt,*.pdf, - *.pdf,*.docx - netrwHdr : *.h - netrwLex : *.l *.lex - netrwLib : *.a *.so *.lib *.dll - netrwMakefile: [mM]akefile *.mak - netrwObj : *.o *.obj - netrwPix : *.bmp,*.fit,*.fits,*.gif, - *.jpg,*.jpeg,*.pcx,*.ppc - *.pgm,*.png,*.psd,*.rgb - *.tif,*.xbm,*.xcf - netrwTags : tags ANmenu ANtags - netrwTilde : * - netrwTmp : tmp* *tmp - netrwYacc : *.y - - In addition, those groups mentioned in - |'suffixes'| are also added to the special - file highlighting group. - These syntax highlighting groups are linked - to netrwGray or Folded by default - (see |hl-Folded|), but one may put lines like > - hi link netrwCompress Visual -< into one's <.vimrc> to use one's own - preferences. Alternatively, one may - put such specifications into > - .vim/after/syntax/netrw.vim. -< The netrwGray highlighting is set up by - netrw when > - * netrwGray has not been previously - defined - * the gui is running -< As an example, I myself use a dark-background - colorscheme with the following in - .vim/after/syntax/netrw.vim: > - - hi netrwCompress term=NONE cterm=NONE gui=NONE ctermfg=10 guifg=green ctermbg=0 guibg=black - hi netrwData term=NONE cterm=NONE gui=NONE ctermfg=9 guifg=blue ctermbg=0 guibg=black - hi netrwHdr term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 - hi netrwLex term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 - hi netrwYacc term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 - hi netrwLib term=NONE cterm=NONE gui=NONE ctermfg=14 guifg=yellow - hi netrwObj term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red - hi netrwTilde term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red - hi netrwTmp term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red - hi netrwTags term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red - hi netrwDoc term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=yellow2 guibg=Blue3 - hi netrwSymLink term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=grey60 -< - *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines, - messages, banners, and whatnot that one doesn't - want masquerading as "directories" and "files". - Use this pattern to remove such embedded - messages. By default its value is: - '^total\s\+\d\+$' - - *g:netrw_ssh_cmd* One may specify an executable command - to use instead of ssh for remote actions - such as listing, file removal, etc. - default: ssh - - *g:netrw_suppress_gx_mesg* =1 : browsers sometimes produce messages - which are normally unwanted intermixed - with the page. - However, when using links, for example, - those messages are what the browser produces. - By setting this option to 0, netrw will not - suppress browser messages. - - *g:netrw_tmpfile_escape* =' &;' - escape() is applied to all temporary files - to escape these characters. - - *g:netrw_timefmt* specify format string to vim's strftime(). - The default, "%c", is "the preferred date - and time representation for the current - locale" according to my manpage entry for - strftime(); however, not all are satisfied - with it. Some alternatives: - "%a %d %b %Y %T", - " %a %Y-%m-%d %I-%M-%S %p" - default: "%c" - - *g:netrw_use_noswf* netrw normally avoids writing swapfiles - for browser buffers. However, under some - systems this apparently is causing nasty - ml_get errors to appear; if you're getting - ml_get errors, try putting - let g:netrw_use_noswf= 0 - in your .vimrc. - default: 1 - - *g:netrw_winsize* specify initial size of new windows made with - "o" (see |netrw-o|), "v" (see |netrw-v|), - |:Hexplore| or |:Vexplore|. The g:netrw_winsize - is an integer describing the percentage of the - current netrw buffer's window to be used for - the new window. - If g:netrw_winsize is less than zero, then - the absolute value of g:netrw_winsize will be - used to specify the quantity of lines or - columns for the new window. - If g:netrw_winsize is zero, then a normal - split will be made (ie. |'equalalways'| will - take effect, for example). - default: 50 (for 50%) - - *g:netrw_wiw* =1 specifies the minimum window width to use - when shrinking a netrw/Lexplore window - (see |netrw-c-tab|). - - *g:netrw_xstrlen* Controls how netrw computes string lengths, - including multi-byte characters' string - length. (thanks to N Weibull, T Mechelynck) - =0: uses Vim's built-in strlen() - =1: number of codepoints (Latin a + combining - circumflex is two codepoints) (DEFAULT) - =2: number of spacing codepoints (Latin a + - combining circumflex is one spacing - codepoint; a hard tab is one; wide and - narrow CJK are one each; etc.) - =3: virtual length (counting tabs as anything - between 1 and |'tabstop'|, wide CJK as 2 - rather than 1, Arabic alif as zero when - immediately preceded by lam, one - otherwise, etc) - - *g:NetrwTopLvlMenu* This variable specifies the top level - menu name; by default, it's "Netrw.". If - you wish to change this, do so in your - .vimrc. - -NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2 - -Netrw has been designed to handle user options by saving them, setting the -options to something that's compatible with netrw's needs, and then restoring -them. However, the autochdir option: > - :set acd -is problematic. Autochdir sets the current directory to that containing the -file you edit; this apparently also applies to directories. In other words, -autochdir sets the current directory to that containing the "file" (even if -that "file" is itself a directory). - -NETRW SETTINGS WINDOW *netrw-settings-window* {{{2 - -With the NetrwSettings.vim plugin, > - :NetrwSettings -will bring up a window with the many variables that netrw uses for its -settings. You may change any of their values; when you save the file, the -settings therein will be used. One may also press "?" on any of the lines for -help on what each of the variables do. - -(also see: |netrw-browser-var| |netrw-protocol| |netrw-variables|) - - -============================================================================== -OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2 - -If there are no marked files: - - When browsing a remote directory, one may obtain a file under the cursor - (ie. get a copy on your local machine, but not edit it) by pressing the O - key. - -If there are marked files: - - The marked files will be obtained (ie. a copy will be transferred to your - local machine, but not set up for editing). - -Only ftp and scp are supported for this operation (but since these two are -available for browsing, that shouldn't be a problem). The status bar will -then show, on its right hand side, a message like "Obtaining filename". The -statusline will be restored after the transfer is complete. - -Netrw can also "obtain" a file using the local browser. Netrw's display -of a directory is not necessarily the same as Vim's "current directory", -unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select -a file using the local browser (by putting the cursor on it) and pressing -"O" will then "obtain" the file; ie. copy it to Vim's current directory. - -Related topics: - * To see what the current directory is, use |:pwd| - * To make the currently browsed directory the current directory, see - |netrw-cd| - * To automatically make the currently browsed directory the current - directory, see |g:netrw_keepdir|. - - *netrw-newfile* *netrw-createfile* -OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2 - -To open a new file in netrw's current directory, press "%". This map -will query the user for a new filename; an empty file by that name will -be placed in the netrw's current directory (ie. b:netrw_curdir). - -If Lexplore (|netrw-:Lexplore|) is in use, the new file will be generated -in the |g:netrw_chgwin| window. - -Related topics: |netrw-d| - - -PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2 - -One may use a preview window by using the "p" key when the cursor is atop the -desired filename to be previewed. The display will then split to show both -the browser (where the cursor will remain) and the file (see |:pedit|). By -default, the split will be taken horizontally; one may use vertical splitting -if one has set |g:netrw_preview| first. - -An interesting set of netrw settings is: > - - let g:netrw_preview = 1 - let g:netrw_liststyle = 3 - let g:netrw_winsize = 30 - -These will: - - 1. Make vertical splitting the default for previewing files - 2. Make the default listing style "tree" - 3. When a vertical preview window is opened, the directory listing - will use only 30% of the columns available; the rest of the window - is used for the preview window. - - Related: if you like this idea, you may also find :Lexplore - (|netrw-:Lexplore|) or |g:netrw_chgwin| of interest - -Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| |CTRL-W_z| |:pclose| - - -PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2 - -To edit a file or directory under the cursor in the previously used (last -accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one -window, then the one window will be horizontally split (by default). - -If there's more than one window, the previous window will be re-used on -the selected file/directory. If the previous window's associated buffer -has been modified, and there's only one window with that buffer, then -the user will be asked if s/he wishes to save the buffer first (yes, -no, or cancel). - -Related Actions |netrw-cr| |netrw-o| |netrw-t| |netrw-v| -Associated setting variables: - |g:netrw_alto| control above/below splitting - |g:netrw_altv| control right/left splitting - |g:netrw_preview| control horizontal vs vertical splitting - |g:netrw_winsize| control initial sizing - -Also see: |g:netrw_chgwin| |netrw-p| - - -REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2 - -To refresh either a local or remote directory listing, press ctrl-l () or -hit the when atop the ./ directory entry in the listing. One may also -refresh a local directory by using ":e .". - - -REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2 - -One may toggle between normal and reverse sorting order by pressing the -"r" key. - -Related topics: |netrw-s| -Associated setting variable: |g:netrw_sort_direction| - - -RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2 - -If there are no marked files: (see |netrw-mf|) - - Renaming files and directories involves moving the cursor to the - file/directory to be moved (renamed) and pressing "R". You will then be - queried for what you want the file/directory to be renamed to. You may - select a range of lines with the "V" command (visual selection), and then - press "R"; you will be queried for each file as to what you want it - renamed to. - -If there are marked files: (see |netrw-mf|) - - Marked files will be renamed (moved). You will be queried as above in - order to specify where you want the file/directory to be moved. - - If you answer a renaming query with a "s/frompattern/topattern/", then - subsequent files on the marked file list will be renamed by taking each - name, applying that substitute, and renaming each file to the result. - As an example : > - - mr [query: reply with *.c] - R [query: reply with s/^\(.*\)\.c$/\1.cpp/] -< - This example will mark all *.c files and then rename them to *.cpp - files. Netrw will protect you from overwriting local files without - confirmation, but not remote ones. - - The ctrl-X character has special meaning for renaming files: > - - : a single ctrl-x tells netrw to ignore the portion of the response - lying between the last '/' and the ctrl-x. - - : a pair of contiguous ctrl-x's tells netrw to ignore any - portion of the string preceding the double ctrl-x's. -< - WARNING:~ - - Note that moving files is a dangerous operation; copies are safer. That's - because a "move" for remote files is actually a copy + delete -- and if - the copy fails and the delete succeeds you may lose the file. - Use at your own risk. - -The *g:netrw_rename_cmd* variable is used to implement remote renaming. By -default its value is: > - - ssh HOSTNAME mv -< -One may rename a block of files and directories by selecting them with -V (|linewise-visual|) when using thin style. - -See |cmdline-editing| for more on how to edit the command line; in particular, -you'll find (initiates cmdline window editing) and (uses the -command line under the cursor) useful in conjunction with the R command. - - -SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2 - -One may select the sorting style by name, time, or (file) size. The "s" map -allows one to circulate amongst the three choices; the directory listing will -automatically be refreshed to reflect the selected style. - -Related topics: |netrw-r| |netrw-S| -Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence| - - -SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2 - -One may select a netrw window for editing with the "C" mapping, using the -:NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window -number. Subsequent selection of a file to edit (|netrw-cr|) will use that -window. - - * C : by itself, will select the current window holding a netrw buffer - for subsequent editing via |netrw-cr|. The C mapping is only available - while in netrw buffers. - - * [count]C : the count will be used as the window number to be used - for subsequent editing via |netrw-cr|. - - * :NetrwC will set |g:netrw_chgwin| to the current window - - * :NetrwC win# will set |g:netrw_chgwin| to the specified window - number - -Using > - let g:netrw_chgwin= -1 -will restore the default editing behavior -(ie. subsequent editing will use the current window). - -Related topics: |netrw-cr| |g:netrw_browse_split| -Associated setting variables: |g:netrw_chgwin| - - -SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2 - -The key will toggle a netrw or |:Lexplore| window's width, -but only if |g:netrw_usetab| exists and is non-zero (and, of course, -only if your terminal supports differentiating from a plain -). - - * If the current window is a netrw window, toggle its width - (between |g:netrw_wiw| and its original width) - - * Else if there is a |:Lexplore| window in the current tab, toggle - its width - - * Else bring up a |:Lexplore| window - -If |g:netrw_usetab| exists and is zero, or if there is a pre-existing mapping -for , then the will not be mapped. One may map something other -than a , too: (but you'll still need to have had |g:netrw_usetab| set). > - - nmap (whatever) NetrwShrink -< -Related topics: |:Lexplore| -Associated setting variable: |g:netrw_usetab| - - -USER SPECIFIED MAPS *netrw-usermaps* {{{1 - -One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|, -to hold a |List| of lists of keymap strings and function names: > - - [["keymap-sequence","ExampleUserMapFunc"],...] -< -When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps| -exists, then the internal function netrw#UserMaps(islocal) is called. -This function goes through all the entries in the |g:Netrw_UserMaps| list: - - * sets up maps: > - nno KEYMAP-SEQUENCE - :call s:UserMaps(islocal,"ExampleUserMapFunc") -< * refreshes if result from that function call is the string - "refresh" - * if the result string is not "", then that string will be - executed (:exe result) - * if the result is a List, then the above two actions on results - will be taken for every string in the result List - -The user function is passed one argument; it resembles > - - fun! ExampleUserMapFunc(islocal) -< -where a:islocal is 1 if its a local-directory system call or 0 when -remote-directory system call. - - *netrw-call* *netrw-expose* *netrw-modify* -Use netrw#Expose("varname") to access netrw-internal (script-local) - variables. -Use netrw#Modify("varname",newvalue) to change netrw-internal variables. -Use netrw#Call("funcname"[,args]) to call a netrw-internal function with - specified arguments. - -Example: Get a copy of netrw's marked file list: > - - let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist") -< -Example: Modify the value of netrw's marked file list: > - - call netrw#Modify("netrwmarkfilelist",[]) -< -Example: Clear netrw's marked file list via a mapping on gu > - " ExampleUserMap: {{{2 - fun! ExampleUserMap(islocal) - call netrw#Modify("netrwmarkfilelist",[]) - call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"") - let retval= ["refresh"] - return retval - endfun - let g:Netrw_UserMaps= [["gu","ExampleUserMap"]] -< - -10. Problems and Fixes *netrw-problems* {{{1 - - (This section is likely to grow as I get feedback) - (also see |netrw-debug|) - *netrw-p1* - P1. I use Windows, and my network browsing with ftp doesn't sort by {{{2 - time or size! -or- The remote system is a Windows server; why - don't I get sorts by time or size? - - Windows' ftp has a minimal support for ls (ie. it doesn't - accept sorting options). It doesn't support the -F which - gives an explanatory character (ABC/ for "ABC is a directory"). - Netrw then uses "dir" to get both its thin and long listings. - If you think your ftp does support a full-up ls, put the - following into your <.vimrc>: > - - let g:netrw_ftp_list_cmd = "ls -lF" - let g:netrw_ftp_timelist_cmd= "ls -tlF" - let g:netrw_ftp_sizelist_cmd= "ls -slF" -< - Alternatively, if you have cygwin on your Windows box, put - into your <.vimrc>: > - - let g:netrw_cygwin= 1 -< - This problem also occurs when the remote system is Windows. - In this situation, the various g:netrw_ftp_[time|size]list_cmds - are as shown above, but the remote system will not correctly - modify its listing behavior. - - - *netrw-p2* - P2. I tried rcp://user@host/ (or protocol other than ftp) and netrw {{{2 - used ssh! That wasn't what I asked for... - - Netrw has two methods for browsing remote directories: ssh - and ftp. Unless you specify ftp specifically, ssh is used. - When it comes time to do download a file (not just a directory - listing), netrw will use the given protocol to do so. - - *netrw-p3* - P3. I would like long listings to be the default. {{{2 - - Put the following statement into your |.vimrc|: > - - let g:netrw_liststyle= 1 -< - Check out |netrw-browser-var| for more customizations that - you can set. - - *netrw-p4* - P4. My times come up oddly in local browsing {{{2 - - Does your system's strftime() accept the "%c" to yield dates - such as "Sun Apr 27 11:49:23 1997"? If not, do a - "man strftime" and find out what option should be used. Then - put it into your |.vimrc|: > - - let g:netrw_timefmt= "%X" (where X is the option) -< - *netrw-p5* - P5. I want my current directory to track my browsing. {{{2 - How do I do that? - - Put the following line in your |.vimrc|: -> - let g:netrw_keepdir= 0 -< - *netrw-p6* - P6. I use Chinese (or other non-ascii) characters in my filenames, {{{2 - and netrw (Explore, Sexplore, Hexplore, etc) doesn't display them! - - (taken from an answer provided by Wu Yongwei on the vim - mailing list) - I now see the problem. Your code page is not 936, right? Vim - seems only able to open files with names that are valid in the - current code page, as are many other applications that do not - use the Unicode version of Windows APIs. This is an OS-related - issue. You should not have such problems when the system - locale uses UTF-8, such as modern Linux distros. - - (...it is one more reason to recommend that people use utf-8!) - - *netrw-p7* - P7. I'm getting "ssh is not executable on your system" -- what do I {{{2 - do? - - (Dudley Fox) Most people I know use putty for windows ssh. It - is a free ssh/telnet application. You can read more about it - here: - - http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also: - - (Marlin Unruh) This program also works for me. It's a single - executable, so he/she can copy it into the Windows\System32 - folder and create a shortcut to it. - - (Dudley Fox) You might also wish to consider plink, as it - sounds most similar to what you are looking for. plink is an - application in the putty suite. - - http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink - - (Vissale Neang) Maybe you can try OpenSSH for windows, which - can be obtained from: - - http://sshwindows.sourceforge.net/ - - It doesn't need the full Cygwin package. - - (Antoine Mechelynck) For individual Unix-like programs needed - for work in a native-Windows environment, I recommend getting - them from the GnuWin32 project on sourceforge if it has them: - - http://gnuwin32.sourceforge.net/ - - Unlike Cygwin, which sets up a Unix-like virtual machine on - top of Windows, GnuWin32 is a rewrite of Unix utilities with - Windows system calls, and its programs works quite well in the - cmd.exe "Dos box". - - (dave) Download WinSCP and use that to connect to the server. - In Preferences > Editors, set gvim as your editor: - - - Click "Add..." - - Set External Editor (adjust path as needed, include - the quotes and !.! at the end): - "c:\Program Files\Vim\vim82\gvim.exe" !.! - - Check that the filetype in the box below is - {asterisk}.{asterisk} (all files), or whatever types - you want (cec: change {asterisk} to * ; I had to - write it that way because otherwise the helptags - system thinks it's a tag) - - Make sure it's at the top of the listbox (click it, - then click "Up" if it's not) - If using the Norton Commander style, you just have to hit - to edit a file in a local copy of gvim. - - (Vit Gottwald) How to generate public/private key and save - public key it on server: > - http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready - (8.3 Getting ready for public key authentication) -< - How to use a private key with 'pscp': > - - http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html - (5.2.4 Using public key authentication with PSCP) -< - (Ben Schmidt) I find the ssh included with cwRsync is - brilliant, and install cwRsync or cwRsyncServer on most - Windows systems I come across these days. I guess COPSSH, - packed by the same person, is probably even better for use as - just ssh on Windows, and probably includes sftp, etc. which I - suspect the cwRsync doesn't, though it might - - (cec) To make proper use of these suggestions above, you will - need to modify the following user-settable variables in your - .vimrc: - - |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd| - |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd| - - The first one (|g:netrw_ssh_cmd|) is the most important; most - of the others will use the string in g:netrw_ssh_cmd by - default. - - *netrw-p8* *netrw-ml_get* - P8. I'm browsing, changing directory, and bang! ml_get errors {{{2 - appear and I have to kill vim. Any way around this? - - Normally netrw attempts to avoid writing swapfiles for - its temporary directory buffers. However, on some systems - this attempt appears to be causing ml_get errors to - appear. Please try setting |g:netrw_use_noswf| to 0 - in your <.vimrc>: > - let g:netrw_use_noswf= 0 -< - *netrw-p9* - P9. I'm being pestered with "[something] is a directory" and {{{2 - "Press ENTER or type command to continue" prompts... - - The "[something] is a directory" prompt is issued by Vim, - not by netrw, and there appears to be no way to work around - it. Coupled with the default cmdheight of 1, this message - causes the "Press ENTER..." prompt. So: read |hit-enter|; - I also suggest that you set your |'cmdheight'| to 2 (or more) in - your <.vimrc> file. - - *netrw-p10* - P10. I want to have two windows; a thin one on the left and my {{{2 - editing window on the right. How may I accomplish this? - - You probably want netrw running as in a side window. If so, you - will likely find that ":[N]Lexplore" does what you want. The - optional "[N]" allows you to select the quantity of columns you - wish the |:Lexplore|r window to start with (see |g:netrw_winsize| - for how this parameter works). - - Previous solution: - - * Put the following line in your <.vimrc>: - let g:netrw_altv = 1 - * Edit the current directory: :e . - * Select some file, press v - * Resize the windows as you wish (see |CTRL-W_<| and - |CTRL-W_>|). If you're using gvim, you can drag - the separating bar with your mouse. - * When you want a new file, use ctrl-w h to go back to the - netrw browser, select a file, then press P (see |CTRL-W_h| - and |netrw-P|). If you're using gvim, you can press - in the browser window and then press the - to select the file. - - - *netrw-p11* - P11. My directory isn't sorting correctly, or unwanted letters are {{{2 - appearing in the listed filenames, or things aren't lining - up properly in the wide listing, ... - - This may be due to an encoding problem. I myself usually use - utf-8, but really only use ascii (ie. bytes from 32-126). - Multibyte encodings use two (or more) bytes per character. - You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|. - - *netrw-p12* - P12. I'm a Windows + putty + ssh user, and when I attempt to {{{2 - browse, the directories are missing trailing "/"s so netrw treats - them as file transfers instead of as attempts to browse - subdirectories. How may I fix this? - - (mikeyao) If you want to use vim via ssh and putty under Windows, - try combining the use of pscp/psftp with plink. pscp/psftp will - be used to connect and plink will be used to execute commands on - the server, for example: list files and directory using 'ls'. - - These are the settings I use to do this: -> - " list files, it's the key setting, if you haven't set, - " you will get a blank buffer - let g:netrw_list_cmd = "plink HOSTNAME ls -Fa" - " if you haven't add putty directory in system path, you should - " specify scp/sftp command. For examples: - "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe" - "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe" -< - *netrw-p13* - P13. I would like to speed up writes using Nwrite and scp/ssh {{{2 - style connections. How? (Thomer M. Gil) - - Try using ssh's ControlMaster and ControlPath (see the ssh_config - man page) to share multiple ssh connections over a single network - connection. That cuts out the cryptographic handshake on each - file write, sometimes speeding it up by an order of magnitude. - (see http://thomer.com/howtos/netrw_ssh.html) - (included by permission) - - Add the following to your ~/.ssh/config: > - - # you change "*" to the hostname you care about - Host * - ControlMaster auto - ControlPath /tmp/%r@%h:%p - -< Then create an ssh connection to the host and leave it running: > - - ssh -N host.domain.com - -< Now remotely open a file with Vim's Netrw and enjoy the - zippiness: > - - vim scp://host.domain.com//home/user/.bashrc -< - *netrw-p14* - P14. How may I use a double-click instead of netrw's usual single {{{2 - click to open a file or directory? (Ben Fritz) - - First, disable netrw's mapping with > - let g:netrw_mousemaps= 0 -< and then create a netrw buffer only mapping in - $HOME/.vim/after/ftplugin/netrw.vim: > - nmap <2-leftmouse> -< Note that setting g:netrw_mousemaps to zero will turn off - all netrw's mouse mappings, not just the one. - (see |g:netrw_mousemaps|) - - *netrw-p15* - P15. When editing remote files (ex. :e ftp://hostname/path/file), {{{2 - under Windows I get an |E303| message complaining that its unable - to open a swap file. - - (romainl) It looks like you are starting Vim from a protected - directory. Start netrw from your $HOME or other writable - directory. - - *netrw-p16* - P16. Netrw is closing buffers on its own. {{{2 - What steps will reproduce the problem? - 1. :Explore, navigate directories, open a file - 2. :Explore, open another file - 3. Buffer opened in step 1 will be closed. o - What is the expected output? What do you see instead? - I expect both buffers to exist, but only the last one does. - - (Lance) Problem is caused by "set autochdir" in .vimrc. - (drchip) I am able to duplicate this problem with |'acd'| set. - It appears that the buffers are not exactly closed; - a ":ls!" will show them (although ":ls" does not). - - *netrw-P17* - P17. How to locally edit a file that's only available via {{{2 - another server accessible via ssh? - See http://stackoverflow.com/questions/12469645/ - "Using Vim to Remotely Edit A File on ServerB Only - Accessible From ServerA" - - *netrw-P18* - P18. How do I get numbering on in directory listings? {{{2 - With |g:netrw_bufsettings|, you can control netrw's buffer - settings; try putting > - let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu" -< in your .vimrc. If you'd like to have relative numbering - instead, try > - let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu" -< - *netrw-P19* - P19. How may I have gvim start up showing a directory listing? {{{2 - Try putting the following code snippet into your .vimrc: > - augroup VimStartup - au! - au VimEnter * if expand("%") == "" && argc() == 0 && - \ (v:servername =~ 'GVIM\d*' || v:servername == "") - \ | e . | endif - augroup END -< You may use Lexplore instead of "e" if you're so inclined. - This snippet assumes that you have client-server enabled - (ie. a "huge" vim version). - - *netrw-P20* - P20. I've made a directory (or file) with an accented character, {{{2 - but netrw isn't letting me enter that directory/read that file: - - Its likely that the shell or o/s is using a different encoding - than you have vim (netrw) using. A patch to vim supporting - "systemencoding" may address this issue in the future; for - now, just have netrw use the proper encoding. For example: > - - au FileType netrw set enc=latin1 -< - *netrw-P21* - P21. I get an error message when I try to copy or move a file: {{{2 - - **error** (netrw) tried using g:netrw_localcopycmd; it doesn't work! - - What's wrong? - - Netrw uses several system level commands to do things (see - - |g:netrw_localcopycmd|, |g:netrw_localmovecmd|, - |g:netrw_mkdir_cmd|). - - You may need to adjust the default commands for one or more of - these commands by setting them properly in your .vimrc. Another - source of difficulty is that these commands use vim's local - directory, which may not be the same as the browsing directory - shown by netrw (see |g:netrw_keepdir|). - - -============================================================================== -11. Debugging Netrw Itself *netrw-debug* {{{1 - -Step 1: check that the problem you've encountered hasn't already been resolved -by obtaining a copy of the latest (often developmental) netrw at: - - http://www.drchip.org/astronaut/vim/index.html#NETRW - -The script is typically installed on systems as something like: -> - /usr/local/share/vim/vim8x/plugin/netrwPlugin.vim - /usr/local/share/vim/vim8x/autoload/netrw.vim - (see output of :echo &rtp) -< -which is loaded automatically at startup (assuming :set nocp). If you -installed a new netrw, then it will be located at > - - $HOME/.vim/plugin/netrwPlugin.vim - $HOME/.vim/autoload/netrw.vim -< -Step 2: assuming that you've installed the latest version of netrw, -check that your problem is really due to netrw. Create a file -called netrw.vimrc with the following contents: > - - set nocp - so $HOME/.vim/plugin/netrwPlugin.vim -< -Then run netrw as follows: > - - vim -u netrw.vimrc --noplugins -i NONE [some path here] -< -Perform whatever netrw commands you need to, and check that the problem is -still present. This procedure sidesteps any issues due to personal .vimrc -settings, .viminfo file, and other plugins. If the problem does not appear, -then you need to determine which setting in your .vimrc is causing the -conflict with netrw or which plugin(s) is/are involved. - -Step 3: If the problem still is present, then get a debugging trace from -netrw: - - 1. Get the script, available as: - - http://www.drchip.org/astronaut/vim/index.html#DECHO - or - http://vim.sourceforge.net/scripts/script.php?script_id=120 - - Decho.vim is provided as a "vimball"; see |vimball-intro|. You - should edit the Decho.vba.gz file and source it in: > - - vim Decho.vba.gz - :so % - :q -< - 2. To turn on debug tracing in netrw, then edit the - file by typing: > - - vim netrw.vim - :DechoOn - :wq -< - To restore to normal non-debugging behavior, re-edit - and type > - - vim netrw.vim - :DechoOff - :wq -< - This command, provided by , will comment out all - Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()). - - 3. Then bring up vim and attempt to evoke the problem by doing a - transfer or doing some browsing. A set of messages should appear - concerning the steps that took in attempting to - read/write your file over the network in a separate tab or - server vim window. - - Change the netrw.vimrc file to include the Decho plugin: > - - set nocp - so $HOME/.vim/plugin/Decho.vim - so $HOME/.vim/plugin/netrwPlugin.vim -< - You should continue to run vim with > - - vim -u netrw.vimrc --noplugins -i NONE [some path here] -< - to avoid entanglements with options and other plugins. - - To save the file: under linux, the output will be in a separate - remote server window; in it, just save the file with > - - :w! DBG - -< Under a vim that doesn't support clientserver, your debugging - output will appear in another tab: > - - :tabnext - :set bt= - :w! DBG -< - Furthermore, it'd be helpful if you would type > - - :Dsep - -< where is the command you're about to type next, - thereby making it easier to associate which part of the - debugging trace is due to which command. - - For bug reports, please see |bugs|. -============================================================================== -12. History *netrw-history* {{{1 - - v172: Sep 02, 2021 * (Bram Moolenaar) Changed "l:go" to "go" - * (Bram Moolenaar) no need for "b" in - netrw-safe guioptions - Nov 15, 2021 * removed netrw_localrm and netrw_localrmdir - references - Aug 18, 2022 * (Miguel Barro) improving compatibility with - powershell - v171: Oct 09, 2020 * included code in s:NetrwOptionsSafe() - to allow |'bh'| to be set to delete when - rather than hide when g:netrw_fastbrowse - was zero. - * Installed |g:netrw_clipboard| setting - * Installed option bypass for |'guioptions'| - a/A settings - * Changed popup_beval() to |popup_atcursor()| - in netrw#ErrorMsg (lacygoill). Apparently - popup_beval doesn't reliably close the - popup when the mouse is moved. - * VimEnter() now using win_execute to examine - buffers for an attempt to open a directory. - Avoids issues with popups/terminal from - command line. (lacygoill) - Jun 28, 2021 * (zeertzjq) provided a patch for use of - xmap,xno instead of vmap,vno in - netrwPlugin.vim. Avoids entanglement with - select mode. - Jul 14, 2021 * Fixed problem addressed by tst976; opening - a file using tree mode, going up a - directory, and opening a file there was - opening the file in the wrong directory. - Jul 28, 2021 * (Ingo Karkat) provided a patch fixing an - E488 error with netrwPlugin.vim - (occurred for vim versions < 8.02) - v170: Mar 11, 2020 * (reported by Reiner Herrmann) netrw+tree - would not hide with the ^\..* pattern - correctly. - * (Marcin Szamotulski) NetrwOptionRestore - did not restore options correctly that - had a single quote in the option string. - Apr 13, 2020 * implemented error handling via popup - windows (see |popup_beval()|) - Apr 30, 2020 * (reported by Manatsu Takahashi) while - using Lexplore, a modified file could - be overwritten. Sol'n: will not overwrite, - but will emit an |E37| (although one cannot - add an ! to override) - Jun 07, 2020 * (reported by Jo Totland) repeatedly invoking - :Lexplore and quitting it left unused - hidden buffers. Netrw will now set netrw - buffers created by :Lexplore to |'bh'|=wipe. - v169: Dec 20, 2019 * (reported by amkarthik) that netrw's x - (|netrw-x|) would throw an error when - attempting to open a local directory. - v168: Dec 12, 2019 * scp timeout error message not reported, - hopefully now fixed (Shane Xb Qian) - v167: Nov 29, 2019 * netrw does a save&restore on @* and @+. - That causes problems with the clipboard. - Now restores occurs only if @* or @+ have - been changed. - * netrw will change @* or @+ less often. - Never if I happen to have caught all the - operations that modify the unnamed - register (which also writes @*). - * Modified hiding behavior so that "s" - will not ignore hiding. - v166: Nov 06, 2019 * Removed a space from a nmap for "-" - * Numerous debugging statement changes - v163: Dec 05, 2017 * (Cristi Balan) reported that a setting ('sel') - was left changed - * (Holger Mitschke) reported a problem with - saving and restoring history. Fixed. - * Hopefully I fixed a nasty bug that caused a - file rename to wipe out a buffer that it - should not have wiped out. - * (Holger Mitschke) amended this help file - with additional |g:netrw_special_syntax| - items - * Prioritized wget over curl for - g:netrw_http_cmd - v162: Sep 19, 2016 * (haya14busa) pointed out two syntax errors - with a patch; these are now fixed. - Oct 26, 2016 * I started using mate-terminal and found that - x and gx (|netrw-x| and |netrw-gx|) were no - longer working. Fixed (using atril when - $DESKTOP_SESSION is "mate"). - Nov 04, 2016 * (Martin Vuille) pointed out that @+ was - being restored with keepregstar rather than - keepregplus. - Nov 09, 2016 * Broke apart the command from the options, - mostly for Windows. Introduced new netrw - settings: |g:netrw_localcopycmdopt| - |g:netrw_localcopydircmdopt| - |g:netrw_localmkdiropt| - |g:netrw_localmovecmdopt| - Nov 21, 2016 * (mattn) provided a patch for preview; swapped - winwidth() with winheight() - Nov 22, 2016 * (glacambre) reported that files containing - spaces weren't being obtained properly via - scp. Fix: apparently using single quotes - such as with 'file name' wasn't enough; the - spaces inside the quotes also had to be - escaped (ie. 'file\ name'). - * Also fixed obtain (|netrw-O|) to be able to - obtain files with spaces in their names - Dec 20, 2016 * (xc1427) Reported that using "I" (|netrw-I|) - when atop "Hiding" in the banner also caused - the active-banner hiding control to occur - Jan 03, 2017 * (Enno Nagel) reported that attempting to - apply netrw to a directory that was without - read permission caused a syntax error. - Jan 13, 2017 * (Ingo Karkat) provided a patch which makes - using netrw#Call() better. Now returns - value of internal routines return, for example. - Jan 13, 2017 * (Ingo Karkat) changed netrw#FileUrlRead to - use |:edit| instead of |:read|. I also - changed the routine name to netrw#FileUrlEdit. - Jan 16, 2017 * (Sayem) reported a problem where :Lexplore - could generate a new listing buffer and - window instead of toggling the netrw display. - Unfortunately, the directions for eliciting - the problem weren't complete, so I may or - may not have fixed that issue. - Feb 06, 2017 * Implemented cb and cB. Changed "c" to "cd". - (see |netrw-cb|, |netrw-cB|, and |netrw-cd|) - Mar 21, 2017 * previously, netrw would specify (safe) settings - even when the setting was already safe for - netrw. Netrw now attempts to leave such - already-netrw-safe settings alone. - (affects s:NetrwOptionRestore() and - s:NetrwSafeOptions(); also introduced - s:NetrwRestoreSetting()) - Jun 26, 2017 * (Christian Brabandt) provided a patch to - allow curl to follow redirects (ie. -L - option) - Jun 26, 2017 * (Callum Howard) reported a problem with - :Lexpore not removing the Lexplore window - after a change-directory - Aug 30, 2017 * (Ingo Karkat) one cannot switch to the - previously edited file (e.g. with CTRL-^) - after editing a file:// URL. Patch to - have a "keepalt" included. - Oct 17, 2017 * (Adam Faryna) reported that gn (|netrw-gn|) - did not work on directories in the current - tree - v157: Apr 20, 2016 * (Nicola) had set up a "nmap ..." with - a function that returned a 0 while silently - invoking a shell command. The shell command - activated a ShellCmdPost event which in turn - called s:LocalBrowseRefresh(). That looks - over all netrw buffers for changes needing - refreshes. However, inside a |:map-|, - tab and window changes are disallowed. Fixed. - (affects netrw's s:LocalBrowseRefresh()) - * g:netrw_localrmdir not used any more, but - the relevant patch that causes |delete()| to - take over was #1107 (not #1109). - * |expand()| is now used on |g:netrw_home|; - consequently, g:netrw_home may now use - environment variables - * s:NetrwLeftmouse and s:NetrwCLeftmouse will - return without doing anything if invoked - when inside a non-netrw window - Jun 15, 2016 * gx now calls netrw#GX() which returns - the word under the cursor. The new - wrinkle: if one is in a netrw buffer, - then netrw's s:NetrwGetWord(). - Jun 22, 2016 * Netrw was executing all its associated - Filetype commands silently; I'm going - to try doing that "noisily" and see if - folks have a problem with that. - Aug 12, 2016 * Changed order of tool selection for - handling http://... viewing. - (Nikolay Aleksandrovich Pavlov) - Aug 21, 2016 * Included hiding/showing/all for tree - listings - * Fixed refresh (^L) for tree listings - v156: Feb 18, 2016 * Changed =~ to =~# where appropriate - Feb 23, 2016 * s:ComposePath(base,subdir) now uses - fnameescape() on the base portion - Mar 01, 2016 * (gt_macki) reported where :Explore would - make file unlisted. Fixed (tst943) - Apr 04, 2016 * (reported by John Little) netrw normally - suppresses browser messages, but sometimes - those "messages" are what is wanted. - See |g:netrw_suppress_gx_mesg| - Apr 06, 2016 * (reported by Carlos Pita) deleting a remote - file was giving an error message. Fixed. - Apr 08, 2016 * (Charles Cooper) had a problem with an - undefined b:netrw_curdir. He also provided - a fix. - Apr 20, 2016 * Changed s:NetrwGetBuffer(); now uses - dictionaries. Also fixed the "No Name" - buffer problem. - v155: Oct 29, 2015 * (Timur Fayzrakhmanov) reported that netrw's - mapping of ctrl-l was not allowing refresh of - other windows when it was done in a netrw - window. - Nov 05, 2015 * Improved s:TreeSqueezeDir() to use search() - instead of a loop - * NetrwBrowse() will return line to - w:netrw_bannercnt if cursor ended up in - banner - Nov 16, 2015 * Added a NetrwTreeSqueeze (|netrw-s-cr|) - Nov 17, 2015 * Commented out imaps -- perhaps someone can - tell me how they're useful and should be - retained? - Nov 20, 2015 * Added |netrw-ma| and |netrw-mA| support - Nov 20, 2015 * gx (|netrw-gx|) on a URL downloaded the - file in addition to simply bringing up the - URL in a browser. Fixed. - Nov 23, 2015 * Added |g:netrw_sizestyle| support - Nov 27, 2015 * Inserted a lot of s into various netrw - maps. - Jan 05, 2016 * |netrw-qL| implemented to mark files based - upon |location-list|s; similar to |netrw-qF|. - Jan 19, 2016 * using - call delete(directoryname,"d") - - instead of using g:netrw_localrmdir if - v7.4 + patch#1107 is available - Jan 28, 2016 * changed to using |winsaveview()| and - |winrestview()| - Jan 28, 2016 * s:NetrwTreePath() now does a save and - restore of view - Feb 08, 2016 * Fixed a tree-listing problem with remote - directories - v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where - a file was not treated properly as a file - due to g:netrw_keepdir == 1 - Mar 25, 2015 * (requested by Ben Friz) one may now sort by - extension - Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot - of buffer-local mappings; however, some - plugins (such as vim-surround) set up - conflicting mappings that cause vim to wait. - The "" modifier has been included - with most of netrw's mappings to avoid that - delay. - Jun 26, 2015 * |netrw-gn| mapping implemented - * :Ntree NotADir resulted in having - the tree listing expand in the error messages - window. Fixed. - Jun 29, 2015 * Attempting to delete a file remotely caused - an error with "keepsol" mentioned; fixed. - Jul 08, 2015 * Several changes to keep the |:jumps| table - correct when working with - |g:netrw_fastbrowse| set to 2 - * wide listing with accented characters fixed - (using %-S instead of %-s with a |printf()| - Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true - but kfmclient not installed. Changed order - in netrw#BrowseX(): checks if kde and - kfmclient, then will use xdg-open on a unix - system (if xdg-open is executable) - Aug 11, 2015 * (McDonnell) tree listing mode wouldn't - select a file in a open subdirectory. - * (McDonnell) when multiple subdirectories - were concurrently open in tree listing - mode, a ctrl-L wouldn't refresh properly. - * The netrw:target menu showed duplicate - entries - Oct 13, 2015 * (mattn) provided an exception to handle - windows with shellslash set but no shell - Oct 23, 2015 * if g:netrw_usetab and now used - to control whether NetrwShrink is used - (see |netrw-c-tab|) - v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2 - May 14, 2014 * changed s:PerformListing() so that it - always sets ft=netrw for netrw buffers - (ie. even when syntax highlighting is - off, not available, etc) - May 16, 2014 * introduced the |netrw-ctrl-r| functionality - May 17, 2014 * introduced the |netrw-:NetrwMB| functionality - * mb and mB (|netrw-mb|, |netrw-mB|) will - add/remove marked files from bookmark list - May 20, 2014 * (Enno Nagel) reported that :Lex - wasn't working. Fixed. - May 26, 2014 * restored test to prevent leftmouse window - resizing from causing refresh. - (see s:NetrwLeftmouse()) - * fixed problem where a refresh caused cursor - to go just under the banner instead of - staying put - May 28, 2014 * (László Bimba) provided a patch for opening - the |:Lexplore| window 100% high, optionally - on the right, and will work with remote - files. - May 29, 2014 * implemented :NetrwC (see |netrw-:NetrwC|) - Jun 01, 2014 * Removed some "silent"s from commands used - to implemented scp://... and pscp://... - directory listing. Permits request for - password to appear. - Jun 05, 2014 * (Enno Nagel) reported that user maps "/" - caused problems with "b" and "w", which - are mapped (for wide listings only) to - skip over files rather than just words. - Jun 10, 2014 * |g:netrw_gx| introduced to allow users to - override default "" with the gx - (|netrw-gx|) map - Jun 11, 2014 * gx (|netrw-gx|), with |'autowrite'| set, - will write modified files. s:NetrwBrowseX() - will now save, turn off, and restore the - |'autowrite'| setting. - Jun 13, 2014 * added visual map for gx use - Jun 15, 2014 * (Enno Nagel) reported that with having hls - set and wide listing style in use, that the - b and w maps caused unwanted highlighting. - Jul 05, 2014 * |netrw-mv| and |netrw-mX| commands included - Jul 09, 2014 * |g:netrw_keepj| included, allowing optional - keepj - Jul 09, 2014 * fixing bugs due to previous update - Jul 21, 2014 * (Bruno Sutic) provided an updated - netrw_gitignore.vim - Jul 30, 2014 * (Yavuz Yetim) reported that editing two - remote files of the same name caused the - second instance to have a "temporary" - name. Fixed: now they use the same buffer. - Sep 18, 2014 * (Yasuhiro Matsumoto) provided a patch which - allows scp and windows local paths to work. - Oct 07, 2014 * gx (see |netrw-gx|) when atop a directory, - will now do |gf| instead - Nov 06, 2014 * For cygwin: cygstart will be available for - netrw#BrowseX() to use if its executable. - Nov 07, 2014 * Began support for file://... urls. Will use - |g:netrw_file_cmd| (typically elinks or links) - Dec 02, 2014 * began work on having mc (|netrw-mc|) copy - directories. Works for linux machines, - cygwin+vim, but not for windows+gvim. - Dec 02, 2014 * in tree mode, netrw was not opening - directories via symbolic links. - Dec 02, 2014 * added resolved link information to - thin and tree modes - Dec 30, 2014 * (issue#231) |:ls| was not showing - remote-file buffers reliably. Fixed. - v152: Apr 08, 2014 * uses the |'noswapfile'| option (requires {{{2 - vim 7.4 with patch 213) - * (Enno Nagel) turn |'rnu'| off in netrw - buffers. - * (Quinn Strahl) suggested that netrw - allow regular window splitting to occur, - thereby allowing |'equalalways'| to take - effect. - * (qingtian zhao) normally, netrw will - save and restore the |'fileformat'|; - however, sometimes that isn't wanted - Apr 14, 2014 * whenever netrw marks a buffer as ro, - it will also mark it as nomod. - Apr 16, 2014 * sftp protocol now supported by - netrw#Obtain(); this means that one - may use "mc" to copy a remote file - to a local file using sftp, and that - the |netrw-O| command can obtain remote - files via sftp. - * added [count]C support (see |netrw-C|) - Apr 18, 2014 * when |g:netrw_chgwin| is one more than - the last window, then vertically split - the last window and use it as the - chgwin window. - May 09, 2014 * SavePosn was "saving filename under cursor" - from a non-netrw window when using :Rex. - v151: Jan 22, 2014 * extended :Rexplore to return to buffer {{{2 - prior to Explore or editing a directory - * (Ken Takata) netrw gave error when - clipboard was disabled. Sol'n: Placed - several if has("clipboard") tests in. - * Fixed ftp://X@Y@Z// problem; X@Y now - part of user id, and only Z is part of - hostname. - * (A Loumiotis) reported that completion - using a directory name containing spaces - did not work. Fixed with a retry in - netrw#Explore() which removes the - backslashes vim inserted. - Feb 26, 2014 * :Rexplore now records the current file - using w:netrw_rexfile when returning via - |:Rexplore| - Mar 08, 2014 * (David Kotchan) provided some patches - allowing netrw to work properly with - windows shares. - * Multiple one-liner help messages available - by pressing while atop the "Quick - Help" line - * worked on ShellCmdPost, FocusGained event - handling. - * |:Lexplore| path: will be used to update - a left-side netrw browsing directory. - Mar 12, 2014 * |netrw-s-cr|: use to close - tree directory implemented - Mar 13, 2014 * (Tony Mechylynck) reported that using - the browser with ftp on a directory, - and selecting a gzipped txt file, that - an E19 occurred (which was issued by - gzip.vim). Fixed. - Mar 14, 2014 * Implemented :MF and :MT (see |netrw-:MF| - and |netrw-:MT|, respectively) - Mar 17, 2014 * |:Ntree| [dir] wasn't working properly; fixed - Mar 18, 2014 * Changed all uses of set to setl - Mar 18, 2014 * Commented the netrw_btkeep line in - s:NetrwOptionSave(); the effect is that - netrw buffers will remain as |'bt'|=nofile. - This should prevent swapfiles being created - for netrw buffers. - Mar 20, 2014 * Changed all uses of lcd to use s:NetrwLcd() - instead. Consistent error handling results - and it also handles Window's shares - * Fixed |netrw-d| command when applied with ftp - * https: support included for netrw#NetRead() - v150: Jul 12, 2013 * removed a "keepalt" to allow ":e #" to {{{2 - return to the netrw directory listing - Jul 13, 2013 * (Jonas Diemer) suggested changing - a to . - Jul 21, 2013 * (Yuri Kanivetsky) reported that netrw's - use of mkdir did not produce directories - following the user's umask. - Aug 27, 2013 * introduced |g:netrw_altfile| option - Sep 05, 2013 * s:Strlen() now uses |strdisplaywidth()| - when available, by default - Sep 12, 2013 * (Selyano Baldo) reported that netrw wasn't - opening some directories properly from the - command line. - Nov 09, 2013 * |:Lexplore| introduced - * (Ondrej Platek) reported an issue with - netrw's trees (P15). Fixed. - * (Jorge Solis) reported that "t" in - tree mode caused netrw to forget its - line position. - Dec 05, 2013 * Added file marking - (see |netrw-mf|) - Dec 05, 2013 * (Yasuhiro Matsumoto) Explore should use - strlen() instead s:Strlen() when handling - multibyte chars with strpart() - (ie. strpart() is byte oriented, not - display-width oriented). - Dec 09, 2013 * (Ken Takata) Provided a patch; File sizes - and a portion of timestamps were wrongly - highlighted with the directory color when - setting `:let g:netrw_liststyle=1` on Windows. - * (Paul Domaskis) noted that sometimes - cursorline was activating in non-netrw - windows. All but one setting of cursorline - was done via setl; there was one that was - overlooked. Fixed. - Dec 24, 2013 * (esquifit) asked that netrw allow the - /cygdrive prefix be a user-alterable - parameter. - Jan 02, 2014 * Fixed a problem with netrw-based ballon - evaluation (ie. netrw#NetrwBaloonHelp() - not having been loaded error messages) - Jan 03, 2014 * Fixed a problem with tree listings - * New command installed: |:Ntree| - Jan 06, 2014 * (Ivan Brennan) reported a problem with - |netrw-P|. Fixed. - Jan 06, 2014 * Fixed a problem with |netrw-P| when the - modified file was to be abandoned. - Jan 15, 2014 * (Matteo Cavalleri) reported that when the - banner is suppressed and tree listing is - used, a blank line was left at the top of - the display. Fixed. - Jan 20, 2014 * (Gideon Go) reported that, in tree listing - style, with a previous window open, that - the wrong directory was being used to open - a file. Fixed. (P21) - v149: Apr 18, 2013 * in wide listing format, now have maps for {{{2 - w and b to move to next/previous file - Apr 26, 2013 * one may now copy files in the same - directory; netrw will issue requests for - what names the files should be copied under - Apr 29, 2013 * Trying Benzinger's problem again. Seems - that commenting out the BufEnter and - installing VimEnter (only) works. Weird - problem! (tree listing, vim -O Dir1 Dir2) - May 01, 2013 * :Explore ftp://... wasn't working. Fixed. - May 02, 2013 * introduced |g:netrw_bannerbackslash| as - requested by Paul Domaskis. - Jul 03, 2013 * Explore now avoids splitting when a buffer - will be hidden. - v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct {{{2 - choice of listing style, hiding style, and - sorting style - -============================================================================== -13. Todo *netrw-todo* {{{1 - -07/29/09 : banner :|g:netrw_banner| can be used to suppress the - suppression banner. This feature is new and experimental, - so its in the process of being debugged. -09/04/09 : "gp" : See if it can be made to work for remote systems. - : See if it can be made to work with marked files. - -============================================================================== -14. Credits *netrw-credits* {{{1 - - Vim editor by Bram Moolenaar (Thanks, Bram!) - dav support by C Campbell - fetch support by Bram Moolenaar and C Campbell - ftp support by C Campbell - http support by Bram Moolenaar - rcp - rsync support by C Campbell (suggested by Erik Warendorph) - scp support by raf - sftp support by C Campbell - - inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell - - Jérôme Augé -- also using new buffer method with ftp+.netrc - Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, - fetch,... - Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution - Erik Warendorph -- for several suggestions (g:netrw_..._cmd - variables, rsync etc) - Doug Claar -- modifications to test for success with ftp - operation - -============================================================================== -Modelines: {{{1 -vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt new file mode 120000 index 0000000000..9a5c117e03 --- /dev/null +++ b/runtime/doc/pi_netrw.txt @@ -0,0 +1 @@ +../pack/dist/opt/netrw/doc/netrw.txt \ No newline at end of file diff --git a/runtime/doc/tags b/runtime/doc/tags index fbc8545ec8..6d1bf96995 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -9003,7 +9003,6 @@ netrw-ctrl-r pi_netrw.txt /*netrw-ctrl-r* netrw-ctrl_l pi_netrw.txt /*netrw-ctrl_l* netrw-curdir pi_netrw.txt /*netrw-curdir* netrw-d pi_netrw.txt /*netrw-d* -netrw-debug pi_netrw.txt /*netrw-debug* netrw-del pi_netrw.txt /*netrw-del* netrw-delete pi_netrw.txt /*netrw-delete* netrw-dir pi_netrw.txt /*netrw-dir* @@ -9037,7 +9036,6 @@ netrw-help pi_netrw.txt /*netrw-help* netrw-hexplore pi_netrw.txt /*netrw-hexplore* netrw-hide pi_netrw.txt /*netrw-hide* netrw-hiding pi_netrw.txt /*netrw-hiding* -netrw-history pi_netrw.txt /*netrw-history* netrw-horiz pi_netrw.txt /*netrw-horiz* netrw-i pi_netrw.txt /*netrw-i* netrw-incompatible pi_netrw.txt /*netrw-incompatible* @@ -9148,7 +9146,6 @@ netrw-starstarpat pi_netrw.txt /*netrw-starstarpat* netrw-start pi_netrw.txt /*netrw-start* netrw-t pi_netrw.txt /*netrw-t* netrw-texplore pi_netrw.txt /*netrw-texplore* -netrw-todo pi_netrw.txt /*netrw-todo* netrw-trailingslash pi_netrw.txt /*netrw-trailingslash* netrw-transparent pi_netrw.txt /*netrw-transparent* netrw-u pi_netrw.txt /*netrw-u* @@ -9165,6 +9162,7 @@ netrw-windows-s pi_netrw.txt /*netrw-windows-s* netrw-write pi_netrw.txt /*netrw-write* netrw-x pi_netrw.txt /*netrw-x* netrw-xfer pi_netrw.txt /*netrw-xfer* +netrw.txt pi_netrw.txt /*netrw.txt* netrw.vim pi_netrw.txt /*netrw.vim* netterm-mouse options.txt /*netterm-mouse* network pi_netrw.txt /*network* @@ -9479,7 +9477,6 @@ phtml.vim syntax.txt /*phtml.vim* pi_getscript.txt pi_getscript.txt /*pi_getscript.txt* pi_gzip.txt pi_gzip.txt /*pi_gzip.txt* pi_logipat.txt pi_logipat.txt /*pi_logipat.txt* -pi_netrw.txt pi_netrw.txt /*pi_netrw.txt* pi_paren.txt pi_paren.txt /*pi_paren.txt* pi_spec.txt pi_spec.txt /*pi_spec.txt* pi_tar.txt pi_tar.txt /*pi_tar.txt* diff --git a/runtime/pack/dist/opt/netrw/LICENSE.txt b/runtime/pack/dist/opt/netrw/LICENSE.txt new file mode 100644 index 0000000000..702c2386ac --- /dev/null +++ b/runtime/pack/dist/opt/netrw/LICENSE.txt @@ -0,0 +1,16 @@ +Unless otherwise stated, all files in this directory are distributed under the +Zero-Clause BSD license. + +Zero-Clause BSD +=============== + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN +AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/runtime/pack/dist/opt/netrw/README.md b/runtime/pack/dist/opt/netrw/README.md new file mode 100644 index 0000000000..ecd97f1e9a --- /dev/null +++ b/runtime/pack/dist/opt/netrw/README.md @@ -0,0 +1,544 @@ +# Netrw.vim + +netrw.vim plugin from vim (upstream repository) + +The upstream maintained netrw plugin. The original has been created and +maintained by Charles E Campbell and maintained by the vim project until +v9.1.0988. + +Every major version a snapshot from here will be sent to the main [Vim][1] +upstream for distribution with Vim. + +# License + +To see License informations see the LICENSE.txt file included in this +repository. + +# Credits + +Below are stated the contribution made in the past to netrw. + +Changes made to `autoload/netrw.vim`: +- 2023 Nov 21 by Vim Project: ignore wildignore when expanding $COMSPEC (v173a) +- 2023 Nov 22 by Vim Project: fix handling of very long filename on longlist style (v173a) +- 2024 Feb 19 by Vim Project: (announce adoption) +- 2024 Feb 29 by Vim Project: handle symlinks in tree mode correctly +- 2024 Apr 03 by Vim Project: detect filetypes for remote edited files +- 2024 May 08 by Vim Project: cleanup legacy Win9X checks +- 2024 May 09 by Vim Project: remove hard-coded private.ppk +- 2024 May 10 by Vim Project: recursively delete directories by default +- 2024 May 13 by Vim Project: prefer scp over pscp +- 2024 Jun 04 by Vim Project: set bufhidden if buffer changed, nohidden is set and buffer shall be switched (#14915) +- 2024 Jun 13 by Vim Project: glob() on Windows fails when a directory name contains [] (#14952) +- 2024 Jun 23 by Vim Project: save ad restore registers when liststyle = WIDELIST (#15077, #15114) +- 2024 Jul 22 by Vim Project: avoid endless recursion (#15318) +- 2024 Jul 23 by Vim Project: escape filename before trying to delete it (#15330) +- 2024 Jul 30 by Vim Project: handle mark-copy to same target directory (#12112) +- 2024 Aug 02 by Vim Project: honor g:netrw_alt{o,v} for :{S,H,V}explore (#15417) +- 2024 Aug 15 by Vim Project: style changes, prevent E121 (#15501) +- 2024 Aug 22 by Vim Project: fix mf-selection highlight (#15551) +- 2024 Aug 22 by Vim Project: adjust echo output of mx command (#15550) +- 2024 Sep 15 by Vim Project: more strict confirmation dialog (#15680) +- 2024 Sep 19 by Vim Project: mf-selection highlight uses wrong pattern (#15700) +- 2024 Sep 21 by Vim Project: remove extraneous closing bracket (#15718) +- 2024 Oct 21 by Vim Project: remove netrwFileHandlers (#15895) +- 2024 Oct 27 by Vim Project: clean up gx mapping (#15721) +- 2024 Oct 30 by Vim Project: fix filetype detection for remote files (#15961) +- 2024 Oct 30 by Vim Project: fix x mapping on cygwin (#13687) +- 2024 Oct 31 by Vim Project: add netrw#Launch() and netrw#Open() (#15962) +- 2024 Oct 31 by Vim Project: fix E874 when browsing remote dir (#15964) +- 2024 Nov 07 by Vim Project: use keeppatterns to prevent polluting the search history +- 2024 Nov 07 by Vim Project: fix a few issues with netrw tree listing (#15996) +- 2024 Nov 10 by Vim Project: directory symlink not resolved in tree view (#16020) +- 2024 Nov 14 by Vim Project: small fixes to netrw#BrowseX (#16056) +- 2024 Nov 23 by Vim Project: update decompress defaults (#16104) +- 2024 Nov 23 by Vim Project: fix powershell escaping issues (#16094) +- 2024 Dec 04 by Vim Project: do not detach for gvim (#16168) +- 2024 Dec 08 by Vim Project: check the first arg of netrw_browsex_viewer for being executable (#16185) +- 2024 Dec 12 by Vim Project: do not pollute the search history (#16206) +- 2024 Dec 19 by Vim Project: change style (#16248) +- 2024 Dec 20 by Vim Project: change style continued (#16266), fix escaping of # in :Open command (#16265) + +General changes made to netrw: + +``` + v172: Sep 02, 2021 * (Bram Moolenaar) Changed "l:go" to "go" + * (Bram Moolenaar) no need for "b" in + netrw-safe guioptions + Nov 15, 2021 * removed netrw_localrm and netrw_localrmdir + references + Aug 18, 2022 * (Miguel Barro) improving compatibility with + powershell + v171: Oct 09, 2020 * included code in s:NetrwOptionsSafe() + to allow |'bh'| to be set to delete when + rather than hide when g:netrw_fastbrowse + was zero. + * Installed |g:netrw_clipboard| setting + * Installed option bypass for |'guioptions'| + a/A settings + * Changed popup_beval() to |popup_atcursor()| + in netrw#ErrorMsg (lacygoill). Apparently + popup_beval doesn't reliably close the + popup when the mouse is moved. + * VimEnter() now using win_execute to examine + buffers for an attempt to open a directory. + Avoids issues with popups/terminal from + command line. (lacygoill) + Jun 28, 2021 * (zeertzjq) provided a patch for use of + xmap,xno instead of vmap,vno in + netrwPlugin.vim. Avoids entanglement with + select mode. + Jul 14, 2021 * Fixed problem addressed by tst976; opening + a file using tree mode, going up a + directory, and opening a file there was + opening the file in the wrong directory. + Jul 28, 2021 * (Ingo Karkat) provided a patch fixing an + E488 error with netrwPlugin.vim + (occurred for vim versions < 8.02) + v170: Mar 11, 2020 * (reported by Reiner Herrmann) netrw+tree + would not hide with the ^\..* pattern + correctly. + * (Marcin Szamotulski) NetrwOptionRestore + did not restore options correctly that + had a single quote in the option string. + Apr 13, 2020 * implemented error handling via popup + windows (see |popup_beval()|) + Apr 30, 2020 * (reported by Manatsu Takahashi) while + using Lexplore, a modified file could + be overwritten. Sol'n: will not overwrite, + but will emit an |E37| (although one cannot + add an ! to override) + Jun 07, 2020 * (reported by Jo Totland) repeatedly invoking + :Lexplore and quitting it left unused + hidden buffers. Netrw will now set netrw + buffers created by :Lexplore to |'bh'|=wipe. + v169: Dec 20, 2019 * (reported by amkarthik) that netrw's x + (|netrw-x|) would throw an error when + attempting to open a local directory. + v168: Dec 12, 2019 * scp timeout error message not reported, + hopefully now fixed (Shane Xb Qian) + v167: Nov 29, 2019 * netrw does a save&restore on @* and @+. + That causes problems with the clipboard. + Now restores occurs only if @* or @+ have + been changed. + * netrw will change @* or @+ less often. + Never if I happen to have caught all the + operations that modify the unnamed + register (which also writes @*). + * Modified hiding behavior so that "s" + will not ignore hiding. + v166: Nov 06, 2019 * Removed a space from a nmap for "-" + * Numerous debugging statement changes + v163: Dec 05, 2017 * (Cristi Balan) reported that a setting ('sel') + was left changed + * (Holger Mitschke) reported a problem with + saving and restoring history. Fixed. + * Hopefully I fixed a nasty bug that caused a + file rename to wipe out a buffer that it + should not have wiped out. + * (Holger Mitschke) amended this help file + with additional |g:netrw_special_syntax| + items + * Prioritized wget over curl for + g:netrw_http_cmd + v162: Sep 19, 2016 * (haya14busa) pointed out two syntax errors + with a patch; these are now fixed. + Oct 26, 2016 * I started using mate-terminal and found that + x and gx (|netrw-x| and |netrw-gx|) were no + longer working. Fixed (using atril when + $DESKTOP_SESSION is "mate"). + Nov 04, 2016 * (Martin Vuille) pointed out that @+ was + being restored with keepregstar rather than + keepregplus. + Nov 09, 2016 * Broke apart the command from the options, + mostly for Windows. Introduced new netrw + settings: |g:netrw_localcopycmdopt| + |g:netrw_localcopydircmdopt| + |g:netrw_localmkdiropt| + |g:netrw_localmovecmdopt| + Nov 21, 2016 * (mattn) provided a patch for preview; swapped + winwidth() with winheight() + Nov 22, 2016 * (glacambre) reported that files containing + spaces weren't being obtained properly via + scp. Fix: apparently using single quotes + such as with 'file name' wasn't enough; the + spaces inside the quotes also had to be + escaped (ie. 'file\ name'). + * Also fixed obtain (|netrw-O|) to be able to + obtain files with spaces in their names + Dec 20, 2016 * (xc1427) Reported that using "I" (|netrw-I|) + when atop "Hiding" in the banner also caused + the active-banner hiding control to occur + Jan 03, 2017 * (Enno Nagel) reported that attempting to + apply netrw to a directory that was without + read permission caused a syntax error. + Jan 13, 2017 * (Ingo Karkat) provided a patch which makes + using netrw#Call() better. Now returns + value of internal routines return, for example. + Jan 13, 2017 * (Ingo Karkat) changed netrw#FileUrlRead to + use |:edit| instead of |:read|. I also + changed the routine name to netrw#FileUrlEdit. + Jan 16, 2017 * (Sayem) reported a problem where :Lexplore + could generate a new listing buffer and + window instead of toggling the netrw display. + Unfortunately, the directions for eliciting + the problem weren't complete, so I may or + may not have fixed that issue. + Feb 06, 2017 * Implemented cb and cB. Changed "c" to "cd". + (see |netrw-cb|, |netrw-cB|, and |netrw-cd|) + Mar 21, 2017 * previously, netrw would specify (safe) settings + even when the setting was already safe for + netrw. Netrw now attempts to leave such + already-netrw-safe settings alone. + (affects s:NetrwOptionRestore() and + s:NetrwSafeOptions(); also introduced + s:NetrwRestoreSetting()) + Jun 26, 2017 * (Christian Brabandt) provided a patch to + allow curl to follow redirects (ie. -L + option) + Jun 26, 2017 * (Callum Howard) reported a problem with + :Lexpore not removing the Lexplore window + after a change-directory + Aug 30, 2017 * (Ingo Karkat) one cannot switch to the + previously edited file (e.g. with CTRL-^) + after editing a file:// URL. Patch to + have a "keepalt" included. + Oct 17, 2017 * (Adam Faryna) reported that gn (|netrw-gn|) + did not work on directories in the current + tree + v157: Apr 20, 2016 * (Nicola) had set up a "nmap ..." with + a function that returned a 0 while silently + invoking a shell command. The shell command + activated a ShellCmdPost event which in turn + called s:LocalBrowseRefresh(). That looks + over all netrw buffers for changes needing + refreshes. However, inside a |:map-|, + tab and window changes are disallowed. Fixed. + (affects netrw's s:LocalBrowseRefresh()) + * g:netrw_localrmdir not used any more, but + the relevant patch that causes |delete()| to + take over was #1107 (not #1109). + * |expand()| is now used on |g:netrw_home|; + consequently, g:netrw_home may now use + environment variables + * s:NetrwLeftmouse and s:NetrwCLeftmouse will + return without doing anything if invoked + when inside a non-netrw window + Jun 15, 2016 * gx now calls netrw#GX() which returns + the word under the cursor. The new + wrinkle: if one is in a netrw buffer, + then netrw's s:NetrwGetWord(). + Jun 22, 2016 * Netrw was executing all its associated + Filetype commands silently; I'm going + to try doing that "noisily" and see if + folks have a problem with that. + Aug 12, 2016 * Changed order of tool selection for + handling http://... viewing. + (Nikolay Aleksandrovich Pavlov) + Aug 21, 2016 * Included hiding/showing/all for tree + listings + * Fixed refresh (^L) for tree listings + v156: Feb 18, 2016 * Changed =~ to =~# where appropriate + Feb 23, 2016 * s:ComposePath(base,subdir) now uses + fnameescape() on the base portion + Mar 01, 2016 * (gt_macki) reported where :Explore would + make file unlisted. Fixed (tst943) + Apr 04, 2016 * (reported by John Little) netrw normally + suppresses browser messages, but sometimes + those "messages" are what is wanted. + See |g:netrw_suppress_gx_mesg| + Apr 06, 2016 * (reported by Carlos Pita) deleting a remote + file was giving an error message. Fixed. + Apr 08, 2016 * (Charles Cooper) had a problem with an + undefined b:netrw_curdir. He also provided + a fix. + Apr 20, 2016 * Changed s:NetrwGetBuffer(); now uses + dictionaries. Also fixed the "No Name" + buffer problem. + v155: Oct 29, 2015 * (Timur Fayzrakhmanov) reported that netrw's + mapping of ctrl-l was not allowing refresh of + other windows when it was done in a netrw + window. + Nov 05, 2015 * Improved s:TreeSqueezeDir() to use search() + instead of a loop + * NetrwBrowse() will return line to + w:netrw_bannercnt if cursor ended up in + banner + Nov 16, 2015 * Added a NetrwTreeSqueeze (|netrw-s-cr|) + Nov 17, 2015 * Commented out imaps -- perhaps someone can + tell me how they're useful and should be + retained? + Nov 20, 2015 * Added |netrw-ma| and |netrw-mA| support + Nov 20, 2015 * gx (|netrw-gx|) on a URL downloaded the + file in addition to simply bringing up the + URL in a browser. Fixed. + Nov 23, 2015 * Added |g:netrw_sizestyle| support + Nov 27, 2015 * Inserted a lot of s into various netrw + maps. + Jan 05, 2016 * |netrw-qL| implemented to mark files based + upon |location-list|s; similar to |netrw-qF|. + Jan 19, 2016 * using - call delete(directoryname,"d") - + instead of using g:netrw_localrmdir if + v7.4 + patch#1107 is available + Jan 28, 2016 * changed to using |winsaveview()| and + |winrestview()| + Jan 28, 2016 * s:NetrwTreePath() now does a save and + restore of view + Feb 08, 2016 * Fixed a tree-listing problem with remote + directories + v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where + a file was not treated properly as a file + due to g:netrw_keepdir == 1 + Mar 25, 2015 * (requested by Ben Friz) one may now sort by + extension + Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot + of buffer-local mappings; however, some + plugins (such as vim-surround) set up + conflicting mappings that cause vim to wait. + The "" modifier has been included + with most of netrw's mappings to avoid that + delay. + Jun 26, 2015 * |netrw-gn| mapping implemented + * :Ntree NotADir resulted in having + the tree listing expand in the error messages + window. Fixed. + Jun 29, 2015 * Attempting to delete a file remotely caused + an error with "keepsol" mentioned; fixed. + Jul 08, 2015 * Several changes to keep the |:jumps| table + correct when working with + |g:netrw_fastbrowse| set to 2 + * wide listing with accented characters fixed + (using %-S instead of %-s with a |printf()| + Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true + but kfmclient not installed. Changed order + in netrw#BrowseX(): checks if kde and + kfmclient, then will use xdg-open on a unix + system (if xdg-open is executable) + Aug 11, 2015 * (McDonnell) tree listing mode wouldn't + select a file in a open subdirectory. + * (McDonnell) when multiple subdirectories + were concurrently open in tree listing + mode, a ctrl-L wouldn't refresh properly. + * The netrw:target menu showed duplicate + entries + Oct 13, 2015 * (mattn) provided an exception to handle + windows with shellslash set but no shell + Oct 23, 2015 * if g:netrw_usetab and now used + to control whether NetrwShrink is used + (see |netrw-c-tab|) + v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2 + May 14, 2014 * changed s:PerformListing() so that it + always sets ft=netrw for netrw buffers + (ie. even when syntax highlighting is + off, not available, etc) + May 16, 2014 * introduced the |netrw-ctrl-r| functionality + May 17, 2014 * introduced the |netrw-:NetrwMB| functionality + * mb and mB (|netrw-mb|, |netrw-mB|) will + add/remove marked files from bookmark list + May 20, 2014 * (Enno Nagel) reported that :Lex + wasn't working. Fixed. + May 26, 2014 * restored test to prevent leftmouse window + resizing from causing refresh. + (see s:NetrwLeftmouse()) + * fixed problem where a refresh caused cursor + to go just under the banner instead of + staying put + May 28, 2014 * (László Bimba) provided a patch for opening + the |:Lexplore| window 100% high, optionally + on the right, and will work with remote + files. + May 29, 2014 * implemented :NetrwC (see |netrw-:NetrwC|) + Jun 01, 2014 * Removed some "silent"s from commands used + to implemented scp://... and pscp://... + directory listing. Permits request for + password to appear. + Jun 05, 2014 * (Enno Nagel) reported that user maps "/" + caused problems with "b" and "w", which + are mapped (for wide listings only) to + skip over files rather than just words. + Jun 10, 2014 * |g:netrw_gx| introduced to allow users to + override default "" with the gx + (|netrw-gx|) map + Jun 11, 2014 * gx (|netrw-gx|), with |'autowrite'| set, + will write modified files. s:NetrwBrowseX() + will now save, turn off, and restore the + |'autowrite'| setting. + Jun 13, 2014 * added visual map for gx use + Jun 15, 2014 * (Enno Nagel) reported that with having hls + set and wide listing style in use, that the + b and w maps caused unwanted highlighting. + Jul 05, 2014 * |netrw-mv| and |netrw-mX| commands included + Jul 09, 2014 * |g:netrw_keepj| included, allowing optional + keepj + Jul 09, 2014 * fixing bugs due to previous update + Jul 21, 2014 * (Bruno Sutic) provided an updated + netrw_gitignore.vim + Jul 30, 2014 * (Yavuz Yetim) reported that editing two + remote files of the same name caused the + second instance to have a "temporary" + name. Fixed: now they use the same buffer. + Sep 18, 2014 * (Yasuhiro Matsumoto) provided a patch which + allows scp and windows local paths to work. + Oct 07, 2014 * gx (see |netrw-gx|) when atop a directory, + will now do |gf| instead + Nov 06, 2014 * For cygwin: cygstart will be available for + netrw#BrowseX() to use if its executable. + Nov 07, 2014 * Began support for file://... urls. Will use + |g:netrw_file_cmd| (typically elinks or links) + Dec 02, 2014 * began work on having mc (|netrw-mc|) copy + directories. Works for linux machines, + cygwin+vim, but not for windows+gvim. + Dec 02, 2014 * in tree mode, netrw was not opening + directories via symbolic links. + Dec 02, 2014 * added resolved link information to + thin and tree modes + Dec 30, 2014 * (issue#231) |:ls| was not showing + remote-file buffers reliably. Fixed. + v152: Apr 08, 2014 * uses the |'noswapfile'| option (requires {{{2 + vim 7.4 with patch 213) + * (Enno Nagel) turn |'rnu'| off in netrw + buffers. + * (Quinn Strahl) suggested that netrw + allow regular window splitting to occur, + thereby allowing |'equalalways'| to take + effect. + * (qingtian zhao) normally, netrw will + save and restore the |'fileformat'|; + however, sometimes that isn't wanted + Apr 14, 2014 * whenever netrw marks a buffer as ro, + it will also mark it as nomod. + Apr 16, 2014 * sftp protocol now supported by + netrw#Obtain(); this means that one + may use "mc" to copy a remote file + to a local file using sftp, and that + the |netrw-O| command can obtain remote + files via sftp. + * added [count]C support (see |netrw-C|) + Apr 18, 2014 * when |g:netrw_chgwin| is one more than + the last window, then vertically split + the last window and use it as the + chgwin window. + May 09, 2014 * SavePosn was "saving filename under cursor" + from a non-netrw window when using :Rex. + v151: Jan 22, 2014 * extended :Rexplore to return to buffer {{{2 + prior to Explore or editing a directory + * (Ken Takata) netrw gave error when + clipboard was disabled. Sol'n: Placed + several if has("clipboard") tests in. + * Fixed ftp://X@Y@Z// problem; X@Y now + part of user id, and only Z is part of + hostname. + * (A Loumiotis) reported that completion + using a directory name containing spaces + did not work. Fixed with a retry in + netrw#Explore() which removes the + backslashes vim inserted. + Feb 26, 2014 * :Rexplore now records the current file + using w:netrw_rexfile when returning via + |:Rexplore| + Mar 08, 2014 * (David Kotchan) provided some patches + allowing netrw to work properly with + windows shares. + * Multiple one-liner help messages available + by pressing while atop the "Quick + Help" line + * worked on ShellCmdPost, FocusGained event + handling. + * |:Lexplore| path: will be used to update + a left-side netrw browsing directory. + Mar 12, 2014 * |netrw-s-cr|: use to close + tree directory implemented + Mar 13, 2014 * (Tony Mechylynck) reported that using + the browser with ftp on a directory, + and selecting a gzipped txt file, that + an E19 occurred (which was issued by + gzip.vim). Fixed. + Mar 14, 2014 * Implemented :MF and :MT (see |netrw-:MF| + and |netrw-:MT|, respectively) + Mar 17, 2014 * |:Ntree| [dir] wasn't working properly; fixed + Mar 18, 2014 * Changed all uses of set to setl + Mar 18, 2014 * Commented the netrw_btkeep line in + s:NetrwOptionSave(); the effect is that + netrw buffers will remain as |'bt'|=nofile. + This should prevent swapfiles being created + for netrw buffers. + Mar 20, 2014 * Changed all uses of lcd to use s:NetrwLcd() + instead. Consistent error handling results + and it also handles Window's shares + * Fixed |netrw-d| command when applied with ftp + * https: support included for netrw#NetRead() + v150: Jul 12, 2013 * removed a "keepalt" to allow ":e #" to {{{2 + return to the netrw directory listing + Jul 13, 2013 * (Jonas Diemer) suggested changing + a to . + Jul 21, 2013 * (Yuri Kanivetsky) reported that netrw's + use of mkdir did not produce directories + following the user's umask. + Aug 27, 2013 * introduced |g:netrw_altfile| option + Sep 05, 2013 * s:Strlen() now uses |strdisplaywidth()| + when available, by default + Sep 12, 2013 * (Selyano Baldo) reported that netrw wasn't + opening some directories properly from the + command line. + Nov 09, 2013 * |:Lexplore| introduced + * (Ondrej Platek) reported an issue with + netrw's trees (P15). Fixed. + * (Jorge Solis) reported that "t" in + tree mode caused netrw to forget its + line position. + Dec 05, 2013 * Added file marking + (see |netrw-mf|) + Dec 05, 2013 * (Yasuhiro Matsumoto) Explore should use + strlen() instead s:Strlen() when handling + multibyte chars with strpart() + (ie. strpart() is byte oriented, not + display-width oriented). + Dec 09, 2013 * (Ken Takata) Provided a patch; File sizes + and a portion of timestamps were wrongly + highlighted with the directory color when + setting `:let g:netrw_liststyle=1` on Windows. + * (Paul Domaskis) noted that sometimes + cursorline was activating in non-netrw + windows. All but one setting of cursorline + was done via setl; there was one that was + overlooked. Fixed. + Dec 24, 2013 * (esquifit) asked that netrw allow the + /cygdrive prefix be a user-alterable + parameter. + Jan 02, 2014 * Fixed a problem with netrw-based ballon + evaluation (ie. netrw#NetrwBaloonHelp() + not having been loaded error messages) + Jan 03, 2014 * Fixed a problem with tree listings + * New command installed: |:Ntree| + Jan 06, 2014 * (Ivan Brennan) reported a problem with + |netrw-P|. Fixed. + Jan 06, 2014 * Fixed a problem with |netrw-P| when the + modified file was to be abandoned. + Jan 15, 2014 * (Matteo Cavalleri) reported that when the + banner is suppressed and tree listing is + used, a blank line was left at the top of + the display. Fixed. + Jan 20, 2014 * (Gideon Go) reported that, in tree listing + style, with a previous window open, that + the wrong directory was being used to open + a file. Fixed. (P21) + v149: Apr 18, 2013 * in wide listing format, now have maps for {{{2 + w and b to move to next/previous file + Apr 26, 2013 * one may now copy files in the same + directory; netrw will issue requests for + what names the files should be copied under + Apr 29, 2013 * Trying Benzinger's problem again. Seems + that commenting out the BufEnter and + installing VimEnter (only) works. Weird + problem! (tree listing, vim -O Dir1 Dir2) + May 01, 2013 * :Explore ftp://... wasn't working. Fixed. + May 02, 2013 * introduced |g:netrw_bannerbackslash| as + requested by Paul Domaskis. + Jul 03, 2013 * Explore now avoids splitting when a buffer + will be hidden. + v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct {{{2 + choice of listing style, hiding style, and + sorting style +``` + +[1]: https://github.com/vim/vim diff --git a/runtime/autoload/netrw.vim b/runtime/pack/dist/opt/netrw/autoload/netrw.vim similarity index 99% rename from runtime/autoload/netrw.vim rename to runtime/pack/dist/opt/netrw/autoload/netrw.vim index 25efab0418..51ac9dd2ac 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrw.vim @@ -1,51 +1,6 @@ -" netrw.vim: Handles file transfer and remote directory listing across -" AUTOLOAD SECTION -" Maintainer: This runtime file is looking for a new maintainer. -" Date: May 03, 2023 -" Version: 173a -" Last Change: {{{1 -" 2023 Nov 21 by Vim Project: ignore wildignore when expanding $COMSPEC (v173a) -" 2023 Nov 22 by Vim Project: fix handling of very long filename on longlist style (v173a) -" 2024 Feb 19 by Vim Project: (announce adoption) -" 2024 Feb 29 by Vim Project: handle symlinks in tree mode correctly -" 2024 Apr 03 by Vim Project: detect filetypes for remote edited files -" 2024 May 08 by Vim Project: cleanup legacy Win9X checks -" 2024 May 09 by Vim Project: remove hard-coded private.ppk -" 2024 May 10 by Vim Project: recursively delete directories by default -" 2024 May 13 by Vim Project: prefer scp over pscp -" 2024 Jun 04 by Vim Project: set bufhidden if buffer changed, nohidden is set and buffer shall be switched (#14915) -" 2024 Jun 13 by Vim Project: glob() on Windows fails when a directory name contains [] (#14952) -" 2024 Jun 23 by Vim Project: save ad restore registers when liststyle = WIDELIST (#15077, #15114) -" 2024 Jul 22 by Vim Project: avoid endless recursion (#15318) -" 2024 Jul 23 by Vim Project: escape filename before trying to delete it (#15330) -" 2024 Jul 30 by Vim Project: handle mark-copy to same target directory (#12112) -" 2024 Aug 02 by Vim Project: honor g:netrw_alt{o,v} for :{S,H,V}explore (#15417) -" 2024 Aug 15 by Vim Project: style changes, prevent E121 (#15501) -" 2024 Aug 22 by Vim Project: fix mf-selection highlight (#15551) -" 2024 Aug 22 by Vim Project: adjust echo output of mx command (#15550) -" 2024 Sep 15 by Vim Project: more strict confirmation dialog (#15680) -" 2024 Sep 19 by Vim Project: mf-selection highlight uses wrong pattern (#15700) -" 2024 Sep 21 by Vim Project: remove extraneous closing bracket (#15718) -" 2024 Oct 21 by Vim Project: remove netrwFileHandlers (#15895) -" 2024 Oct 27 by Vim Project: clean up gx mapping (#15721) -" 2024 Oct 30 by Vim Project: fix filetype detection for remote files (#15961) -" 2024 Oct 30 by Vim Project: fix x mapping on cygwin (#13687) -" 2024 Oct 31 by Vim Project: add netrw#Launch() and netrw#Open() (#15962) -" 2024 Oct 31 by Vim Project: fix E874 when browsing remote dir (#15964) -" 2024 Nov 07 by Vim Project: use keeppatterns to prevent polluting the search history -" 2024 Nov 07 by Vim Project: fix a few issues with netrw tree listing (#15996) -" 2024 Nov 10 by Vim Project: directory symlink not resolved in tree view (#16020) -" 2024 Nov 14 by Vim Project: small fixes to netrw#BrowseX (#16056) -" 2024 Nov 23 by Vim Project: update decompress defaults (#16104) -" 2024 Nov 23 by Vim Project: fix powershell escaping issues (#16094) -" 2024 Dec 04 by Vim Project: do not detach for gvim (#16168) -" 2024 Dec 08 by Vim Project: check the first arg of netrw_browsex_viewer for being executable (#16185) -" 2024 Dec 12 by Vim Project: do not pollute the search history (#16206) -" 2024 Dec 19 by Vim Project: change style (#16248) -" 2024 Dec 20 by Vim Project: change style continued (#16266), fix escaping of # in :Open command (#16265) -" }}} -" Former Maintainer: Charles E Campbell -" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim +" Maintainer: Luca Saccarola +" Former Maintainer: Charles E Campbell +" Upstream: " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -58,12 +13,7 @@ " " Note: the code here was started in 1999 under a much earlier version of vim. The directory browsing " code was written using vim v6, which did not have Lists (Lists were first offered with vim-v7). -" -"redraw!|call DechoSep()|call inputsave()|call input("Press to continue")|call inputrestore() -" -" But be doers of the Word, and not only hearers, deluding your own selves {{{1 -" (James 1:22 RSV) -" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + " Load Once: {{{1 if &cp || exists("g:loaded_netrw") finish @@ -85,7 +35,7 @@ if exists("s:needspatches") endfor endif -let g:loaded_netrw = "v173" +let g:loaded_netrw = "v174" let s:keepcpo= &cpo setl cpo&vim diff --git a/runtime/autoload/netrwSettings.vim b/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim similarity index 95% rename from runtime/autoload/netrwSettings.vim rename to runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim index 3452602272..fd43c16c4e 100644 --- a/runtime/autoload/netrwSettings.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim @@ -1,10 +1,6 @@ -" netrwSettings.vim: makes netrw settings simpler -" Date: Nov 15, 2021 -" Maintainer: This runtime file is looking for a new maintainer. +" Maintainer: Luca Saccarola " Former Maintainer: Charles E Campbell -" Version: 18 -" Last Change: -" 2024 May 08 by Vim Project: cleanup legacy Win9X checks +" Upstream: " Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -14,15 +10,12 @@ " this plugin, you agree that in no event will the copyright " holder be liable for any damages resulting from the use " of this software. -" -" Mat 4:23 (WEB) Jesus went about in all Galilee, teaching in their {{{1 -" synagogues, preaching the gospel of the kingdom, and healing -" every disease and every sickness among the people. + " Load Once: {{{1 if exists("g:loaded_netrwSettings") || &cp finish endif -let g:loaded_netrwSettings = "v18" +let g:loaded_netrwSettings = "v174" if v:version < 700 echohl WarningMsg echo "***warning*** this version of netrwSettings needs vim 7.0" diff --git a/runtime/autoload/netrw_gitignore.vim b/runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim similarity index 89% rename from runtime/autoload/netrw_gitignore.vim rename to runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim index 1b55e2488a..6c1d8582b8 100644 --- a/runtime/autoload/netrw_gitignore.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim @@ -1,3 +1,7 @@ +" Maintainer: Luca Saccarola +" Former Maintainer: Bruno Sutic +" Upstream: + " netrw_gitignore#Hide: gitignore-based hiding " Function returns a string of comma separated patterns convenient for " assignment to `g:netrw_list_hide` option. diff --git a/runtime/pack/dist/opt/netrw/doc/netrw.txt b/runtime/pack/dist/opt/netrw/doc/netrw.txt new file mode 100644 index 0000000000..9d277ea45a --- /dev/null +++ b/runtime/pack/dist/opt/netrw/doc/netrw.txt @@ -0,0 +1,3803 @@ +*netrw.txt* + + ------------------------------------------------ + NETRW REFERENCE MANUAL by Charles E.Cambell + ------------------------------------------------ +Original Author: Charles E. Campbell + +Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright* + The VIM LICENSE applies to the files in this package, including + netrw.vim, netrw.txt, netrwSettings.vim, and + syntax/netrw.vim. Like anything else that's free, netrw.vim and its + associated files are provided *as is* and comes with no warranty of + any kind, either expressed or implied. No guarantees of + merchantability. No guarantees of suitability for any purpose. By + using this plugin, you agree that in no event will the copyright + holder be liable for any damages resulting from the use of this + software. Use at your own risk! For bug reports, see |bugs|. + + *netrw* + *dav* *ftp* *netrw-file* *rcp* *scp* + *davs* *http* *netrw.vim* *rsync* *sftp* + *fetch* *network* + +============================================================================== +1. Contents *netrw-contents* {{{1 + +1. Contents..............................................|netrw-contents| +2. Starting With Netrw...................................|netrw-start| +3. Netrw Reference.......................................|netrw-ref| + EXTERNAL APPLICATIONS AND PROTOCOLS.................|netrw-externapp| + READING.............................................|netrw-read| + WRITING.............................................|netrw-write| + SOURCING............................................|netrw-source| + DIRECTORY LISTING...................................|netrw-dirlist| + CHANGING THE USERID AND PASSWORD....................|netrw-chgup| + VARIABLES AND SETTINGS..............................|netrw-variables| + PATHS...............................................|netrw-path| +4. Network-Oriented File Transfer........................|netrw-xfer| + NETRC...............................................|netrw-netrc| + PASSWORD............................................|netrw-passwd| +5. Activation............................................|netrw-activate| +6. Transparent Remote File Editing.......................|netrw-transparent| +7. Ex Commands...........................................|netrw-ex| +8. Variables and Options.................................|netrw-variables| +9. Browsing..............................................|netrw-browse| + Introduction To Browsing............................|netrw-intro-browse| + Quick Reference: Maps...............................|netrw-browse-maps| + Quick Reference: Commands...........................|netrw-browse-cmds| + Banner Display......................................|netrw-I| + Bookmarking A Directory.............................|netrw-mb| + Browsing............................................|netrw-cr| + Squeezing the Current Tree-Listing Directory........|netrw-s-cr| + Browsing With A Horizontally Split Window...........|netrw-o| + Browsing With A New Tab.............................|netrw-t| + Browsing With A Vertically Split Window.............|netrw-v| + Change Listing Style (thin wide long tree)..........|netrw-i| + Changing To A Bookmarked Directory..................|netrw-gb| + Quick hide/unhide of dot-files......................|netrw-gh| + Changing local-only File Permission.................|netrw-gp| + Changing To A Predecessor Directory.................|netrw-u| + Changing To A Successor Directory...................|netrw-U| + Customizing Browsing With A Special Handler.........|netrw-x| + Deleting Bookmarks..................................|netrw-mB| + Deleting Files Or Directories.......................|netrw-D| + Directory Exploring Commands........................|netrw-explore| + Exploring With Stars and Patterns...................|netrw-star| + Displaying Information About File...................|netrw-qf| + Edit File Or Directory Hiding List..................|netrw-ctrl-h| + Editing The Sorting Sequence........................|netrw-S| + Forcing treatment as a file or directory............|netrw-gd| |netrw-gf| + Going Up............................................|netrw--| + Hiding Files Or Directories.........................|netrw-a| + Improving Browsing..................................|netrw-ssh-hack| + Listing Bookmarks And History.......................|netrw-qb| + Making A New Directory..............................|netrw-d| + Making The Browsing Directory The Current Directory.|netrw-cd| + Marking Files.......................................|netrw-mf| + Unmarking Files.....................................|netrw-mF| + Marking Files By Location List......................|netrw-qL| + Marking Files By QuickFix List......................|netrw-qF| + Marking Files By Regular Expression.................|netrw-mr| + Marked Files: Arbitrary Shell Command...............|netrw-mx| + Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX| + Marked Files: Arbitrary Vim Command.................|netrw-mv| + Marked Files: Argument List.........................|netrw-ma| |netrw-mA| + Marked Files: Buffer List...........................|netrw-cb| |netrw-cB| + Marked Files: Compression And Decompression.........|netrw-mz| + Marked Files: Copying...............................|netrw-mc| + Marked Files: Diff..................................|netrw-md| + Marked Files: Editing...............................|netrw-me| + Marked Files: Grep..................................|netrw-mg| + Marked Files: Hiding and Unhiding by Suffix.........|netrw-mh| + Marked Files: Moving................................|netrw-mm| + Marked Files: Printing..............................|netrw-mp| + Marked Files: Sourcing..............................|netrw-ms| + Marked Files: Setting the Target Directory..........|netrw-mt| + Marked Files: Tagging...............................|netrw-mT| + Marked Files: Target Directory Using Bookmarks......|netrw-Tb| + Marked Files: Target Directory Using History........|netrw-Th| + Marked Files: Unmarking.............................|netrw-mu| + Netrw Browser Variables.............................|netrw-browser-var| + Netrw Browsing And Option Incompatibilities.........|netrw-incompatible| + Netrw Settings Window...............................|netrw-settings-window| + Obtaining A File....................................|netrw-O| + Preview Window......................................|netrw-p| + Previous Window.....................................|netrw-P| + Refreshing The Listing..............................|netrw-ctrl-l| + Reversing Sorting Order.............................|netrw-r| + Renaming Files Or Directories.......................|netrw-R| + Selecting Sorting Style.............................|netrw-s| + Setting Editing Window..............................|netrw-C| +10. Problems and Fixes....................................|netrw-problems| +11. Credits...............................................|netrw-credits| + +============================================================================== +2. Starting With Netrw *netrw-start* {{{1 + +Netrw makes reading files, writing files, browsing over a network, and +local browsing easy! First, make sure that you have plugins enabled, so +you'll need to have at least the following in your <.vimrc>: +(or see |netrw-activate|) > + + set nocp " 'compatible' is not set + filetype plugin on " plugins are enabled +< +(see |'cp'| and |:filetype-plugin-on|) + +Netrw supports "transparent" editing of files on other machines using urls +(see |netrw-transparent|). As an example of this, let's assume you have an +account on some other machine; if you can use scp, try: > + + vim scp://hostname/path/to/file +< +Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|! + +So, what if you have ftp, not ssh/scp? That's easy, too; try > + + vim ftp://hostname/path/to/file +< +Want to make ftp simpler to use? See if your ftp supports a file called +<.netrc> -- typically it goes in your home directory, has read/write +permissions for only the user to read (ie. not group, world, other, etc), +and has lines resembling > + + machine HOSTNAME login USERID password "PASSWORD" + machine HOSTNAME login USERID password "PASSWORD" + ... + default login USERID password "PASSWORD" +< +Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: > + + let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE' +< +Netrw will substitute the host's machine name for "MACHINE" from the URL it is +attempting to open, and so one may specify > + userid + password +for each site in a separate file: c:\Users\MyUserName\MachineName. + +Now about browsing -- when you just want to look around before editing a +file. For browsing on your current host, just "edit" a directory: > + + vim . + vim /home/userid/path +< +For browsing on a remote host, "edit" a directory (but make sure that +the directory name is followed by a "/"): > + + vim scp://hostname/ + vim ftp://hostname/path/to/dir/ +< +See |netrw-browse| for more! + +There are more protocols supported by netrw than just scp and ftp, too: see the +next section, |netrw-externapp|, on how to use these external applications with +netrw and vim. + +PREVENTING LOADING *netrw-noload* + +If you want to use plugins, but for some reason don't wish to use netrw, then +you need to avoid loading both the plugin and the autoload portions of netrw. +You may do so by placing the following two lines in your <.vimrc>: > + + :let g:loaded_netrw = 1 + :let g:loaded_netrwPlugin = 1 +< + +============================================================================== +3. Netrw Reference *netrw-ref* {{{1 + + Netrw supports several protocols in addition to scp and ftp as mentioned + in |netrw-start|. These include dav, fetch, http,... well, just look + at the list in |netrw-externapp|. Each protocol is associated with a + variable which holds the default command supporting that protocol. + +EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2 + + Protocol Variable Default Value + -------- ---------------- ------------- + dav: *g:netrw_dav_cmd* = "cadaver" if cadaver is executable + dav: g:netrw_dav_cmd = "curl -o" elseif curl is available + fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available + ftp: *g:netrw_ftp_cmd* = "ftp" + http: *g:netrw_http_cmd* = "elinks" if elinks is available + http: g:netrw_http_cmd = "links" elseif links is available + http: g:netrw_http_cmd = "curl" elseif curl is available + http: g:netrw_http_cmd = "wget" elseif wget is available + http: g:netrw_http_cmd = "fetch" elseif fetch is available + http: *g:netrw_http_put_cmd* = "curl -T" + rcp: *g:netrw_rcp_cmd* = "rcp" + rsync: *g:netrw_rsync_cmd* = "rsync" (see |g:netrw_rsync_sep|) + scp: *g:netrw_scp_cmd* = "scp -q" + sftp: *g:netrw_sftp_cmd* = "sftp" + file: *g:netrw_file_cmd* = "elinks" or "links" + + *g:netrw_http_xcmd* : the option string for http://... protocols are + specified via this variable and may be independently overridden. By + default, the option arguments for the http-handling commands are: > + + elinks : "-source >" + links : "-dump >" + curl : "-L -o" + wget : "-q -O" + fetch : "-o" +< + For example, if your system has elinks, and you'd rather see the + page using an attempt at rendering the text, you may wish to have > + let g:netrw_http_xcmd= "-dump >" +< in your .vimrc. + + g:netrw_http_put_cmd: this option specifies both the executable and + any needed options. This command does a PUT operation to the url. + + +READING *netrw-read* *netrw-nread* {{{2 + + Generally, one may just use the URL notation with a normal editing + command, such as > + + :e ftp://[user@]machine/path +< + Netrw also provides the Nread command: + + :Nread ? give help + :Nread "machine:path" uses rcp + :Nread "machine path" uses ftp w/ <.netrc> + :Nread "machine id password path" uses ftp + :Nread "dav://machine[:port]/path" uses cadaver + :Nread "fetch://[user@]machine/path" uses fetch + :Nread "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nread "http://[user@]machine/path" uses http uses wget + :Nread "rcp://[user@]machine/path" uses rcp + :Nread "rsync://[user@]machine[:port]/path" uses rsync + :Nread "scp://[user@]machine[[:#]port]/path" uses scp + :Nread "sftp://[user@]machine/path" uses sftp + +WRITING *netrw-write* *netrw-nwrite* {{{2 + + One may just use the URL notation with a normal file writing + command, such as > + + :w ftp://[user@]machine/path +< + Netrw also provides the Nwrite command: + + :Nwrite ? give help + :Nwrite "machine:path" uses rcp + :Nwrite "machine path" uses ftp w/ <.netrc> + :Nwrite "machine id password path" uses ftp + :Nwrite "dav://machine[:port]/path" uses cadaver + :Nwrite "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nwrite "rcp://[user@]machine/path" uses rcp + :Nwrite "rsync://[user@]machine[:port]/path" uses rsync + :Nwrite "scp://[user@]machine[[:#]port]/path" uses scp + :Nwrite "sftp://[user@]machine/path" uses sftp + http: not supported! + +SOURCING *netrw-source* {{{2 + + One may just use the URL notation with the normal file sourcing + command, such as > + + :so ftp://[user@]machine/path +< + Netrw also provides the Nsource command: + + :Nsource ? give help + :Nsource "dav://machine[:port]/path" uses cadaver + :Nsource "fetch://[user@]machine/path" uses fetch + :Nsource "ftp://[user@]machine[[:#]port]/path" uses ftp w/ <.netrc> + :Nsource "http://[user@]machine/path" uses http uses wget + :Nsource "rcp://[user@]machine/path" uses rcp + :Nsource "rsync://[user@]machine[:port]/path" uses rsync + :Nsource "scp://[user@]machine[[:#]port]/path" uses scp + :Nsource "sftp://[user@]machine/path" uses sftp + +DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2 + + One may browse a directory to get a listing by simply attempting to + edit the directory: > + + :e scp://[user]@hostname/path/ + :e ftp://[user]@hostname/path/ +< + For remote directory listings (ie. those using scp or ftp), that + trailing "/" is necessary (the slash tells netrw to treat the argument + as a directory to browse instead of as a file to download). + + The Nread command may also be used to accomplish this (again, that + trailing slash is necessary): > + + :Nread [protocol]://[user]@hostname/path/ +< + *netrw-login* *netrw-password* +CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2 + + Attempts to use ftp will prompt you for a user-id and a password. + These will be saved in global variables |g:netrw_uid| and + |s:netrw_passwd|; subsequent use of ftp will re-use those two strings, + thereby simplifying use of ftp. However, if you need to use a + different user id and/or password, you'll want to call |NetUserPass()| + first. To work around the need to enter passwords, check if your ftp + supports a <.netrc> file in your home directory. Also see + |netrw-passwd| (and if you're using ssh/scp hoping to figure out how + to not need to use passwords for scp, look at |netrw-ssh-hack|). + + :NetUserPass [uid [password]] -- prompts as needed + :call NetUserPass() -- prompts for uid and password + :call NetUserPass("uid") -- prompts for password + :call NetUserPass("uid","password") -- sets global uid and password + +(Related topics: |ftp| |netrw-userpass| |netrw-start|) + +NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2 + (Also see: + |netrw-browser-var| : netrw browser option variables + |netrw-protocol| : file transfer protocol option variables + |netrw-settings| : additional file transfer options + |netrw-browser-options| : these options affect browsing directories + ) + +Netrw provides a lot of variables which allow you to customize netrw to your +preferences. One way to look at them is via the command :NetrwSettings (see +|netrw-settings|) which will display your current netrw settings. Most such +settings are described below, in |netrw-browser-options|, and in +|netrw-externapp|: + + *b:netrw_lastfile* last file Network-read/written retained on a + per-buffer basis (supports plain :Nw ) + + *g:netrw_bufsettings* the settings that netrw buffers have + (default) noma nomod nonu nowrap ro nobl + + *g:netrw_chgwin* specifies a window number where subsequent file edits + will take place. (also see |netrw-C|) + (default) -1 + + *g:Netrw_funcref* specifies a function (or functions) to be called when + netrw edits a file. The file is first edited, and + then the function reference (|Funcref|) is called. + This variable may also hold a |List| of Funcrefs. + (default) not defined. (the capital in g:Netrw... + is required by its holding a function reference) +> + Example: place in .vimrc; affects all file opening + fun! MyFuncRef() + endfun + let g:Netrw_funcref= function("MyFuncRef") + +< + *g:Netrw_UserMaps* specifies a function or |List| of functions which can + be used to set up user-specified maps and functionality. + See |netrw-usermaps| + + *g:netrw_ftp* if it doesn't exist, use default ftp + =0 use default ftp (uid password) + =1 use alternate ftp method (user uid password) + If you're having trouble with ftp, try changing the + value of this variable to see if the alternate ftp + method works for your setup. + + *g:netrw_ftp_options* Chosen by default, these options are supposed to + turn interactive prompting off and to restrain ftp + from attempting auto-login upon initial connection. + However, it appears that not all ftp implementations + support this (ex. ncftp). + ="-i -n" + + *g:netrw_ftpextracmd* default: doesn't exist + If this variable exists, then any string it contains + will be placed into the commands set to your ftp + client. As an example: + ="passive" + + *g:netrw_ftpmode* ="binary" (default) + ="ascii" + + *g:netrw_ignorenetrc* =0 (default for linux, cygwin) + =1 If you have a <.netrc> file but it doesn't work and + you want it ignored, then set this variable as + shown. (default for Windows + cmd.exe) + + *g:netrw_menu* =0 disable netrw's menu + =1 (default) netrw's menu enabled + + *g:netrw_nogx* if this variable exists, then the "gx" map will not + be available (see |netrw-gx|) + + *g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis + *s:netrw_passwd* (ftp) password, retained on a per-vim-session basis + + *g:netrw_preview* =0 (default) preview window shown in a horizontally + split window + =1 preview window shown in a vertically split window. + Also affects the "previous window" (see |netrw-P|) + in the same way. + The |g:netrw_alto| variable may be used to provide + additional splitting control: + g:netrw_preview g:netrw_alto result + 0 0 |:aboveleft| + 0 1 |:belowright| + 1 0 |:topleft| + 1 1 |:botright| + To control sizing, see |g:netrw_winsize| + + *g:netrw_scpport* = "-P" : option to use to set port for scp + *g:netrw_sshport* = "-p" : option to use to set port for ssh + + *g:netrw_sepchr* =\0xff + =\0x01 for enc == euc-jp (and perhaps it should be for + others, too, please let me know) + Separates priority codes from filenames internally. + See |netrw-p12|. + + *g:netrw_silent* =0 : transfers done normally + =1 : transfers done silently + + *g:netrw_use_errorwindow* =2: messages from netrw will use a popup window + Move the mouse and pause to remove the popup window. + (default value if popup windows are available) + =1 : messages from netrw will use a separate one + line window. This window provides reliable + delivery of messages. + (default value if popup windows are not available) + =0 : messages from netrw will use echoerr ; + messages don't always seem to show up this + way, but one doesn't have to quit the window. + + *g:netrw_cygwin* =1 assume scp under windows is from cygwin. Also + permits network browsing to use ls with time and + size sorting (default if windows) + =0 assume Windows' scp accepts windows-style paths + Network browsing uses dir instead of ls + This option is ignored if you're using unix + + *g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP + =1 use WinNT's rcp in binary mode (default) + +PATHS *netrw-path* {{{2 + +Paths to files are generally user-directory relative for most protocols. +It is possible that some protocol will make paths relative to some +associated directory, however. +> + example: vim scp://user@host/somefile + example: vim scp://user@host/subdir1/subdir2/somefile +< +where "somefile" is in the "user"'s home directory. If you wish to get a +file using root-relative paths, use the full path: +> + example: vim scp://user@host//somefile + example: vim scp://user@host//subdir1/subdir2/somefile +< + +============================================================================== +4. Network-Oriented File Transfer *netrw-xfer* {{{1 + +Network-oriented file transfer under Vim is implemented by a vim script +() using plugin techniques. It currently supports both reading and +writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, +dav/cadaver, rsync, or sftp. + +http is currently supported read-only via use of wget or fetch. + + is a standard plugin which acts as glue between Vim and the +various file transfer programs. It uses autocommand events (BufReadCmd, +FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. > + + ex. vim ftp://hostname/path/to/file +< +The characters preceding the colon specify the protocol to use; in the +example, it's ftp. The script then formulates a command or a +series of commands (typically ftp) which it issues to an external program +(ftp, scp, etc) which does the actual file transfer/protocol. Files are read +from/written to a temporary file (under Unix/Linux, /tmp/...) which the + script will clean up. + +Now, a word about Jan Minář's "FTP User Name and Password Disclosure"; first, +ftp is not a secure protocol. User names and passwords are transmitted "in +the clear" over the internet; any snooper tool can pick these up; this is not +a netrw thing, this is a ftp thing. If you're concerned about this, please +try to use scp or sftp instead. + +Netrw re-uses the user id and password during the same vim session and so long +as the remote hostname remains the same. + +Jan seems to be a bit confused about how netrw handles ftp; normally multiple +commands are performed in a "ftp session", and he seems to feel that the +uid/password should only be retained over one ftp session. However, netrw +does every ftp operation in a separate "ftp session"; so remembering the +uid/password for just one "ftp session" would be the same as not remembering +the uid/password at all. IMHO this would rapidly grow tiresome as one +browsed remote directories, for example. + +On the other hand, thanks go to Jan M. for pointing out the many +vulnerabilities that netrw (and vim itself) had had in handling "crafted" +filenames. The |shellescape()| and |fnameescape()| functions were written in +response by Bram Moolenaar to handle these sort of problems, and netrw has +been modified to use them. Still, my advice is, if the "filename" looks like +a vim command that you aren't comfortable with having executed, don't open it. + + *netrw-putty* *netrw-pscp* *netrw-psftp* +One may modify any protocol's implementing external application by setting a +variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to +"scp -q"). As an example, consider using PuTTY: > + + let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch' + let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"' +< +(note: it has been reported that windows 7 with putty v0.6's "-batch" option + doesn't work, so its best to leave it off for that system) + +See |netrw-p8| for more about putty, pscp, psftp, etc. + +Ftp, an old protocol, seems to be blessed by numerous implementations. +Unfortunately, some implementations are noisy (ie., add junk to the end of the +file). Thus, concerned users may decide to write a NetReadFixup() function +that will clean up after reading with their ftp. Some Unix systems (ie., +FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is +not noisy and more convenient, actually, for to use. +Consequently, if "fetch" is available (ie. executable), it may be preferable +to use it for ftp://... based transfers. + +For rcp, scp, sftp, and http, one may use network-oriented file transfers +transparently; ie. +> + vim rcp://[user@]machine/path + vim scp://[user@]machine/path +< +If your ftp supports <.netrc>, then it too can be transparently used +if the needed triad of machine name, user id, and password are present in +that file. Your ftp must be able to use the <.netrc> file on its own, however. +> + vim ftp://[user@]machine[[:#]portnumber]/path +< +Windows provides an ftp (typically c:\Windows\System32\ftp.exe) which uses +an option, -s:filename (filename can and probably should be a full path) +which contains ftp commands which will be automatically run whenever ftp +starts. You may use this feature to enter a user and password for one site: > + userid + password +< *netrw-windows-netrc* *netrw-windows-s* +If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines +only) netrw will substitute the current machine name requested for ftp +connections for MACHINE. Hence one can have multiple machine.ftp files +containing login and password for ftp. Example: > + + let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' + vim ftp://myhost.somewhere.net/ + +will use a file > + + C:\Users\Myself\myhost.ftp +< +Often, ftp will need to query the user for the userid and password. +The latter will be done "silently"; ie. asterisks will show up instead of +the actually-typed-in password. Netrw will retain the userid and password +for subsequent read/writes from the most recent transfer so subsequent +transfers (read/write) to or from that machine will take place without +additional prompting. + + *netrw-urls* + +=================================+============================+============+ + | Reading | Writing | Uses | + +=================================+============================+============+ + | DAV: | | | + | dav://host/path | | cadaver | + | :Nread dav://host/path | :Nwrite dav://host/path | cadaver | + +---------------------------------+----------------------------+------------+ + | DAV + SSL: | | | + | davs://host/path | | cadaver | + | :Nread davs://host/path | :Nwrite davs://host/path | cadaver | + +---------------------------------+----------------------------+------------+ + | FETCH: | | | + | fetch://[user@]host/path | | | + | fetch://[user@]host:http/path | Not Available | fetch | + | :Nread fetch://[user@]host/path| | | + +---------------------------------+----------------------------+------------+ + | FILE: | | | + | file:///* | file:///* | | + | file://localhost/* | file://localhost/* | | + +---------------------------------+----------------------------+------------+ + | FTP: (*3) | (*3) | | + | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) | + | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc | + | :Nread host path | :Nwrite host path | ftp+.netrc | + | :Nread host uid pass path | :Nwrite host uid pass path | ftp | + +---------------------------------+----------------------------+------------+ + | HTTP: wget is executable: (*4) | | | + | http://[user@]host/path | Not Available | wget | + +---------------------------------+----------------------------+------------+ + | HTTP: fetch is executable (*4) | | | + | http://[user@]host/path | Not Available | fetch | + +---------------------------------+----------------------------+------------+ + | RCP: | | | + | rcp://[user@]host/path | rcp://[user@]host/path | rcp | + +---------------------------------+----------------------------+------------+ + | RSYNC: | | | + | rsync://[user@]host/path | rsync://[user@]host/path | rsync | + | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync | + | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp | + +---------------------------------+----------------------------+------------+ + | SCP: | | | + | scp://[user@]host/path | scp://[user@]host/path | scp | + | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) | + +---------------------------------+----------------------------+------------+ + | SFTP: | | | + | sftp://[user@]host/path | sftp://[user@]host/path | sftp | + | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) | + +=================================+============================+============+ + + (*1) For an absolute path use scp://machine//path. + + (*2) if <.netrc> is present, it is assumed that it will + work with your ftp client. Otherwise the script will + prompt for user-id and password. + + (*3) for ftp, "machine" may be machine#port or machine:port + if a different port is needed than the standard ftp port + + (*4) for http:..., if wget is available it will be used. Otherwise, + if fetch is available it will be used. + +Both the :Nread and the :Nwrite ex-commands can accept multiple filenames. + + +NETRC *netrw-netrc* + +The <.netrc> file, typically located in your home directory, contains lines +therein which map a hostname (machine name) to the user id and password you +prefer to use with it. + +The typical syntax for lines in a <.netrc> file is given as shown below. +Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't. +> + machine {full machine name} login {user-id} password "{password}" + default login {user-id} password "{password}" + +Your ftp client must handle the use of <.netrc> on its own, but if the +<.netrc> file exists, an ftp transfer will not ask for the user-id or +password. + + Note: + Since this file contains passwords, make very sure nobody else can + read this file! Most programs will refuse to use a .netrc that is + readable for others. Don't forget that the system administrator can + still read the file! Ie. for Linux/Unix: chmod 600 .netrc + +Even though Windows' ftp clients typically do not support .netrc, netrw has +a work-around: see |netrw-windows-s|. + + +PASSWORD *netrw-passwd* + +The script attempts to get passwords for ftp invisibly using |inputsecret()|, +a built-in Vim function. See |netrw-userpass| for how to change the password +after one has set it. + +Unfortunately there doesn't appear to be a way for netrw to feed a password to +scp. Thus every transfer via scp will require re-entry of the password. +However, |netrw-ssh-hack| can help with this problem. + + +============================================================================== +5. Activation *netrw-activate* {{{1 + +Network-oriented file transfers are available by default whenever Vim's +|'nocompatible'| mode is enabled. Netrw's script files reside in your +system's plugin, autoload, and syntax directories; just the +plugin/netrwPlugin.vim script is sourced automatically whenever you bring up +vim. The main script in autoload/netrw.vim is only loaded when you actually +use netrw. I suggest that, at a minimum, you have at least the following in +your <.vimrc> customization file: > + + set nocp + if version >= 600 + filetype plugin indent on + endif +< +By also including the following lines in your .vimrc, one may have netrw +immediately activate when using [g]vim without any filenames, showing the +current directory: > + + " Augroup VimStartup: + augroup VimStartup + au! + au VimEnter * if expand("%") == "" | e . | endif + augroup END +< + +============================================================================== +6. Transparent Remote File Editing *netrw-transparent* {{{1 + +Transparent file transfers occur whenever a regular file read or write +(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd| +events) is made. Thus one may read, write, or source files across networks +just as easily as if they were local files! > + + vim ftp://[user@]machine/path + ... + :wq + +See |netrw-activate| for more on how to encourage your vim to use plugins +such as netrw. + +For password-free use of scp:, see |netrw-ssh-hack|. + + +============================================================================== +7. Ex Commands *netrw-ex* {{{1 + +The usual read/write commands are supported. There are also a few +additional commands available. Often you won't need to use Nwrite or +Nread as shown in |netrw-transparent| (ie. simply use > + :e URL + :r URL + :w URL +instead, as appropriate) -- see |netrw-urls|. In the explanations +below, a {netfile} is a URL to a remote file. + + *:Nwrite* *:Nw* +:[range]Nw[rite] Write the specified lines to the current + file as specified in b:netrw_lastfile. + (related: |netrw-nwrite|) + +:[range]Nw[rite] {netfile} [{netfile}]... + Write the specified lines to the {netfile}. + + *:Nread* *:Nr* +:Nr[ead] Read the lines from the file specified in b:netrw_lastfile + into the current buffer. (related: |netrw-nread|) + +:Nr[ead] {netfile} {netfile}... + Read the {netfile} after the current line. + + *:Nsource* *:Ns* +:Ns[ource] {netfile} + Source the {netfile}. + To start up vim using a remote .vimrc, one may use + the following (all on one line) (tnx to Antoine Mechelynck) > + vim -u NORC -N + --cmd "runtime plugin/netrwPlugin.vim" + --cmd "source scp://HOSTNAME/.vimrc" +< (related: |netrw-source|) + +:call NetUserPass() *NetUserPass()* + If g:netrw_uid and s:netrw_passwd don't exist, + this function will query the user for them. + (related: |netrw-userpass|) + +:call NetUserPass("userid") + This call will set the g:netrw_uid and, if + the password doesn't exist, will query the user for it. + (related: |netrw-userpass|) + +:call NetUserPass("userid","passwd") + This call will set both the g:netrw_uid and s:netrw_passwd. + The user-id and password are used by ftp transfers. One may + effectively remove the user-id and password by using empty + strings (ie. ""). + (related: |netrw-userpass|) + +:NetrwSettings This command is described in |netrw-settings| -- used to + display netrw settings and change netrw behavior. + + +============================================================================== +8. Variables and Options *netrw-var* *netrw-settings* {{{1 + +(also see: |netrw-options| |netrw-variables| |netrw-protocol| + |netrw-browser-settings| |netrw-browser-options| ) + +The script provides several variables which act as options to +affect 's file transfer behavior. These variables typically may be +set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|) + *netrw-options* +> + ------------- + Netrw Options + ------------- + Option Meaning + -------------- ----------------------------------------------- +< + b:netrw_col Holds current cursor position (during NetWrite) + g:netrw_cygwin =1 assume scp under windows is from cygwin + (default/windows) + =0 assume scp under windows accepts windows + style paths (default/else) + g:netrw_ftp =0 use default ftp (uid password) + g:netrw_ftpmode ="binary" (default) + ="ascii" (your choice) + g:netrw_ignorenetrc =1 (default) + if you have a <.netrc> file but you don't + want it used, then set this variable. Its + mere existence is enough to cause <.netrc> + to be ignored. + b:netrw_lastfile Holds latest method/machine/path. + b:netrw_line Holds current line number (during NetWrite) + g:netrw_silent =0 transfers done normally + =1 transfers done silently + g:netrw_uid Holds current user-id for ftp. + g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default) + =1 use WinNT/2K/XP's rcp, binary mode + ----------------------------------------------------------------------- +< + *netrw-internal-variables* +The script will also make use of the following variables internally, albeit +temporarily. +> + ------------------- + Temporary Variables + ------------------- + Variable Meaning + -------- ------------------------------------ +< + b:netrw_method Index indicating rcp/ftp+.netrc/ftp + w:netrw_method (same as b:netrw_method) + g:netrw_machine Holds machine name parsed from input + b:netrw_fname Holds filename being accessed > + ------------------------------------------------------------ +< + *netrw-protocol* + +Netrw supports a number of protocols. These protocols are invoked using the +variables listed below, and may be modified by the user. +> + ------------------------ + Protocol Control Options + ------------------------ + Option Type Setting Meaning + --------- -------- -------------- --------------------------- +< netrw_ftp variable =doesn't exist userid set by "user userid" + =0 userid set by "user userid" + =1 userid set by "userid" + NetReadFixup function =doesn't exist no change + =exists Allows user to have files + read via ftp automatically + transformed however they wish + by NetReadFixup() + g:netrw_dav_cmd var ="cadaver" if cadaver is executable + g:netrw_dav_cmd var ="curl -o" elseif curl is executable + g:netrw_fetch_cmd var ="fetch -o" if fetch is available + g:netrw_ftp_cmd var ="ftp" + g:netrw_http_cmd var ="fetch -o" if fetch is available + g:netrw_http_cmd var ="wget -O" else if wget is available + g:netrw_http_put_cmd var ="curl -T" + |g:netrw_list_cmd| var ="ssh USEPORT HOSTNAME ls -Fa" + g:netrw_rcp_cmd var ="rcp" + g:netrw_rsync_cmd var ="rsync" + *g:netrw_rsync_sep* var ="/" used to separate the hostname + from the file spec + g:netrw_scp_cmd var ="scp -q" + g:netrw_sftp_cmd var ="sftp" > + ------------------------------------------------------------------------- +< + *netrw-ftp* + +The g:netrw_..._cmd options (|g:netrw_ftp_cmd| and |g:netrw_sftp_cmd|) +specify the external program to use handle the ftp protocol. They may +include command line options (such as -p for passive mode). Example: > + + let g:netrw_ftp_cmd= "ftp -p" +< +Browsing is supported by using the |g:netrw_list_cmd|; the substring +"HOSTNAME" will be changed via substitution with whatever the current request +is for a hostname. + +Two options (|g:netrw_ftp| and |netrw-fixup|) both help with certain ftp's +that give trouble . In order to best understand how to use these options if +ftp is giving you troubles, a bit of discussion is provided on how netrw does +ftp reads. + +For ftp, netrw typically builds up lines of one of the following formats in a +temporary file: +> + IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 + ---------------------------------- ------------------------------ +< + open machine [port] open machine [port] + user userid password userid password + [g:netrw_ftpmode] password + [g:netrw_ftpextracmd] [g:netrw_ftpmode] + get filename tempfile [g:netrw_extracmd] + get filename tempfile > + --------------------------------------------------------------------- +< +The |g:netrw_ftpmode| and |g:netrw_ftpextracmd| are optional. + +Netrw then executes the lines above by use of a filter: +> + :%! {g:netrw_ftp_cmd} -i [-n] +< +where + g:netrw_ftp_cmd is usually "ftp", + -i tells ftp not to be interactive + -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>) + +If <.netrc> exists it will be used to avoid having to query the user for +userid and password. The transferred file is put into a temporary file. +The temporary file is then read into the main editing session window that +requested it and the temporary file deleted. + +If your ftp doesn't accept the "user" command and immediately just demands a +userid, then try putting "let netrw_ftp=1" in your <.vimrc>. + + *netrw-cadaver* +To handle the SSL certificate dialog for untrusted servers, one may pull +down the certificate and place it into /usr/ssl/cert.pem. This operation +renders the server treatment as "trusted". + + *netrw-fixup* *netreadfixup* +If your ftp for whatever reason generates unwanted lines (such as AUTH +messages) you may write a NetReadFixup() function: +> + function! NetReadFixup(method,line1,line2) + " a:line1: first new line in current file + " a:line2: last new line in current file + if a:method == 1 "rcp + elseif a:method == 2 "ftp + <.netrc> + elseif a:method == 3 "ftp + machine,uid,password,filename + elseif a:method == 4 "scp + elseif a:method == 5 "http/wget + elseif a:method == 6 "dav/cadaver + elseif a:method == 7 "rsync + elseif a:method == 8 "fetch + elseif a:method == 9 "sftp + else " complain + endif + endfunction +> +The NetReadFixup() function will be called if it exists and thus allows you to +customize your reading process. + +(Related topics: |ftp| |netrw-userpass| |netrw-start|) + +============================================================================== +9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1 + *netrw-browser* *netrw-dir* *netrw-list* + +INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2 + (Quick References: |netrw-quickmaps| |netrw-quickcoms|) + +Netrw supports the browsing of directories on your local system and on remote +hosts; browsing includes listing files and directories, entering directories, +editing files therein, deleting files/directories, making new directories, +moving (renaming) files and directories, copying files and directories, etc. +One may mark files and execute any system command on them! The Netrw browser +generally implements the previous explorer's maps and commands for remote +directories, although details (such as pertinent global variable names) +necessarily differ. To browse a directory, simply "edit" it! > + + vim /your/directory/ + vim . + vim c:\your\directory\ +< +(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t| + |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| ) + +The Netrw remote file and directory browser handles two protocols: ssh and +ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp +in its remote browsing. Specifying any other protocol will cause it to be +used for file transfers; but the ssh protocol will be used to do remote +browsing. + +To use Netrw's remote directory browser, simply attempt to read a "file" with +a trailing slash and it will be interpreted as a request to list a directory: +> + vim [protocol]://[user@]hostname/path/ +< +where [protocol] is typically scp or ftp. As an example, try: > + + vim ftp://ftp.home.vim.org/pub/vim/ +< +For local directories, the trailing slash is not required. Again, because it's +easy to miss: to browse remote directories, the URL must terminate with a +slash! + +If you'd like to avoid entering the password repeatedly for remote directory +listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with +ftp, see |netrw-netrc| (if your ftp supports it). + +There are several things you can do to affect the browser's display of files: + + * To change the listing style, press the "i" key (|netrw-i|). + Currently there are four styles: thin, long, wide, and tree. + To make that change "permanent", see |g:netrw_liststyle|. + + * To hide files (don't want to see those xyz~ files anymore?) see + |netrw-ctrl-h|. + + * Press s to sort files by name, time, or size. + +See |netrw-browse-cmds| for all the things you can do with netrw! + + *netrw-getftype* *netrw-filigree* *netrw-ftype* +The |getftype()| function is used to append a bit of filigree to indicate +filetype to locally listed files: + + directory : / + executable : * + fifo : | + links : @ + sockets : = + +The filigree also affects the |g:netrw_sort_sequence|. + + +QUICK HELP *netrw-quickhelp* {{{2 + (Use ctrl-] to select a topic)~ + Intro to Browsing...............................|netrw-intro-browse| + Quick Reference: Maps.........................|netrw-quickmap| + Quick Reference: Commands.....................|netrw-browse-cmds| + Hiding + Edit hiding list..............................|netrw-ctrl-h| + Hiding Files or Directories...................|netrw-a| + Hiding/Unhiding by suffix.....................|netrw-mh| + Hiding dot-files.............................|netrw-gh| + Listing Style + Select listing style (thin/long/wide/tree)....|netrw-i| + Associated setting variable...................|g:netrw_liststyle| + Shell command used to perform listing.........|g:netrw_list_cmd| + Quick file info...............................|netrw-qf| + Sorted by + Select sorting style (name/time/size).........|netrw-s| + Editing the sorting sequence..................|netrw-S| + Sorting options...............................|g:netrw_sort_options| + Associated setting variable...................|g:netrw_sort_sequence| + Reverse sorting order.........................|netrw-r| + + + *netrw-quickmap* *netrw-quickmaps* +QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2 +> + --- ----------------- ---- + Map Quick Explanation Link + --- ----------------- ---- +< Causes Netrw to issue help + Netrw will enter the directory or read the file |netrw-cr| + Netrw will attempt to remove the file/directory |netrw-del| + Edit file hiding list |netrw-ctrl-h| + Causes Netrw to refresh the directory listing |netrw-ctrl-l| + Browse using a gvim server |netrw-ctrl-r| + Shrink/expand a netrw/explore window |netrw-c-tab| + - Makes Netrw go up one directory |netrw--| + a Cycles between normal display, |netrw-a| + hiding (suppress display of files matching g:netrw_list_hide) + and showing (display only files which match g:netrw_list_hide) + cd Make browsing directory the current directory |netrw-cd| + C Setting the editing window |netrw-C| + d Make a directory |netrw-d| + D Attempt to remove the file(s)/directory(ies) |netrw-D| + gb Go to previous bookmarked directory |netrw-gb| + gd Force treatment as directory |netrw-gd| + gf Force treatment as file |netrw-gf| + gh Quick hide/unhide of dot-files |netrw-gh| + gn Make top of tree the directory below the cursor |netrw-gn| + gp Change local-only file permissions |netrw-gp| + i Cycle between thin, long, wide, and tree listings |netrw-i| + I Toggle the displaying of the banner |netrw-I| + mb Bookmark current directory |netrw-mb| + mc Copy marked files to marked-file target directory |netrw-mc| + md Apply diff to marked files (up to 3) |netrw-md| + me Place marked files on arg list and edit them |netrw-me| + mf Mark a file |netrw-mf| + mF Unmark files |netrw-mF| + mg Apply vimgrep to marked files |netrw-mg| + mh Toggle marked file suffices' presence on hiding list |netrw-mh| + mm Move marked files to marked-file target directory |netrw-mm| + mp Print marked files |netrw-mp| + mr Mark files using a shell-style |regexp| |netrw-mr| + mt Current browsing directory becomes markfile target |netrw-mt| + mT Apply ctags to marked files |netrw-mT| + mu Unmark all marked files |netrw-mu| + mv Apply arbitrary vim command to marked files |netrw-mv| + mx Apply arbitrary shell command to marked files |netrw-mx| + mX Apply arbitrary shell command to marked files en bloc|netrw-mX| + mz Compress/decompress marked files |netrw-mz| + o Enter the file/directory under the cursor in a new |netrw-o| + browser window. A horizontal split is used. + O Obtain a file specified by cursor |netrw-O| + p Preview the file |netrw-p| + P Browse in the previously used window |netrw-P| + qb List bookmarked directories and history |netrw-qb| + qf Display information on file |netrw-qf| + qF Mark files using a quickfix list |netrw-qF| + qL Mark files using a |location-list| |netrw-qL| + r Reverse sorting order |netrw-r| + R Rename the designated file(s)/directory(ies) |netrw-R| + s Select sorting style: by name, time, or file size |netrw-s| + S Specify suffix priority for name-sorting |netrw-S| + t Enter the file/directory under the cursor in a new tab|netrw-t| + u Change to recently-visited directory |netrw-u| + U Change to subsequently-visited directory |netrw-U| + v Enter the file/directory under the cursor in a new |netrw-v| + browser window. A vertical split is used. + x View file with an associated program |netrw-x| + X Execute filename under cursor via |system()| |netrw-X| + + % Open a new file in netrw's current directory |netrw-%| + + *netrw-mouse* *netrw-leftmouse* *netrw-middlemouse* *netrw-rightmouse* + (gvim only) selects word under mouse as if a + had been pressed (ie. edit file, change directory) + (gvim only) same as P selecting word under mouse; + see |netrw-P| + (gvim only) delete file/directory using word under + mouse + <2-leftmouse> (gvim only) when: + * in a netrw-selected file, AND + * |g:netrw_retmap| == 1 AND + * the user doesn't already have a <2-leftmouse> + mapping defined before netrw is autoloaded, + then a double clicked leftmouse button will return + to the netrw browser window. See |g:netrw_retmap|. + (gvim only) like mf, will mark files. Dragging + the shifted leftmouse will mark multiple files. + (see |netrw-mf|) + + (to disable mouse buttons while browsing: |g:netrw_mousemaps|) + + *netrw-quickcom* *netrw-quickcoms* +QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2 + :NetrwClean[!]............................................|netrw-clean| + :NetrwSettings............................................|netrw-settings| + :Ntree....................................................|netrw-ntree| + :Explore[!] [dir] Explore directory of current file......|netrw-explore| + :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore| + :Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore| + :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + :Rexplore Return to Explorer.....................|netrw-explore| + :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore| + :Texplore[!] [dir] Tab & Explore..........................|netrw-explore| + :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore| + + +BANNER DISPLAY *netrw-I* + +One may toggle the displaying of the banner by pressing "I". + +Also See: |g:netrw_banner| + + +BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2 + +One may easily "bookmark" the currently browsed directory by using > + + mb +< + *.netrwbook* +Bookmarks are retained in between sessions of vim in a file called .netrwbook +as a |List|, which is typically stored in the first directory on the user's +'runtimepath'; entries are kept in sorted order. + +If there are marked files and/or directories, mb will add them to the bookmark +list. + + *netrw-:NetrwMB* +Additionally, one may use :NetrwMB to bookmark files or directories. > + + :NetrwMB[!] [files/directories] + +< No bang: enters files/directories into Netrw's bookmark system + + No argument and in netrw buffer: + if there are marked files : bookmark marked files + otherwise : bookmark file/directory under cursor + No argument and not in netrw buffer: bookmarks current open file + Has arguments : |glob()|s each arg and bookmarks them + + With bang: deletes files/directories from Netrw's bookmark system + +The :NetrwMB command is available outside of netrw buffers (once netrw has been +invoked in the session). + +The file ".netrwbook" holds bookmarks when netrw (and vim) is not active. By +default, its stored on the first directory on the user's |'runtimepath'|. + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mB| how to delete bookmarks + |netrw-qb| how to list bookmarks + |g:netrw_home| controls where .netrwbook is kept + + +BROWSING *netrw-enter* *netrw-cr* {{{2 + +Browsing is simple: move the cursor onto a file or directory of interest. +Hitting the (the return key) will select the file or directory. +Directories will themselves be listed, and files will be opened using the +protocol given in the original read request. + + CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that + two or more spaces delimit filenames and directory names for the long and + wide listing formats. Thus, if your filename or directory name has two or + more sequential spaces embedded in it, or any trailing spaces, then you'll + need to use the "thin" format to select it. + +The |g:netrw_browse_split| option, which is zero by default, may be used to +cause the opening of files to be done in a new window or tab instead of the +default. When the option is one or two, the splitting will be taken +horizontally or vertically, respectively. When the option is set to three, a + will cause the file to appear in a new tab. + + +When using the gui (gvim), one may select a file by pressing the +button. In addition, if + + * |g:netrw_retmap| == 1 AND (its default value is 0) + * in a netrw-selected file, AND + * the user doesn't already have a <2-leftmouse> mapping defined before + netrw is loaded + +then a doubly-clicked leftmouse button will return to the netrw browser +window. + +Netrw attempts to speed up browsing, especially for remote browsing where one +may have to enter passwords, by keeping and re-using previously obtained +directory listing buffers. The |g:netrw_fastbrowse| variable is used to +control this behavior; one may have slow browsing (no buffer re-use), medium +speed browsing (re-use directory buffer listings only for remote directories), +and fast browsing (re-use directory buffer listings as often as possible). +The price for such re-use is that when changes are made (such as new files +are introduced into a directory), the listing may become out-of-date. One may +always refresh directory listing buffers by pressing ctrl-L (see +|netrw-ctrl-l|). + + *netrw-s-cr* +Squeezing the Current Tree-Listing Directory~ + +When the tree listing style is enabled (see |netrw-i|) and one is using +gvim, then the mapping may be used to squeeze (close) the +directory currently containing the cursor. + +Otherwise, one may remap a key combination of one's own choice to get +this effect: > + + nmap YOURKEYCOMBO NetrwTreeSqueeze +< +Put this line in $HOME/ftplugin/netrw/netrw.vim; it needs to be generated +for netrw buffers only. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_browse_split| |g:netrw_fastbrowse| + |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| + |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_browse_reject| + |g:netrw_ssh_cmd| |g:netrw_use_noswf| + + +BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2 + +Normally one enters a file or directory using the . However, the "o" map +allows one to open a new window to hold the new directory listing or file. A +horizontal split is used. (for vertical splitting, see |netrw-v|) + +Normally, the o key splits the window horizontally with the new window and +cursor at the top. + +Associated setting variables: |g:netrw_alto| |g:netrw_winsize| + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_alto| control above/below splitting + |g:netrw_winsize| control initial sizing + +BROWSING WITH A NEW TAB *netrw-t* {{{2 + +Normally one enters a file or directory using the . The "t" map +allows one to open a new window holding the new directory listing or file in +a new tab. + +If you'd like to have the new listing in a background tab, use |gT|. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_winsize| control initial sizing + +BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2 + +Normally one enters a file or directory using the . However, the "v" map +allows one to open a new window to hold the new directory listing or file. A +vertical split is used. (for horizontal splitting, see |netrw-o|) + +Normally, the v key splits the window vertically with the new window and +cursor at the left. + +There is only one tree listing buffer; using "v" on a displayed subdirectory +will split the screen, but the same buffer will be shown twice. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_altv| control right/left splitting + |g:netrw_winsize| control initial sizing + + +BROWSING USING A GVIM SERVER *netrw-ctrl-r* {{{2 + +One may keep a browsing gvim separate from the gvim being used to edit. +Use the map on a file (not a directory) in the netrw browser, and it +will use a gvim server (see |g:netrw_servername|). Subsequent use of +(see |netrw-cr|) will re-use that server for editing files. + +Related topics: + |netrw-ctrl-r| |netrw-o| |netrw-p| + |netrw-P| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_servername| : sets name of server + |g:netrw_browse_split| : controls how will open files + + +CHANGE LISTING STYLE (THIN LONG WIDE TREE) *netrw-i* {{{2 + +The "i" map cycles between the thin, long, wide, and tree listing formats. + +The thin listing format gives just the files' and directories' names. + +The long listing is either based on the "ls" command via ssh for remote +directories or displays the filename, file size (in bytes), and the time and +date of last modification for local directories. With the long listing +format, netrw is not able to recognize filenames which have trailing spaces. +Use the thin listing format for such files. + +The wide listing format uses two or more contiguous spaces to delineate +filenames; when using that format, netrw won't be able to recognize or use +filenames which have two or more contiguous spaces embedded in the name or any +trailing spaces. The thin listing format will, however, work with such files. +The wide listing format is the most compact. + +The tree listing format has a top directory followed by files and directories +preceded by one or more "|"s, which indicate the directory depth. One may +open and close directories by pressing the key while atop the directory +name. + +One may make a preferred listing style your default; see |g:netrw_liststyle|. +As an example, by putting the following line in your .vimrc, > + let g:netrw_liststyle= 3 +the tree style will become your default listing style. + +One typical way to use the netrw tree display is to: > + + vim . + (use i until a tree display shows) + navigate to a file + v (edit as desired in vertically split window) + ctrl-w h (to return to the netrw listing) + P (edit newly selected file in the previous window) + ctrl-w h (to return to the netrw listing) + P (edit newly selected file in the previous window) + ...etc... +< +Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen| + |g:netrw_timefmt| |g:netrw_list_cmd| + +CHANGE FILE PERMISSION *netrw-gp* {{{2 + +"gp" will ask you for a new permission for the file named under the cursor. +Currently, this only works for local files. + +Associated setting variables: |g:netrw_chgperm| + + +CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2 + +To change directory back to a bookmarked directory, use + + {cnt}gb + +Any count may be used to reference any of the bookmarks. +Note that |netrw-qb| shows both bookmarks and history; to go +to a location stored in the history see |netrw-u| and |netrw-U|. + +Related Topics: + |netrw-mB| how to delete bookmarks + |netrw-mb| how to make a bookmark + |netrw-qb| how to list bookmarks + + +CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2 + +Every time you change to a new directory (new for the current session), netrw +will save the directory in a recently-visited directory history list (unless +|g:netrw_dirhistmax| is zero; by default, it holds ten entries). With the "u" +map, one can change to an earlier directory (predecessor). To do the +opposite, see |netrw-U|. + +The "u" map also accepts counts to go back in the history several slots. For +your convenience, qb (see |netrw-qb|) lists the history number which may be +used in that count. + + *.netrwhist* +See |g:netrw_dirhistmax| for how to control the quantity of history stack +slots. The file ".netrwhist" holds history when netrw (and vim) is not +active. By default, its stored on the first directory on the user's +|'runtimepath'|. + +Related Topics: + |netrw-U| changing to a successor directory + |g:netrw_home| controls where .netrwhist is kept + + +CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2 + +With the "U" map, one can change to a later directory (successor). +This map is the opposite of the "u" map. (see |netrw-u|) Use the +qb map to list both the bookmarks and history. (see |netrw-qb|) + +The "U" map also accepts counts to go forward in the history several slots. + +See |g:netrw_dirhistmax| for how to control the quantity of history stack +slots. + + +CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2 + +One may specify a new tree top for tree listings using > + + :Ntree [dirname] + +Without a "dirname", the current line is used (and any leading depth +information is elided). +With a "dirname", the specified directory name is used. + +The "gn" map will take the word below the cursor and use that for +changing the top of the tree listing. + + +NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2 + +With :NetrwClean one may easily remove netrw from one's home directory; +more precisely, from the first directory on your |'runtimepath'|. + +With :NetrwClean!, netrw will attempt to remove netrw from all directories on +your |'runtimepath'|. Of course, you have to have write/delete permissions +correct to do this. + +With either form of the command, netrw will first ask for confirmation +that the removal is in fact what you want to do. If netrw doesn't have +permission to remove a file, it will issue an error message. + +CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2 + +Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are +best seen with a special handler (ie. a tool provided with your computer's +operating system). Netrw allows one to invoke such special handlers by: + + * hitting gx with the cursor atop the file path or alternatively x + in a netrw buffer; the former can be disabled by defining the + |g:netrw_nogx| variable + * when in command line, typing :Open , see |:Open| below. + +One may also use visual mode (see |visual-start|) to select the text that the +special handler will use. Normally gx checks for a close-by URL or file name +to pick up the text under the cursor; one may change what |expand()| uses via the +|g:netrw_gx| variable (options include "", ""). Note that +expand("") depends on the |'isfname'| setting. Alternatively, one may +select the text to be used by gx by making a visual selection (see +|visual-block|) and then pressing gx. + +The selection function can be adapted for each filetype by adding a function +`Netrw_get_URL_`, where is given by the 'filetype'. +The function should return the URL or file name to be used by gx, and will +fall back to the default behavior if it returns an empty string. +For example, special handlers for links Markdown and HTML are + +" make gx work on concealed links regardless of exact cursor position: > + + function Netrw_get_URL_markdown() + " markdown URL such as [link text](http://ya.ru 'yandex search') + try + let save_view = winsaveview() + if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0 + return matchstr(getline('.')[col('.')-1:], + \ '\[.\{-}\](\zs' .. g:netrw_regex_url .. '\ze\(\s\+.\{-}\)\?)') + endif + return '' + finally + call winrestview(save_view) + endtry + endfunction + + function Netrw_get_URL_html() + " HTML URL such as Python is here + " + try + let save_view = winsaveview() + if searchpair('\|/>\)\zs', 'cbW', '', line('.')) > 0 + return matchstr(getline('.')[col('.') - 1 : ], + \ 'href=["'.."'"..']\?\zs\S\{-}\ze["'.."'"..']\?/\?>') + endif + return '' + finally + call winrestview(save_view) + endtry + endfunction +< +Other than a file path, the text under the cursor may be a URL. Netrw uses +by default the following regular expression to determine if the text under the +cursor is a URL: +> + :let g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}' +< +Associated setting variables: + |g:netrw_gx| control how gx picks up the text under the cursor + |g:netrw_nogx| prevent gx map while editing + |g:netrw_suppress_gx_mesg| controls gx's suppression of browser messages + +OPENING FILES AND LAUNCHING APPS *netrw-gx* *:Open* *:Launch* {{{2 + +Netrw determines which special handler by the following method: + + * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to + view files. + If the viewer you wish to use does not support handling of a remote URL + directory, set |g:netrw_browsex_support_remote| to 0. + * otherwise: + + * for Windows : explorer.exe is used + * for Mac OS X : open is used. + * for Linux : xdg-open is used. + +To open a path (or URL) by the appropriate handler, type > + + :Open +< +No escaping, neither for the shell nor for Vim's command-line, is needed. + +To launch a specific application , often being > + + :Launch . + +Since can be arbitrarily complex, in particular contain many file +paths, the escaping is left to the user. + +If you disabled the netrw plugin by setting g:loaded_netrwPlugin (see +|netrw-noload|), then you can use > + + :call netrw#Launch(' ') + :call netrw#Open('') +< + *netrw-curdir* +DELETING BOOKMARKS *netrw-mB* {{{2 + +To delete a bookmark, use > + + {cnt}mB + +If there are marked files, then mB will remove them from the +bookmark list. + +Alternatively, one may use :NetrwMB! (see |netrw-:NetrwMB|). > + + :NetrwMB! [files/directories] + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mb| how to make a bookmark + |netrw-qb| how to list bookmarks + + +DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2 + +If files have not been marked with |netrw-mf|: (local marked file list) + + Deleting/removing files and directories involves moving the cursor to the + file/directory to be deleted and pressing "D". Directories must be empty + first before they can be successfully removed. If the directory is a + softlink to a directory, then netrw will make two requests to remove the + directory before succeeding. Netrw will ask for confirmation before doing + the removal(s). You may select a range of lines with the "V" command + (visual selection), and then pressing "D". + +If files have been marked with |netrw-mf|: (local marked file list) + + Marked files (and empty directories) will be deleted; again, you'll be + asked to confirm the deletion before it actually takes place. + +A further approach is to delete files which match a pattern. + + * use :MF pattern (see |netrw-:MF|); then press "D". + + * use mr (see |netrw-mr|) which will prompt you for pattern. + This will cause the matching files to be marked. Then, + press "D". + +Please note that only empty directories may be deleted with the "D" mapping. +Regular files are deleted with |delete()|, too. + +The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are +used to control the attempts to remove remote files and directories. The +g:netrw_rm_cmd is used with files, and its default value is: + + g:netrw_rm_cmd: ssh HOSTNAME rm + +The g:netrw_rmdir_cmd variable is used to support the removal of directories. +Its default value is: + + |g:netrw_rmdir_cmd|: ssh HOSTNAME rmdir + +If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt +to remove it again using the g:netrw_rmf_cmd variable. Its default value is: + + |g:netrw_rmf_cmd|: ssh HOSTNAME rm -f + +Related topics: |netrw-d| +Associated setting variable: |g:netrw_rm_cmd| |g:netrw_ssh_cmd| + + +*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore* +*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore* *netrw-lexplore* +DIRECTORY EXPLORATION COMMANDS {{{2 + + :[N]Explore[!] [dir]... Explore directory of current file *:Explore* + :[N]Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore* + :[N]Lexplore[!] [dir]... Left Explorer Toggle *:Lexplore* + :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore* + :[N]Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore* + :Texplore [dir]... Tab & Explore *:Texplore* + :Rexplore ... Return to/from Explorer *:Rexplore* + + Used with :Explore **/pattern : (also see |netrw-starstar|) + :Nexplore............. go to next matching file *:Nexplore* + :Pexplore............. go to previous matching file *:Pexplore* + + *netrw-:Explore* +:Explore will open the local-directory browser on the current file's + directory (or on directory [dir] if specified). The window will be + split only if the file has been modified and |'hidden'| is not set, + otherwise the browsing window will take over that window. Normally + the splitting is taken horizontally. + Also see: |netrw-:Rexplore| +:Explore! is like :Explore, but will use vertical splitting. + + *netrw-:Hexplore* +:Hexplore [dir] does an :Explore with |:belowright| horizontal splitting. +:Hexplore! [dir] does an :Explore with |:aboveleft| horizontal splitting. + + *netrw-:Lexplore* +:[N]Lexplore [dir] toggles a full height Explorer window on the left hand side + of the current tab. It will open a netrw window on the current + directory if [dir] is omitted; a :Lexplore [dir] will show the + specified directory in the left-hand side browser display no matter + from which window the command is issued. + + By default, :Lexplore will change an uninitialized |g:netrw_chgwin| + to 2; edits will thus preferentially be made in window#2. + + The [N] specifies a |g:netrw_winsize| just for the new :Lexplore + window. That means that + if [N] < 0 : use |N| columns for the Lexplore window + if [N] = 0 : a normal split is made + if [N] > 0 : use N% of the current window will be used for the + new window + + Those who like this method often also like tree style displays; + see |g:netrw_liststyle|. + +:[N]Lexplore! [dir] is similar to :Lexplore, except that the full-height + Explorer window will open on the right hand side and an + uninitialized |g:netrw_chgwin| will be set to 1 (eg. edits will + preferentially occur in the leftmost window). + + Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw| + |netrw-p| |netrw-P| |g:netrw_chgwin| + |netrw-c-tab| |g:netrw_winsize| + + *netrw-:Sexplore* +:[N]Sexplore will always split the window before invoking the local-directory + browser. As with Explore, the splitting is normally done + horizontally. +:[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically. + + *netrw-:Texplore* +:Texplore [dir] does a |:tabnew| before generating the browser window + + *netrw-:Vexplore* +:[N]Vexplore [dir] does an :Explore with |:leftabove| vertical splitting. +:[N]Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting. + +The optional parameters are: + + [N]: This parameter will override |g:netrw_winsize| to specify the quantity of + rows and/or columns the new explorer window should have. + Otherwise, the |g:netrw_winsize| variable, if it has been specified by the + user, is used to control the quantity of rows and/or columns new + explorer windows should have. + + [dir]: By default, these explorer commands use the current file's directory. + However, one may explicitly provide a directory (path) to use instead; + ie. > + + :Explore /some/path +< + *netrw-:Rexplore* +:Rexplore This command is a little different from the other Explore commands + as it doesn't necessarily open an Explorer window. + + Return to Explorer~ + When one edits a file using netrw which can occur, for example, + when pressing while the cursor is atop a filename in a netrw + browser window, a :Rexplore issued while editing that file will + return the display to that of the last netrw browser display in + that window. + + Return from Explorer~ + Conversely, when one is editing a directory, issuing a :Rexplore + will return to editing the file that was last edited in that + window. + + The <2-leftmouse> map (which is only available under gvim and + cooperative terms) does the same as :Rexplore. + +Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize| + + +*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* *netrw-grep* +EXPLORING WITH STARS AND PATTERNS {{{2 + +When Explore, Sexplore, Hexplore, or Vexplore are used with one of the +following four patterns Explore generates a list of files which satisfy the +request for the local file system. These exploration patterns will not work +with remote file browsing. + + */filepat files in current directory which satisfy filepat + **/filepat files in current directory or below which satisfy the + file pattern + *//pattern files in the current directory which contain the + pattern (vimgrep is used) + **//pattern files in the current directory or below which contain + the pattern (vimgrep is used) +< +The cursor will be placed on the first file in the list. One may then +continue to go to subsequent files on that list via |:Nexplore| or to +preceding files on that list with |:Pexplore|. Explore will update the +directory and place the cursor appropriately. + +A plain > + :Explore +will clear the explore list. + +If your console or gui produces recognizable shift-up or shift-down sequences, +then you'll likely find using shift-downarrow and shift-uparrow convenient. +They're mapped by netrw as follows: + + == Nexplore, and + == Pexplore. + +As an example, consider +> + :Explore */*.c + :Nexplore + :Nexplore + :Pexplore +< +The status line will show, on the right hand side of the status line, a +message like "Match 3 of 20". + +Associated setting variables: + |g:netrw_keepdir| |g:netrw_browse_split| + |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject| + |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd| + |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd| + |g:netrw_liststyle| + + +DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2 + +With the cursor atop a filename, pressing "qf" will reveal the file's size +and last modification timestamp. Currently this capability is only available +for local files. + + +EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2 + +The "" map brings up a requestor allowing the user to change the +file/directory hiding list contained in |g:netrw_list_hide|. The hiding list +consists of one or more patterns delimited by commas. Files and/or +directories satisfying these patterns will either be hidden (ie. not shown) or +be the only ones displayed (see |netrw-a|). + +The "gh" mapping (see |netrw-gh|) quickly alternates between the usual +hiding list and the hiding of files or directories that begin with ".". + +As an example, > + let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' +Effectively, this makes the effect of a |netrw-gh| command the initial setting. +What it means: + + \(^\|\s\s\) : if the line begins with the following, -or- + two consecutive spaces are encountered + \zs : start the hiding match now + \. : if it now begins with a dot + \S\+ : and is followed by one or more non-whitespace + characters + +Associated setting variables: |g:netrw_hide| |g:netrw_list_hide| +Associated topics: |netrw-a| |netrw-gh| |netrw-mh| + + *netrw-sort-sequence* +EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2 + +When "Sorted by" is name, one may specify priority via the sorting sequence +(g:netrw_sort_sequence). The sorting sequence typically prioritizes the +name-listing by suffix, although any pattern will do. Patterns are delimited +by commas. The default sorting sequence is (all one line): + +For Unix: > + '[\/]$,\ + '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$, + \.swp$,\.bak$,\~$' +< +The lone * is where all filenames not covered by one of the other patterns +will end up. One may change the sorting sequence by modifying the +g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by +using the "S" map. + +Related topics: |netrw-s| |netrw-S| +Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options| + + +EXECUTING FILE UNDER CURSOR VIA SYSTEM() *netrw-X* {{{2 + +Pressing X while the cursor is atop an executable file will yield a prompt +using the filename asking for any arguments. Upon pressing a [return], netrw +will then call |system()| with that command and arguments. The result will be +displayed by |:echomsg|, and so |:messages| will repeat display of the result. +Ansi escape sequences will be stripped out. + +See |cmdline-window| for directions for more on how to edit the arguments. + + +FORCING TREATMENT AS A FILE OR DIRECTORY *netrw-gd* *netrw-gf* {{{2 + +Remote symbolic links (ie. those listed via ssh or ftp) are problematic +in that it is difficult to tell whether they link to a file or to a +directory. + +To force treatment as a file: use > + gf +< +To force treatment as a directory: use > + gd +< + +GOING UP *netrw--* {{{2 + +To go up a directory, press "-" or press the when atop the ../ directory +entry in the listing. + +Netrw will use the command in |g:netrw_list_cmd| to perform the directory +listing operation after changing HOSTNAME to the host specified by the +user-prpvided url. By default netrw provides the command as: > + + ssh HOSTNAME ls -FLa +< +where the HOSTNAME becomes the [user@]hostname as requested by the attempt to +read. Naturally, the user may override this command with whatever is +preferred. The NetList function which implements remote browsing +expects that directories will be flagged by a trailing slash. + + +HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2 + +Netrw's browsing facility allows one to use the hiding list in one of three +ways: ignore it, hide files which match, and show only those files which +match. + +If no files have been marked via |netrw-mf|: + +The "a" map allows the user to cycle through the three hiding modes. + +The |g:netrw_list_hide| variable holds a comma delimited list of patterns +based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list. +(also see |netrw-ctrl-h|) To set the hiding list, use the map. As an +example, to hide files which begin with a ".", one may use the map to +set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*' +in one's <.vimrc>). One may then use the "a" key to show all files, hide +matching files, or to show only the matching files. + + Example: \.[ch]$ + This hiding list command will hide/show all *.c and *.h files. + + Example: \.c$,\.h$ + This hiding list command will also hide/show all *.c and *.h + files. + +Don't forget to use the "a" map to select the mode (normal/hiding/show) you +want! + +If files have been marked using |netrw-mf|, then this command will: + + if showing all files or non-hidden files: + modify the g:netrw_list_hide list by appending the marked files to it + and showing only non-hidden files. + + else if showing hidden files only: + modify the g:netrw_list_hide list by removing the marked files from it + and showing only non-hidden files. + endif + + *netrw-gh* *netrw-hide* +As a quick shortcut, one may press > + gh +to toggle between hiding files which begin with a period (dot) and not hiding +them. + +Associated setting variables: |g:netrw_list_hide| |g:netrw_hide| +Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh| + + *netrw-gitignore* +Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with +|g:netrw_list_hide| automatically hides all git-ignored files. + +'netrw_gitignore#Hide' searches for patterns in the following files: > + + './.gitignore' + './.git/info/exclude' + global gitignore file: `git config --global core.excludesfile` + system gitignore file: `git config --system core.excludesfile` +< +Files that do not exist, are ignored. +Git-ignore patterns are taken from existing files, and converted to patterns for +hiding files. For example, if you had '*.log' in your '.gitignore' file, it +would be converted to '.*\.log'. + +To use this function, simply assign its output to |g:netrw_list_hide| option. > + + Example: let g:netrw_list_hide= netrw_gitignore#Hide() + Git-ignored files are hidden in Netrw. + + Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file') + Function can take additional files with git-ignore patterns. + + Example: let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' + Combining 'netrw_gitignore#Hide' with custom patterns. +< + +IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2 + +Especially with the remote directory browser, constantly entering the password +is tedious. + +For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength +tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip +for setting up no-password ssh and scp and discusses associated security +issues. It used to be available at http://hacks.oreilly.com/pub/h/66 , +but apparently that address is now being redirected to some "hackzine". +I'll attempt a summary based on that article and on a communication from +Ben Schmidt: + + 1. Generate a public/private key pair on the local machine + (ssh client): > + ssh-keygen -t rsa + (saving the file in ~/.ssh/id_rsa as prompted) +< + 2. Just hit the when asked for passphrase (twice) for no + passphrase. If you do use a passphrase, you will also need to use + ssh-agent so you only have to type the passphrase once per session. + If you don't use a passphrase, simply logging onto your local + computer or getting access to the keyfile in any way will suffice + to access any ssh servers which have that key authorized for login. + + 3. This creates two files: > + ~/.ssh/id_rsa + ~/.ssh/id_rsa.pub +< + 4. On the target machine (ssh server): > + cd + mkdir -p .ssh + chmod 0700 .ssh +< + 5. On your local machine (ssh client): (one line) > + ssh {serverhostname} + cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub +< + or, for OpenSSH, (one line) > + ssh {serverhostname} + cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub +< +You can test it out with > + ssh {serverhostname} +and you should be log onto the server machine without further need to type +anything. + +If you decided to use a passphrase, do: > + ssh-agent $SHELL + ssh-add + ssh {serverhostname} +You will be prompted for your key passphrase when you use ssh-add, but not +subsequently when you use ssh. For use with vim, you can use > + ssh-agent vim +and, when next within vim, use > + :!ssh-add +Alternatively, you can apply ssh-agent to the terminal you're planning on +running vim in: > + ssh-agent xterm & +and do ssh-add whenever you need. + +For Windows, folks on the vim mailing list have mentioned that Pageant helps +with avoiding the constant need to enter the password. + +Kingston Fung wrote about another way to avoid constantly needing to enter +passwords: + + In order to avoid the need to type in the password for scp each time, you + provide a hack in the docs to set up a non password ssh account. I found a + better way to do that: I can use a regular ssh account which uses a + password to access the material without the need to key-in the password + each time. It's good for security and convenience. I tried ssh public key + authorization + ssh-agent, implementing this, and it works! + + + Ssh hints: + + Thomer Gil has provided a hint on how to speed up netrw+ssh: + http://thomer.com/howtos/netrw_ssh.html + + Alex Young has several hints on speeding ssh up: + http://usevim.com/2012/03/16/editing-remote-files/ + + +LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2 + +Pressing "qb" (query bookmarks) will list both the bookmarked directories and +directory traversal history. + +Related Topics: + |netrw-gb| how to return (go) to a bookmark + |netrw-mb| how to make a bookmark + |netrw-mB| how to delete bookmarks + |netrw-u| change to a predecessor directory via the history stack + |netrw-U| change to a successor directory via the history stack + +MAKING A NEW DIRECTORY *netrw-d* {{{2 + +With the "d" map one may make a new directory either remotely (which depends +on the global variable g:netrw_mkdir_cmd) or locally (which depends on the +global variable g:netrw_localmkdir). Netrw will issue a request for the new +directory's name. A bare at that point will abort the making of the +directory. Attempts to make a local directory that already exists (as either +a file or a directory) will be detected, reported on, and ignored. + +Related topics: |netrw-D| +Associated setting variables: |g:netrw_localmkdir| |g:netrw_mkdir_cmd| + |g:netrw_remote_mkdir| |netrw-%| + + +MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-cd* {{{2 + +By default, |g:netrw_keepdir| is 1. This setting means that the current +directory will not track the browsing directory. (done for backwards +compatibility with v6's file explorer). + +Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory +track netrw's browsing directory. + +However, given the default setting for g:netrw_keepdir of 1 where netrw +maintains its own separate notion of the current directory, in order to make +the two directories the same, use the "cd" map (type cd). That map will +set Vim's notion of the current directory to netrw's current browsing +directory. + +|netrw-cd| : This map's name was changed from "c" to cd (see |netrw-cd|). + This change was done to allow for |netrw-cb| and |netrw-cB| maps. + +Associated setting variable: |g:netrw_keepdir| + +MARKING FILES *netrw-:MF* *netrw-mf* {{{2 + (also see |netrw-mr|) + +Netrw provides several ways to mark files: + + * One may mark files with the cursor atop a filename and + then pressing "mf". + + * With gvim, in addition one may mark files with + . (see |netrw-mouse|) + + * One may use the :MF command, which takes a list of + files (for local directories, the list may include + wildcards -- see |glob()|) > + + :MF *.c +< + (Note that :MF uses || to break the line + at spaces) + + * Mark files using the |argument-list| (|netrw-mA|) + + * Mark files based upon a |location-list| (|netrw-qL|) + + * Mark files based upon the quickfix list (|netrw-qF|) + (|quickfix-error-lists|) + +The following netrw maps make use of marked files: + + |netrw-a| Hide marked files/directories + |netrw-D| Delete marked files/directories + |netrw-ma| Move marked files' names to |arglist| + |netrw-mA| Move |arglist| filenames to marked file list + |netrw-mb| Append marked files to bookmarks + |netrw-mB| Delete marked files from bookmarks + |netrw-mc| Copy marked files to target + |netrw-md| Apply vimdiff to marked files + |netrw-me| Edit marked files + |netrw-mF| Unmark marked files + |netrw-mg| Apply vimgrep to marked files + |netrw-mm| Move marked files to target + |netrw-mp| Print marked files + |netrw-ms| Netrw will source marked files + |netrw-mt| Set target for |netrw-mm| and |netrw-mc| + |netrw-mT| Generate tags using marked files + |netrw-mv| Apply vim command to marked files + |netrw-mx| Apply shell command to marked files + |netrw-mX| Apply shell command to marked files, en bloc + |netrw-mz| Compress/Decompress marked files + |netrw-O| Obtain marked files + |netrw-R| Rename marked files + +One may unmark files one at a time the same way one marks them; ie. place +the cursor atop a marked file and press "mf". This process also works +with using gvim. One may unmark all files by pressing +"mu" (see |netrw-mu|). + +Marked files are highlighted using the "netrwMarkFile" highlighting group, +which by default is linked to "Identifier" (see Identifier under +|group-name|). You may change the highlighting group by putting something +like > + + highlight clear netrwMarkFile + hi link netrwMarkFile ..whatever.. +< +into $HOME/.vim/after/syntax/netrw.vim . + +If the mouse is enabled and works with your vim, you may use to +mark one or more files. You may mark multiple files by dragging the shifted +leftmouse. (see |netrw-mouse|) + + *markfilelist* *global_markfilelist* *local_markfilelist* +All marked files are entered onto the global marked file list; there is only +one such list. In addition, every netrw buffer also has its own buffer-local +marked file list; since netrw buffers are associated with specific +directories, this means that each directory has its own local marked file +list. The various commands which operate on marked files use one or the other +of the marked file lists. + +Known Problem: if one is using tree mode (|g:netrw_liststyle|) and several +directories have files with the same name, then marking such a file will +result in all such files being highlighted as if they were all marked. The +|markfilelist|, however, will only have the selected file in it. This problem +is unlikely to be fixed. + + +UNMARKING FILES *netrw-mF* {{{2 + (also see |netrw-mf|, |netrw-mu|) + +The "mF" command will unmark all files in the current buffer. One may also use +mf (|netrw-mf|) on a specific, already marked, file to unmark just that file. + +MARKING FILES BY LOCATION LIST *netrw-qL* {{{2 + (also see |netrw-mf|) + +One may convert |location-list|s into a marked file list using "qL". +You may then proceed with commands such as me (|netrw-me|) to edit them. + + +MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2 + (also see |netrw-mf|) + +One may convert |quickfix-error-lists| into a marked file list using "qF". +You may then proceed with commands such as me (|netrw-me|) to edit them. +Quickfix error lists are generated, for example, by calls to |:vimgrep|. + + +MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2 + (also see |netrw-mf|) + +One may also mark files by pressing "mr"; netrw will then issue a prompt, +"Enter regexp: ". You may then enter a shell-style regular expression such +as *.c$ (see |glob()|). For remote systems, glob() doesn't work -- so netrw +converts "*" into ".*" (see |regexp|) and marks files based on that. In the +future I may make it possible to use |regexp|s instead of glob()-style +expressions (yet-another-option). + +See |cmdline-window| for directions on more on how to edit the regular +expression. + + +MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked-file list) + +The "mv" map causes netrw to execute an arbitrary vim command on each file on +the local marked file list, individually: + + * 1split + * sil! keepalt e file + * run vim command + * sil! keepalt wq! + +A prompt, "Enter vim command: ", will be issued to elicit the vim command you +wish used. See |cmdline-window| for directions for more on how to edit the +command. + + +MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked-file list) + +Upon activation of the "mx" map, netrw will query the user for some (external) +command to be applied to all marked files. All "%"s in the command will be +substituted with the name of each marked file in turn. If no "%"s are in the +command, then the command will be followed by a space and a marked filename. + +Example: + (mark files) + mx + Enter command: cat + + The result is a series of shell commands: + cat 'file1' + cat 'file2' + ... + + +MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC *netrw-mX* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked-file list) + +Upon activation of the 'mX' map, netrw will query the user for some (external) +command to be applied to all marked files on the global marked file list. The +"en bloc" means that one command will be executed on all the files at once: > + + command files + +This approach is useful, for example, to select files and make a tarball: > + + (mark files) + mX + Enter command: tar cf mynewtarball.tar +< +The command that will be run with this example: + + tar cf mynewtarball.tar 'file1' 'file2' ... + + +MARKED FILES: ARGUMENT LIST *netrw-ma* *netrw-mA* + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked-file list) + +Using ma, one moves filenames from the marked file list to the argument list. +Using mA, one moves filenames from the argument list to the marked file list. + +See Also: |netrw-cb| |netrw-cB| |netrw-qF| |argument-list| |:args| + + +MARKED FILES: BUFFER LIST *netrw-cb* *netrw-cB* + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked-file list) + +Using cb, one moves filenames from the marked file list to the buffer list. +Using cB, one copies filenames from the buffer list to the marked file list. + +See Also: |netrw-ma| |netrw-mA| |netrw-qF| |buffer-list| |:buffers| + + +MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +If any marked files are compressed, then "mz" will decompress them. +If any marked files are decompressed, then "mz" will compress them +using the command specified by |g:netrw_compress|; by default, +that's "gzip". + +For decompression, netrw uses a |Dictionary| of suffices and their +associated decompressing utilities; see |g:netrw_decompress|. + +Remember that one can mark multiple files by regular expression +(see |netrw-mr|); this is particularly useful to facilitate compressing and +decompressing a large number of files. + +Associated setting variables: |g:netrw_compress| |g:netrw_decompress| + +MARKED FILES: COPYING *netrw-mc* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (Uses the global marked file list) + +Select a target directory with mt (|netrw-mt|). Then change directory, +select file(s) (see |netrw-mf|), and press "mc". The copy is done +from the current window (where one does the mf) to the target. + +If one does not have a target directory set with |netrw-mt|, then netrw +will query you for a directory to copy to. + +One may also copy directories and their contents (local only) to a target +directory. + +Associated setting variables: + |g:netrw_localcopycmd| |g:netrw_localcopycmdopt| + |g:netrw_localcopydircmd| |g:netrw_localcopydircmdopt| + |g:netrw_ssh_cmd| + +MARKED FILES: DIFF *netrw-md* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +Use |vimdiff| to visualize difference between selected files (two or +three may be selected for this). Uses the global marked file list. + +MARKED FILES: EDITING *netrw-me* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +The "me" command will place the marked files on the |arglist| and commence +editing them. One may return the to explorer window with |:Rexplore|. +(use |:n| and |:p| to edit next and previous files in the arglist) + +MARKED FILES: GREP *netrw-mg* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +The "mg" command will apply |:vimgrep| to the marked files. +The command will ask for the requested pattern; one may then enter: > + + /pattern/[g][j] + ! /pattern/[g][j] + pattern +< +With /pattern/, editing will start with the first item on the |quickfix| list +that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|, |:cclose|). The |:vimgrep| +command is in use, so without 'g' each line is added to quickfix list only +once; with 'g' every match is included. + +With /pattern/j, "mg" will winnow the current marked file list to just those +marked files also possessing the specified pattern. Thus, one may use > + + mr ...file-pattern... + mg /pattern/j +< +to have a marked file list satisfying the file-pattern but also restricted to +files containing some desired pattern. + + +MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +The "mh" command extracts the suffices of the marked files and toggles their +presence on the hiding list. Please note that marking the same suffix +this way multiple times will result in the suffix's presence being toggled +for each file (so an even quantity of marked files having the same suffix +is the same as not having bothered to select them at all). + +Related topics: |netrw-a| |g:netrw_list_hide| + +MARKED FILES: MOVING *netrw-mm* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + + WARNING: moving files is more dangerous than copying them. + A file being moved is first copied and then deleted; if the + copy operation fails and the delete succeeds, you will lose + the file. Either try things out with unimportant files + first or do the copy and then delete yourself using mc and D. + Use at your own risk! + +Select a target directory with mt (|netrw-mt|). Then change directory, +select file(s) (see |netrw-mf|), and press "mm". The move is done +from the current window (where one does the mf) to the target. + +Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd| + +MARKED FILES: PRINTING *netrw-mp* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +When "mp" is used, netrw will apply the |:hardcopy| command to marked files. +What netrw does is open each file in a one-line window, execute hardcopy, then +close the one-line window. + + +MARKED FILES: SOURCING *netrw-ms* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the local marked file list) + +With "ms", netrw will source the marked files (using vim's |:source| command) + + +MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + +Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|): + + * If the cursor is atop a file name, then the netrw window's currently + displayed directory is used for the copy/move-to target. + + * Also, if the cursor is in the banner, then the netrw window's currently + displayed directory is used for the copy/move-to target. + Unless the target already is the current directory. In which case, + typing "mf" clears the target. + + * However, if the cursor is atop a directory name, then that directory is + used for the copy/move-to target + + * One may use the :MT [directory] command to set the target *netrw-:MT* + This command uses ||, so spaces in the directory name are + permitted without escaping. + + * With mouse-enabled vim or with gvim, one may select a target by using + + +There is only one copy/move-to target at a time in a vim session; ie. the +target is a script variable (see |s:var|) and is shared between all netrw +windows (in an instance of vim). + +When using menus and gvim, netrw provides a "Targets" entry which allows one +to pick a target from the list of bookmarks and history. + +Related topics: + Marking Files......................................|netrw-mf| + Marking Files by Regular Expression................|netrw-mr| + Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| + Marked Files: Target Directory Using History.......|netrw-Th| + + +MARKED FILES: TAGGING *netrw-mT* {{{2 + (See |netrw-mf| and |netrw-mr| for how to mark files) + (uses the global marked file list) + +The "mT" mapping will apply the command in |g:netrw_ctags| (by default, it is +"ctags") to marked files. For remote browsing, in order to create a tags file +netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for +this to work on remote systems. For your local system, see |ctags| on how to +get a version. I myself use hdrtags, currently available at +http://www.drchip.org/astronaut/src/index.html , and have > + + let g:netrw_ctags= "hdrtag" +< +in my <.vimrc>. + +When a remote set of files are tagged, the resulting tags file is "obtained"; +ie. a copy is transferred to the local system's directory. The now local tags +file is then modified so that one may use it through the network. The +modification made concerns the names of the files in the tags; each filename is +preceded by the netrw-compatible URL used to obtain it. When one subsequently +uses one of the go to tag actions (|tags|), the URL will be used by netrw to +edit the desired file and go to the tag. + +Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd| + +MARKED FILES: TARGET DIRECTORY USING BOOKMARKS *netrw-Tb* {{{2 + +Sets the marked file copy/move-to target. + +The |netrw-qb| map will give you a list of bookmarks (and history). +One may choose one of the bookmarks to become your marked file +target by using [count]Tb (default count: 1). + +Related topics: + Copying files to target............................|netrw-mc| + Listing Bookmarks and History......................|netrw-qb| + Marked Files: Setting The Target Directory.........|netrw-mt| + Marked Files: Target Directory Using History.......|netrw-Th| + Marking Files......................................|netrw-mf| + Marking Files by Regular Expression................|netrw-mr| + Moving files to target.............................|netrw-mm| + + +MARKED FILES: TARGET DIRECTORY USING HISTORY *netrw-Th* {{{2 + +Sets the marked file copy/move-to target. + +The |netrw-qb| map will give you a list of history (and bookmarks). +One may choose one of the history entries to become your marked file +target by using [count]Th (default count: 0; ie. the current directory). + +Related topics: + Copying files to target............................|netrw-mc| + Listing Bookmarks and History......................|netrw-qb| + Marked Files: Setting The Target Directory.........|netrw-mt| + Marked Files: Target Directory Using Bookmarks.....|netrw-Tb| + Marking Files......................................|netrw-mf| + Marking Files by Regular Expression................|netrw-mr| + Moving files to target.............................|netrw-mm| + + +MARKED FILES: UNMARKING *netrw-mu* {{{2 + (See |netrw-mf|, |netrw-mF|) + +The "mu" mapping will unmark all currently marked files. This command differs +from "mF" as the latter only unmarks files in the current directory whereas +"mu" will unmark global and all buffer-local marked files. +(see |netrw-mF|) + + + *netrw-browser-settings* +NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2 + +(if you're interested in the netrw file transfer settings, see |netrw-options| + and |netrw-protocol|) + +The browser provides settings in the form of variables which +you may modify; by placing these settings in your <.vimrc>, you may customize +your browsing preferences. (see also: |netrw-settings|) +> + --- ----------- + Var Explanation + --- ----------- +< *g:netrw_altfile* some like |CTRL-^| to return to the last + edited file. Choose that by setting this + parameter to 1. + Others like |CTRL-^| to return to the + netrw browsing buffer. Choose that by setting + this parameter to 0. + default: =0 + + *g:netrw_alto* change from above splitting to below splitting + by setting this variable (see |netrw-o|) + default: =&sb (see |'sb'|) + + *g:netrw_altv* change from left splitting to right splitting + by setting this variable (see |netrw-v|) + default: =&spr (see |'spr'|) + + *g:netrw_banner* enable/suppress the banner + =0: suppress the banner + =1: banner is enabled (default) + + *g:netrw_bannerbackslash* if this variable exists and is not zero, the + banner will be displayed with backslashes + rather than forward slashes. + + *g:netrw_browse_split* when browsing, will open the file by: + =0: re-using the same window (default) + =1: horizontally splitting the window first + =2: vertically splitting the window first + =3: open file in new tab + =4: act like "P" (ie. open previous window) + Note that |g:netrw_preview| may be used + to get vertical splitting instead of + horizontal splitting. + =[servername,tab-number,window-number] + Given a |List| such as this, a remote server + named by the "servername" will be used for + editing. It will also use the specified tab + and window numbers to perform editing + (see |clientserver|, |netrw-ctrl-r|) + This option does not affect the production of + |:Lexplore| windows. + + Related topics: + |g:netrw_alto| |g:netrw_altv| + |netrw-C| |netrw-cr| + |netrw-ctrl-r| + + *g:netrw_browsex_viewer* specify user's preference for a viewer: > + "kfmclient exec" + "gnome-open" +< + *g:netrw_browsex_support_remote* + specify if the specified viewer supports a + remote URL. (see |netrw-handler|). + + *g:netrw_chgperm* Unix/Linux: "chmod PERM FILENAME" + Windows: "cacls FILENAME /e /p PERM" + Used to change access permission for a file. + + *g:netrw_clipboard* =1 + By default, netrw will attempt to insure that + the clipboard's values will remain unchanged. + However, some users report that they have + speed problems with this; consequently, this + option, when set to zero, lets such users + prevent netrw from saving and restoring the + clipboard (the latter is done only as needed). + That means that if the clipboard is changed + (inadvertently) by normal netrw operation that + it will not be restored to its prior state. + + *g:netrw_compress* ="gzip" + Will compress marked files with this + command + + *g:Netrw_corehandler* Allows one to specify something additional + to do when handling files via netrw's + browser's "x" command (see |netrw-x|). If + present, g:Netrw_corehandler specifies + either one or more function references + (see |Funcref|). (the capital g:Netrw... + is required its holding a function reference) + + + *g:netrw_ctags* ="ctags" + The default external program used to create + tags + + *g:netrw_cursor* = 2 (default) + This option controls the use of the + |'cursorline'| (cul) and |'cursorcolumn'| + (cuc) settings by netrw: + + Value Thin-Long-Tree Wide + =0 u-cul u-cuc u-cul u-cuc + =1 u-cul u-cuc cul u-cuc + =2 cul u-cuc cul u-cuc + =3 cul u-cuc cul cuc + =4 cul cuc cul cuc + =5 U-cul U-cuc U-cul U-cuc + =6 U-cul U-cuc cul U-cuc + =7 cul U-cuc cul U-cuc + =8 cul U-cuc cul cuc + + Where + u-cul : user's |'cursorline'| initial setting used + u-cuc : user's |'cursorcolumn'| initial setting used + U-cul : user's |'cursorline'| current setting used + U-cuc : user's |'cursorcolumn'| current setting used + cul : |'cursorline'| will be locally set + cuc : |'cursorcolumn'| will be locally set + + The "initial setting" means the values of + the |'cuc'| and |'cul'| settings in effect when + netrw last saw |g:netrw_cursor| >= 5 or when + netrw was initially run. + + *g:netrw_decompress* = { '.lz4': 'lz4 -d', + '.lzo': 'lzop -d', + '.lz': 'lzip -dk', + '.7z': '7za x', + '.001': '7za x', + '.tar.bz': 'tar -xvjf', + '.tar.bz2': 'tar -xvjf', + '.tbz': 'tar -xvjf', + '.tbz2': 'tar -xvjf', + '.tar.gz': 'tar -xvzf', + '.tgz': 'tar -xvzf', + '.tar.zst': 'tar --use-compress-program=unzstd -xvf', + '.tzst': 'tar --use-compress-program=unzstd -xvf', + '.tar': 'tar -xvf', + '.zip': 'unzip', + '.bz': 'bunzip2 -k', + '.bz2': 'bunzip2 -k', + '.gz': 'gunzip -k', + '.lzma': 'unlzma -T0 -k', + '.xz': 'unxz -T0 -k', + '.zst': 'zstd -T0 -d', + '.Z': 'uncompress -k', + '.rar': 'unrar x -ad', + '.tar.lzma': 'tar --lzma -xvf', + '.tlz': 'tar --lzma -xvf', + '.tar.xz': 'tar -xvJf', + '.txz': 'tar -xvJf'} + + A dictionary mapping suffices to + decompression programs. + + *g:netrw_dirhistmax* =10: controls maximum quantity of past + history. May be zero to suppress + history. + (related: |netrw-qb| |netrw-u| |netrw-U|) + + *g:netrw_dynamic_maxfilenamelen* =32: enables dynamic determination of + |g:netrw_maxfilenamelen|, which affects + local file long listing. + + *g:netrw_errorlvl* =0: error levels greater than or equal to + this are permitted to be displayed + 0: notes + 1: warnings + 2: errors + + *g:netrw_fastbrowse* =0: slow speed directory browsing; + never re-uses directory listings; + always obtains directory listings. + =1: medium speed directory browsing; + re-use directory listings only + when remote directory browsing. + (default value) + =2: fast directory browsing; + only obtains directory listings when the + directory hasn't been seen before + (or |netrw-ctrl-l| is used). + + Fast browsing retains old directory listing + buffers so that they don't need to be + re-acquired. This feature is especially + important for remote browsing. However, if + a file is introduced or deleted into or from + such directories, the old directory buffer + becomes out-of-date. One may always refresh + such a directory listing with |netrw-ctrl-l|. + This option gives the user the choice of + trading off accuracy (ie. up-to-date listing) + versus speed. + + *g:netrw_ffkeep* (default: doesn't exist) + If this variable exists and is zero, then + netrw will not do a save and restore for + |'fileformat'|. + + *g:netrw_fname_escape* =' ?&;%' + Used on filenames before remote reading/writing + + *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings + that can show up as "directories" and "files" + in the listing. This pattern is used to + remove such embedded messages. By default its + value is: + '^total\s\+\d\+$\| + ^Trying\s\+\d\+.*$\| + ^KERBEROS_V\d rejected\| + ^Security extensions not\| + No such file\| + : connect to address [0-9a-fA-F:]* + : No route to host$' + + *g:netrw_ftp_list_cmd* options for passing along to ftp for directory + listing. Defaults: + unix or g:netrw_cygwin set: : "ls -lF" + otherwise "dir" + + + *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory + listing, sorted by size of file. + Defaults: + unix or g:netrw_cygwin set: : "ls -slF" + otherwise "dir" + + *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory + listing, sorted by time of last modification. + Defaults: + unix or g:netrw_cygwin set: : "ls -tlF" + otherwise "dir" + + *g:netrw_glob_escape* ='[]*?`{~$' (unix) + ='[]*?`{$' (windows + These characters in directory names are + escaped before applying glob() + + *g:netrw_gx* ="" + This option controls how gx (|netrw-gx|) picks + up the text under the cursor. See |expand()| + for possibilities. + + *g:netrw_hide* Controlled by the "a" map (see |netrw-a|) + =0 : show all + =1 : show not-hidden files + =2 : show hidden files only + default: =1 + + *g:netrw_home* The home directory for where bookmarks and + history are saved (as .netrwbook and + .netrwhist). + Netrw uses |expand()|on the string. + default: the first directory on the + |'runtimepath'| + + *g:netrw_keepdir* =1 (default) keep current directory immune from + the browsing directory. + =0 keep the current directory the same as the + browsing directory. + The current browsing directory is contained in + b:netrw_curdir (also see |netrw-cd|) + + *g:netrw_keepj* ="keepj" (default) netrw attempts to keep the + |:jumps| table unaffected. + ="" netrw will not use |:keepjumps| with + exceptions only for the + saving/restoration of position. + + *g:netrw_list_cmd* command for listing remote directories + default: (if ssh is executable) + "ssh HOSTNAME ls -FLa" + + *g:netrw_list_cmd_options* If this variable exists, then its contents are + appended to the g:netrw_list_cmd. For + example, use "2>/dev/null" to get rid of banner + messages on unix systems. + + + *g:netrw_liststyle* Set the default listing style: + = 0: thin listing (one file per line) + = 1: long listing (one file per line with time + stamp information and file size) + = 2: wide listing (multiple files in columns) + = 3: tree style listing + + *g:netrw_list_hide* comma-separated pattern list for hiding files + Patterns are regular expressions (see |regexp|) + There's some special support for git-ignore + files: you may add the output from the helper + function 'netrw_gitignore#Hide() automatically + hiding all gitignored files. + For more details see |netrw-gitignore|. + + Examples: + let g:netrw_list_hide= '.*\.swp$' + let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' + default: "" + + *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + Copies marked files (|netrw-mf|) to target + directory (|netrw-mt|, |netrw-mc|) + + *g:netrw_localcopycmdopt* ='' Linux/Unix/MacOS/Cygwin + =' \c copy' Windows + Options for the |g:netrw_localcopycmd| + + *g:netrw_localcopydircmd* ="cp" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + Copies directories to target directory. + (|netrw-mc|, |netrw-mt|) + + *g:netrw_localcopydircmdopt* =" -R" Linux/Unix/MacOS/Cygwin + =" /c xcopy /e /c /h/ /i /k" Windows + Options for |g:netrw_localcopydircmd| + + *g:netrw_localmkdir* ="mkdir" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + command for making a local directory + + *g:netrw_localmkdiropt* ="" Linux/Unix/MacOS/Cygwin + =" /c mkdir" Windows + Options for |g:netrw_localmkdir| + + *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin + =expand("$COMSPEC") Windows + Moves marked files (|netrw-mf|) to target + directory (|netrw-mt|, |netrw-mm|) + + *g:netrw_localmovecmdopt* ="" Linux/Unix/MacOS/Cygwin + =" /c move" Windows + Options for |g:netrw_localmovecmd| + + *g:netrw_maxfilenamelen* =32 by default, selected so as to make long + listings fit on 80 column displays. + If your screen is wider, and you have file + or directory names longer than 32 bytes, + you may set this option to keep listings + columnar. + + *g:netrw_mkdir_cmd* command for making a remote directory + via ssh (also see |g:netrw_remote_mkdir|) + default: "ssh USEPORT HOSTNAME mkdir" + + *g:netrw_mousemaps* =1 (default) enables mouse buttons while + browsing to: + leftmouse : open file/directory + shift-leftmouse : mark file + middlemouse : same as P + rightmouse : remove file/directory + =0: disables mouse maps + + *g:netrw_nobeval* doesn't exist (default) + If this variable exists, then balloon + evaluation will be suppressed + (see |'ballooneval'|) + + *g:netrw_sizestyle* not defined: actual bytes (default) + ="b" : actual bytes (default) + ="h" : human-readable (ex. 5k, 4m, 3g) + uses 1000 base + ="H" : human-readable (ex. 5K, 4M, 3G) + uses 1024 base + The long listing (|netrw-i|) and query-file + maps (|netrw-qf|) will display file size + using the specified style. + + *g:netrw_usetab* if this variable exists and is non-zero, then + the map supporting shrinking/expanding a + Lexplore or netrw window will be enabled. + (see |netrw-c-tab|) + + *g:netrw_remote_mkdir* command for making a remote directory + via ftp (also see |g:netrw_mkdir_cmd|) + default: "mkdir" + + *g:netrw_retmap* if it exists and is set to one, then: + * if in a netrw-selected file, AND + * no normal-mode <2-leftmouse> mapping exists, + then the <2-leftmouse> will be mapped for easy + return to the netrw browser window. + example: click once to select and open a file, + double-click to return. + + Note that one may instead choose to: + * let g:netrw_retmap= 1, AND + * nmap YourChoice NetrwReturn + and have another mapping instead of + <2-leftmouse> to invoke the return. + + You may also use the |:Rexplore| command to do + the same thing. + + default: =0 + + *g:netrw_rm_cmd* command for removing remote files + default: "ssh USEPORT HOSTNAME rm" + + *g:netrw_rmdir_cmd* command for removing remote directories + default: "ssh USEPORT HOSTNAME rmdir" + + *g:netrw_rmf_cmd* command for removing remote softlinks + default: "ssh USEPORT HOSTNAME rm -f" + + *g:netrw_servername* use this variable to provide a name for + |netrw-ctrl-r| to use for its server. + default: "NETRWSERVER" + + *g:netrw_sort_by* sort by "name", "time", "size", or + "exten". + default: "name" + + *g:netrw_sort_direction* sorting direction: "normal" or "reverse" + default: "normal" + + *g:netrw_sort_options* sorting is done using |:sort|; this + variable's value is appended to the + sort command. Thus one may ignore case, + for example, with the following in your + .vimrc: > + let g:netrw_sort_options="i" +< default: "" + + *g:netrw_sort_sequence* when sorting by name, first sort by the + comma-separated pattern sequence. Note that + any filigree added to indicate filetypes + should be accounted for in your pattern. + default: '[\/]$,*,\.bak$,\.o$,\.h$, + \.info$,\.swp$,\.obj$' + + *g:netrw_special_syntax* If true, then certain files will be shown + using special syntax in the browser: + + netrwBak : *.bak + netrwCompress: *.gz *.bz2 *.Z *.zip + netrwCoreDump: core.\d\+ + netrwData : *.dat + netrwDoc : *.doc,*.txt,*.pdf, + *.pdf,*.docx + netrwHdr : *.h + netrwLex : *.l *.lex + netrwLib : *.a *.so *.lib *.dll + netrwMakefile: [mM]akefile *.mak + netrwObj : *.o *.obj + netrwPix : *.bmp,*.fit,*.fits,*.gif, + *.jpg,*.jpeg,*.pcx,*.ppc + *.pgm,*.png,*.psd,*.rgb + *.tif,*.xbm,*.xcf + netrwTags : tags ANmenu ANtags + netrwTilde : * + netrwTmp : tmp* *tmp + netrwYacc : *.y + + In addition, those groups mentioned in + |'suffixes'| are also added to the special + file highlighting group. + These syntax highlighting groups are linked + to netrwGray or Folded by default + (see |hl-Folded|), but one may put lines like > + hi link netrwCompress Visual +< into one's <.vimrc> to use one's own + preferences. Alternatively, one may + put such specifications into > + .vim/after/syntax/netrw.vim. +< The netrwGray highlighting is set up by + netrw when > + * netrwGray has not been previously + defined + * the gui is running +< As an example, I myself use a dark-background + colorscheme with the following in + .vim/after/syntax/netrw.vim: > + + hi netrwCompress term=NONE cterm=NONE gui=NONE ctermfg=10 guifg=green ctermbg=0 guibg=black + hi netrwData term=NONE cterm=NONE gui=NONE ctermfg=9 guifg=blue ctermbg=0 guibg=black + hi netrwHdr term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 + hi netrwLex term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 + hi netrwYacc term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 + hi netrwLib term=NONE cterm=NONE gui=NONE ctermfg=14 guifg=yellow + hi netrwObj term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwTilde term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwTmp term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwTags term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red + hi netrwDoc term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=yellow2 guibg=Blue3 + hi netrwSymLink term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=grey60 +< + *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines, + messages, banners, and whatnot that one doesn't + want masquerading as "directories" and "files". + Use this pattern to remove such embedded + messages. By default its value is: + '^total\s\+\d\+$' + + *g:netrw_ssh_cmd* One may specify an executable command + to use instead of ssh for remote actions + such as listing, file removal, etc. + default: ssh + + *g:netrw_suppress_gx_mesg* =1 : browsers sometimes produce messages + which are normally unwanted intermixed + with the page. + However, when using links, for example, + those messages are what the browser produces. + By setting this option to 0, netrw will not + suppress browser messages. + + *g:netrw_tmpfile_escape* =' &;' + escape() is applied to all temporary files + to escape these characters. + + *g:netrw_timefmt* specify format string to vim's strftime(). + The default, "%c", is "the preferred date + and time representation for the current + locale" according to my manpage entry for + strftime(); however, not all are satisfied + with it. Some alternatives: + "%a %d %b %Y %T", + " %a %Y-%m-%d %I-%M-%S %p" + default: "%c" + + *g:netrw_use_noswf* netrw normally avoids writing swapfiles + for browser buffers. However, under some + systems this apparently is causing nasty + ml_get errors to appear; if you're getting + ml_get errors, try putting + let g:netrw_use_noswf= 0 + in your .vimrc. + default: 1 + + *g:netrw_winsize* specify initial size of new windows made with + "o" (see |netrw-o|), "v" (see |netrw-v|), + |:Hexplore| or |:Vexplore|. The g:netrw_winsize + is an integer describing the percentage of the + current netrw buffer's window to be used for + the new window. + If g:netrw_winsize is less than zero, then + the absolute value of g:netrw_winsize will be + used to specify the quantity of lines or + columns for the new window. + If g:netrw_winsize is zero, then a normal + split will be made (ie. |'equalalways'| will + take effect, for example). + default: 50 (for 50%) + + *g:netrw_wiw* =1 specifies the minimum window width to use + when shrinking a netrw/Lexplore window + (see |netrw-c-tab|). + + *g:netrw_xstrlen* Controls how netrw computes string lengths, + including multi-byte characters' string + length. (thanks to N Weibull, T Mechelynck) + =0: uses Vim's built-in strlen() + =1: number of codepoints (Latin a + combining + circumflex is two codepoints) (DEFAULT) + =2: number of spacing codepoints (Latin a + + combining circumflex is one spacing + codepoint; a hard tab is one; wide and + narrow CJK are one each; etc.) + =3: virtual length (counting tabs as anything + between 1 and |'tabstop'|, wide CJK as 2 + rather than 1, Arabic alif as zero when + immediately preceded by lam, one + otherwise, etc) + + *g:NetrwTopLvlMenu* This variable specifies the top level + menu name; by default, it's "Netrw.". If + you wish to change this, do so in your + .vimrc. + +NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2 + +Netrw has been designed to handle user options by saving them, setting the +options to something that's compatible with netrw's needs, and then restoring +them. However, the autochdir option: > + :set acd +is problematic. Autochdir sets the current directory to that containing the +file you edit; this apparently also applies to directories. In other words, +autochdir sets the current directory to that containing the "file" (even if +that "file" is itself a directory). + +NETRW SETTINGS WINDOW *netrw-settings-window* {{{2 + +With the NetrwSettings.vim plugin, > + :NetrwSettings +will bring up a window with the many variables that netrw uses for its +settings. You may change any of their values; when you save the file, the +settings therein will be used. One may also press "?" on any of the lines for +help on what each of the variables do. + +(also see: |netrw-browser-var| |netrw-protocol| |netrw-variables|) + + +============================================================================== +OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2 + +If there are no marked files: + + When browsing a remote directory, one may obtain a file under the cursor + (ie. get a copy on your local machine, but not edit it) by pressing the O + key. + +If there are marked files: + + The marked files will be obtained (ie. a copy will be transferred to your + local machine, but not set up for editing). + +Only ftp and scp are supported for this operation (but since these two are +available for browsing, that shouldn't be a problem). The status bar will +then show, on its right hand side, a message like "Obtaining filename". The +statusline will be restored after the transfer is complete. + +Netrw can also "obtain" a file using the local browser. Netrw's display +of a directory is not necessarily the same as Vim's "current directory", +unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select +a file using the local browser (by putting the cursor on it) and pressing +"O" will then "obtain" the file; ie. copy it to Vim's current directory. + +Related topics: + * To see what the current directory is, use |:pwd| + * To make the currently browsed directory the current directory, see + |netrw-cd| + * To automatically make the currently browsed directory the current + directory, see |g:netrw_keepdir|. + + *netrw-newfile* *netrw-createfile* +OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2 + +To open a new file in netrw's current directory, press "%". This map +will query the user for a new filename; an empty file by that name will +be placed in the netrw's current directory (ie. b:netrw_curdir). + +If Lexplore (|netrw-:Lexplore|) is in use, the new file will be generated +in the |g:netrw_chgwin| window. + +Related topics: |netrw-d| + + +PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2 + +One may use a preview window by using the "p" key when the cursor is atop the +desired filename to be previewed. The display will then split to show both +the browser (where the cursor will remain) and the file (see |:pedit|). By +default, the split will be taken horizontally; one may use vertical splitting +if one has set |g:netrw_preview| first. + +An interesting set of netrw settings is: > + + let g:netrw_preview = 1 + let g:netrw_liststyle = 3 + let g:netrw_winsize = 30 + +These will: + + 1. Make vertical splitting the default for previewing files + 2. Make the default listing style "tree" + 3. When a vertical preview window is opened, the directory listing + will use only 30% of the columns available; the rest of the window + is used for the preview window. + + Related: if you like this idea, you may also find :Lexplore + (|netrw-:Lexplore|) or |g:netrw_chgwin| of interest + +Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| |CTRL-W_z| |:pclose| + + +PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2 + +To edit a file or directory under the cursor in the previously used (last +accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one +window, then the one window will be horizontally split (by default). + +If there's more than one window, the previous window will be re-used on +the selected file/directory. If the previous window's associated buffer +has been modified, and there's only one window with that buffer, then +the user will be asked if s/he wishes to save the buffer first (yes, +no, or cancel). + +Related Actions |netrw-cr| |netrw-o| |netrw-t| |netrw-v| +Associated setting variables: + |g:netrw_alto| control above/below splitting + |g:netrw_altv| control right/left splitting + |g:netrw_preview| control horizontal vs vertical splitting + |g:netrw_winsize| control initial sizing + +Also see: |g:netrw_chgwin| |netrw-p| + + +REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2 + +To refresh either a local or remote directory listing, press ctrl-l () or +hit the when atop the ./ directory entry in the listing. One may also +refresh a local directory by using ":e .". + + +REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2 + +One may toggle between normal and reverse sorting order by pressing the +"r" key. + +Related topics: |netrw-s| +Associated setting variable: |g:netrw_sort_direction| + + +RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2 + +If there are no marked files: (see |netrw-mf|) + + Renaming files and directories involves moving the cursor to the + file/directory to be moved (renamed) and pressing "R". You will then be + queried for what you want the file/directory to be renamed to. You may + select a range of lines with the "V" command (visual selection), and then + press "R"; you will be queried for each file as to what you want it + renamed to. + +If there are marked files: (see |netrw-mf|) + + Marked files will be renamed (moved). You will be queried as above in + order to specify where you want the file/directory to be moved. + + If you answer a renaming query with a "s/frompattern/topattern/", then + subsequent files on the marked file list will be renamed by taking each + name, applying that substitute, and renaming each file to the result. + As an example : > + + mr [query: reply with *.c] + R [query: reply with s/^\(.*\)\.c$/\1.cpp/] +< + This example will mark all *.c files and then rename them to *.cpp + files. Netrw will protect you from overwriting local files without + confirmation, but not remote ones. + + The ctrl-X character has special meaning for renaming files: > + + : a single ctrl-x tells netrw to ignore the portion of the response + lying between the last '/' and the ctrl-x. + + : a pair of contiguous ctrl-x's tells netrw to ignore any + portion of the string preceding the double ctrl-x's. +< + WARNING:~ + + Note that moving files is a dangerous operation; copies are safer. That's + because a "move" for remote files is actually a copy + delete -- and if + the copy fails and the delete succeeds you may lose the file. + Use at your own risk. + +The *g:netrw_rename_cmd* variable is used to implement remote renaming. By +default its value is: > + + ssh HOSTNAME mv +< +One may rename a block of files and directories by selecting them with +V (|linewise-visual|) when using thin style. + +See |cmdline-editing| for more on how to edit the command line; in particular, +you'll find (initiates cmdline window editing) and (uses the +command line under the cursor) useful in conjunction with the R command. + + +SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2 + +One may select the sorting style by name, time, or (file) size. The "s" map +allows one to circulate amongst the three choices; the directory listing will +automatically be refreshed to reflect the selected style. + +Related topics: |netrw-r| |netrw-S| +Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence| + + +SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2 + +One may select a netrw window for editing with the "C" mapping, using the +:NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window +number. Subsequent selection of a file to edit (|netrw-cr|) will use that +window. + + * C : by itself, will select the current window holding a netrw buffer + for subsequent editing via |netrw-cr|. The C mapping is only available + while in netrw buffers. + + * [count]C : the count will be used as the window number to be used + for subsequent editing via |netrw-cr|. + + * :NetrwC will set |g:netrw_chgwin| to the current window + + * :NetrwC win# will set |g:netrw_chgwin| to the specified window + number + +Using > + let g:netrw_chgwin= -1 +will restore the default editing behavior +(ie. subsequent editing will use the current window). + +Related topics: |netrw-cr| |g:netrw_browse_split| +Associated setting variables: |g:netrw_chgwin| + + +SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2 + +The key will toggle a netrw or |:Lexplore| window's width, +but only if |g:netrw_usetab| exists and is non-zero (and, of course, +only if your terminal supports differentiating from a plain +). + + * If the current window is a netrw window, toggle its width + (between |g:netrw_wiw| and its original width) + + * Else if there is a |:Lexplore| window in the current tab, toggle + its width + + * Else bring up a |:Lexplore| window + +If |g:netrw_usetab| exists and is zero, or if there is a pre-existing mapping +for , then the will not be mapped. One may map something other +than a , too: (but you'll still need to have had |g:netrw_usetab| set). > + + nmap (whatever) NetrwShrink +< +Related topics: |:Lexplore| +Associated setting variable: |g:netrw_usetab| + + +USER SPECIFIED MAPS *netrw-usermaps* {{{1 + +One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|, +to hold a |List| of lists of keymap strings and function names: > + + [["keymap-sequence","ExampleUserMapFunc"],...] +< +When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps| +exists, then the internal function netrw#UserMaps(islocal) is called. +This function goes through all the entries in the |g:Netrw_UserMaps| list: + + * sets up maps: > + nno KEYMAP-SEQUENCE + :call s:UserMaps(islocal,"ExampleUserMapFunc") +< * refreshes if result from that function call is the string + "refresh" + * if the result string is not "", then that string will be + executed (:exe result) + * if the result is a List, then the above two actions on results + will be taken for every string in the result List + +The user function is passed one argument; it resembles > + + fun! ExampleUserMapFunc(islocal) +< +where a:islocal is 1 if its a local-directory system call or 0 when +remote-directory system call. + + *netrw-call* *netrw-expose* *netrw-modify* +Use netrw#Expose("varname") to access netrw-internal (script-local) + variables. +Use netrw#Modify("varname",newvalue) to change netrw-internal variables. +Use netrw#Call("funcname"[,args]) to call a netrw-internal function with + specified arguments. + +Example: Get a copy of netrw's marked file list: > + + let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist") +< +Example: Modify the value of netrw's marked file list: > + + call netrw#Modify("netrwmarkfilelist",[]) +< +Example: Clear netrw's marked file list via a mapping on gu > + " ExampleUserMap: {{{2 + fun! ExampleUserMap(islocal) + call netrw#Modify("netrwmarkfilelist",[]) + call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"") + let retval= ["refresh"] + return retval + endfun + let g:Netrw_UserMaps= [["gu","ExampleUserMap"]] +< + +10. Problems and Fixes *netrw-problems* {{{1 + + (This section is likely to grow as I get feedback) + *netrw-p1* + P1. I use Windows, and my network browsing with ftp doesn't sort by {{{2 + time or size! -or- The remote system is a Windows server; why + don't I get sorts by time or size? + + Windows' ftp has a minimal support for ls (ie. it doesn't + accept sorting options). It doesn't support the -F which + gives an explanatory character (ABC/ for "ABC is a directory"). + Netrw then uses "dir" to get both its thin and long listings. + If you think your ftp does support a full-up ls, put the + following into your <.vimrc>: > + + let g:netrw_ftp_list_cmd = "ls -lF" + let g:netrw_ftp_timelist_cmd= "ls -tlF" + let g:netrw_ftp_sizelist_cmd= "ls -slF" +< + Alternatively, if you have cygwin on your Windows box, put + into your <.vimrc>: > + + let g:netrw_cygwin= 1 +< + This problem also occurs when the remote system is Windows. + In this situation, the various g:netrw_ftp_[time|size]list_cmds + are as shown above, but the remote system will not correctly + modify its listing behavior. + + + *netrw-p2* + P2. I tried rcp://user@host/ (or protocol other than ftp) and netrw {{{2 + used ssh! That wasn't what I asked for... + + Netrw has two methods for browsing remote directories: ssh + and ftp. Unless you specify ftp specifically, ssh is used. + When it comes time to do download a file (not just a directory + listing), netrw will use the given protocol to do so. + + *netrw-p3* + P3. I would like long listings to be the default. {{{2 + + Put the following statement into your |.vimrc|: > + + let g:netrw_liststyle= 1 +< + Check out |netrw-browser-var| for more customizations that + you can set. + + *netrw-p4* + P4. My times come up oddly in local browsing {{{2 + + Does your system's strftime() accept the "%c" to yield dates + such as "Sun Apr 27 11:49:23 1997"? If not, do a + "man strftime" and find out what option should be used. Then + put it into your |.vimrc|: > + + let g:netrw_timefmt= "%X" (where X is the option) +< + *netrw-p5* + P5. I want my current directory to track my browsing. {{{2 + How do I do that? + + Put the following line in your |.vimrc|: +> + let g:netrw_keepdir= 0 +< + *netrw-p6* + P6. I use Chinese (or other non-ascii) characters in my filenames, {{{2 + and netrw (Explore, Sexplore, Hexplore, etc) doesn't display them! + + (taken from an answer provided by Wu Yongwei on the vim + mailing list) + I now see the problem. Your code page is not 936, right? Vim + seems only able to open files with names that are valid in the + current code page, as are many other applications that do not + use the Unicode version of Windows APIs. This is an OS-related + issue. You should not have such problems when the system + locale uses UTF-8, such as modern Linux distros. + + (...it is one more reason to recommend that people use utf-8!) + + *netrw-p7* + P7. I'm getting "ssh is not executable on your system" -- what do I {{{2 + do? + + (Dudley Fox) Most people I know use putty for windows ssh. It + is a free ssh/telnet application. You can read more about it + here: + + http://www.chiark.greenend.org.uk/~sgtatham/putty/ Also: + + (Marlin Unruh) This program also works for me. It's a single + executable, so he/she can copy it into the Windows\System32 + folder and create a shortcut to it. + + (Dudley Fox) You might also wish to consider plink, as it + sounds most similar to what you are looking for. plink is an + application in the putty suite. + + http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html#plink + + (Vissale Neang) Maybe you can try OpenSSH for windows, which + can be obtained from: + + http://sshwindows.sourceforge.net/ + + It doesn't need the full Cygwin package. + + (Antoine Mechelynck) For individual Unix-like programs needed + for work in a native-Windows environment, I recommend getting + them from the GnuWin32 project on sourceforge if it has them: + + http://gnuwin32.sourceforge.net/ + + Unlike Cygwin, which sets up a Unix-like virtual machine on + top of Windows, GnuWin32 is a rewrite of Unix utilities with + Windows system calls, and its programs works quite well in the + cmd.exe "Dos box". + + (dave) Download WinSCP and use that to connect to the server. + In Preferences > Editors, set gvim as your editor: + + - Click "Add..." + - Set External Editor (adjust path as needed, include + the quotes and !.! at the end): + "c:\Program Files\Vim\vim82\gvim.exe" !.! + - Check that the filetype in the box below is + {asterisk}.{asterisk} (all files), or whatever types + you want (cec: change {asterisk} to * ; I had to + write it that way because otherwise the helptags + system thinks it's a tag) + - Make sure it's at the top of the listbox (click it, + then click "Up" if it's not) + If using the Norton Commander style, you just have to hit + to edit a file in a local copy of gvim. + + (Vit Gottwald) How to generate public/private key and save + public key it on server: > + http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready + (8.3 Getting ready for public key authentication) +< + How to use a private key with 'pscp': > + + http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html + (5.2.4 Using public key authentication with PSCP) +< + (Ben Schmidt) I find the ssh included with cwRsync is + brilliant, and install cwRsync or cwRsyncServer on most + Windows systems I come across these days. I guess COPSSH, + packed by the same person, is probably even better for use as + just ssh on Windows, and probably includes sftp, etc. which I + suspect the cwRsync doesn't, though it might + + (cec) To make proper use of these suggestions above, you will + need to modify the following user-settable variables in your + .vimrc: + + |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd| + |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd| + + The first one (|g:netrw_ssh_cmd|) is the most important; most + of the others will use the string in g:netrw_ssh_cmd by + default. + + *netrw-p8* *netrw-ml_get* + P8. I'm browsing, changing directory, and bang! ml_get errors {{{2 + appear and I have to kill vim. Any way around this? + + Normally netrw attempts to avoid writing swapfiles for + its temporary directory buffers. However, on some systems + this attempt appears to be causing ml_get errors to + appear. Please try setting |g:netrw_use_noswf| to 0 + in your <.vimrc>: > + let g:netrw_use_noswf= 0 +< + *netrw-p9* + P9. I'm being pestered with "[something] is a directory" and {{{2 + "Press ENTER or type command to continue" prompts... + + The "[something] is a directory" prompt is issued by Vim, + not by netrw, and there appears to be no way to work around + it. Coupled with the default cmdheight of 1, this message + causes the "Press ENTER..." prompt. So: read |hit-enter|; + I also suggest that you set your |'cmdheight'| to 2 (or more) in + your <.vimrc> file. + + *netrw-p10* + P10. I want to have two windows; a thin one on the left and my {{{2 + editing window on the right. How may I accomplish this? + + You probably want netrw running as in a side window. If so, you + will likely find that ":[N]Lexplore" does what you want. The + optional "[N]" allows you to select the quantity of columns you + wish the |:Lexplore|r window to start with (see |g:netrw_winsize| + for how this parameter works). + + Previous solution: + + * Put the following line in your <.vimrc>: + let g:netrw_altv = 1 + * Edit the current directory: :e . + * Select some file, press v + * Resize the windows as you wish (see |CTRL-W_<| and + |CTRL-W_>|). If you're using gvim, you can drag + the separating bar with your mouse. + * When you want a new file, use ctrl-w h to go back to the + netrw browser, select a file, then press P (see |CTRL-W_h| + and |netrw-P|). If you're using gvim, you can press + in the browser window and then press the + to select the file. + + + *netrw-p11* + P11. My directory isn't sorting correctly, or unwanted letters are {{{2 + appearing in the listed filenames, or things aren't lining + up properly in the wide listing, ... + + This may be due to an encoding problem. I myself usually use + utf-8, but really only use ascii (ie. bytes from 32-126). + Multibyte encodings use two (or more) bytes per character. + You may need to change |g:netrw_sepchr| and/or |g:netrw_xstrlen|. + + *netrw-p12* + P12. I'm a Windows + putty + ssh user, and when I attempt to {{{2 + browse, the directories are missing trailing "/"s so netrw treats + them as file transfers instead of as attempts to browse + subdirectories. How may I fix this? + + (mikeyao) If you want to use vim via ssh and putty under Windows, + try combining the use of pscp/psftp with plink. pscp/psftp will + be used to connect and plink will be used to execute commands on + the server, for example: list files and directory using 'ls'. + + These are the settings I use to do this: +> + " list files, it's the key setting, if you haven't set, + " you will get a blank buffer + let g:netrw_list_cmd = "plink HOSTNAME ls -Fa" + " if you haven't add putty directory in system path, you should + " specify scp/sftp command. For examples: + "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe" + "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe" +< + *netrw-p13* + P13. I would like to speed up writes using Nwrite and scp/ssh {{{2 + style connections. How? (Thomer M. Gil) + + Try using ssh's ControlMaster and ControlPath (see the ssh_config + man page) to share multiple ssh connections over a single network + connection. That cuts out the cryptographic handshake on each + file write, sometimes speeding it up by an order of magnitude. + (see http://thomer.com/howtos/netrw_ssh.html) + (included by permission) + + Add the following to your ~/.ssh/config: > + + # you change "*" to the hostname you care about + Host * + ControlMaster auto + ControlPath /tmp/%r@%h:%p + +< Then create an ssh connection to the host and leave it running: > + + ssh -N host.domain.com + +< Now remotely open a file with Vim's Netrw and enjoy the + zippiness: > + + vim scp://host.domain.com//home/user/.bashrc +< + *netrw-p14* + P14. How may I use a double-click instead of netrw's usual single {{{2 + click to open a file or directory? (Ben Fritz) + + First, disable netrw's mapping with > + let g:netrw_mousemaps= 0 +< and then create a netrw buffer only mapping in + $HOME/.vim/after/ftplugin/netrw.vim: > + nmap <2-leftmouse> +< Note that setting g:netrw_mousemaps to zero will turn off + all netrw's mouse mappings, not just the one. + (see |g:netrw_mousemaps|) + + *netrw-p15* + P15. When editing remote files (ex. :e ftp://hostname/path/file), {{{2 + under Windows I get an |E303| message complaining that its unable + to open a swap file. + + (romainl) It looks like you are starting Vim from a protected + directory. Start netrw from your $HOME or other writable + directory. + + *netrw-p16* + P16. Netrw is closing buffers on its own. {{{2 + What steps will reproduce the problem? + 1. :Explore, navigate directories, open a file + 2. :Explore, open another file + 3. Buffer opened in step 1 will be closed. o + What is the expected output? What do you see instead? + I expect both buffers to exist, but only the last one does. + + (Lance) Problem is caused by "set autochdir" in .vimrc. + (drchip) I am able to duplicate this problem with |'acd'| set. + It appears that the buffers are not exactly closed; + a ":ls!" will show them (although ":ls" does not). + + *netrw-P17* + P17. How to locally edit a file that's only available via {{{2 + another server accessible via ssh? + See http://stackoverflow.com/questions/12469645/ + "Using Vim to Remotely Edit A File on ServerB Only + Accessible From ServerA" + + *netrw-P18* + P18. How do I get numbering on in directory listings? {{{2 + With |g:netrw_bufsettings|, you can control netrw's buffer + settings; try putting > + let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu" +< in your .vimrc. If you'd like to have relative numbering + instead, try > + let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu" +< + *netrw-P19* + P19. How may I have gvim start up showing a directory listing? {{{2 + Try putting the following code snippet into your .vimrc: > + augroup VimStartup + au! + au VimEnter * if expand("%") == "" && argc() == 0 && + \ (v:servername =~ 'GVIM\d*' || v:servername == "") + \ | e . | endif + augroup END +< You may use Lexplore instead of "e" if you're so inclined. + This snippet assumes that you have client-server enabled + (ie. a "huge" vim version). + + *netrw-P20* + P20. I've made a directory (or file) with an accented character, {{{2 + but netrw isn't letting me enter that directory/read that file: + + Its likely that the shell or o/s is using a different encoding + than you have vim (netrw) using. A patch to vim supporting + "systemencoding" may address this issue in the future; for + now, just have netrw use the proper encoding. For example: > + + au FileType netrw set enc=latin1 +< + *netrw-P21* + P21. I get an error message when I try to copy or move a file: {{{2 + + **error** (netrw) tried using g:netrw_localcopycmd; it doesn't work! + + What's wrong? + + Netrw uses several system level commands to do things (see + + |g:netrw_localcopycmd|, |g:netrw_localmovecmd|, + |g:netrw_mkdir_cmd|). + + You may need to adjust the default commands for one or more of + these commands by setting them properly in your .vimrc. Another + source of difficulty is that these commands use vim's local + directory, which may not be the same as the browsing directory + shown by netrw (see |g:netrw_keepdir|). + + +============================================================================== +11. Credits *netrw-credits* {{{1 + + Vim editor by Bram Moolenaar (Thanks, Bram!) + dav support by C Campbell + fetch support by Bram Moolenaar and C Campbell + ftp support by C Campbell + http support by Bram Moolenaar + rcp + rsync support by C Campbell (suggested by Erik Warendorph) + scp support by raf + sftp support by C Campbell + + inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell + + Jérôme Augé -- also using new buffer method with ftp+.netrc + Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, + fetch,... + Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution + Erik Warendorph -- for several suggestions (g:netrw_..._cmd + variables, rsync etc) + Doug Claar -- modifications to test for success with ftp + operation + +============================================================================== +Modelines: {{{1 +vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker diff --git a/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim b/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim new file mode 100644 index 0000000000..ddf4234aa2 --- /dev/null +++ b/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim @@ -0,0 +1,222 @@ +" Maintainer: Luca Saccarola +" Former Maintainer: Charles E Campbell +" Upstream: +" Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{1 +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided +" *as is* and comes with no warranty of any kind, either +" expressed or implied. By using this plugin, you agree that +" in no event will the copyright holder be liable for any damages +" resulting from the use of this software. + +" Load Once: {{{1 +if &cp || exists("g:loaded_netrwPlugin") + finish +endif +let g:loaded_netrwPlugin = "v174" +let s:keepcpo = &cpo +set cpo&vim +"DechoRemOn + +" --------------------------------------------------------------------- +" Public Interface: {{{1 + +" Commands Launch/URL {{{2 +command -complete=shellcmd -nargs=1 Launch call netrw#Launch(trim()) +command -complete=file -nargs=1 Open call netrw#Open(trim()) +" " }}} +" Local Browsing Autocmds: {{{2 +augroup FileExplorer + au! + au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif + au BufEnter * sil call s:LocalBrowse(expand("")) + au VimEnter * sil call s:VimEnter(expand("")) + if has("win32") + au BufEnter .* sil call s:LocalBrowse(expand("")) + endif +augroup END + +" Network Browsing Reading Writing: {{{2 +augroup Network + au! + au BufReadCmd file://* call netrw#FileUrlEdit(expand("")) + au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand(""))|call netrw#Nread(2,expand(""))|exe "sil doau BufReadPost ".fnameescape(expand("")) + au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand(""))|call netrw#Nread(1,expand(""))|exe "sil doau FileReadPost ".fnameescape(expand("")) + au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand(""))|exe 'Nwrite '.fnameescape(expand(""))|exe "sil doau BufWritePost ".fnameescape(expand("")) + au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand(""))|exe "'[,']".'Nwrite '.fnameescape(expand(""))|exe "sil doau FileWritePost ".fnameescape(expand("")) + try + au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) + catch /^Vim\%((\a\+)\)\=:E216/ + au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) + endtry +augroup END + +" Commands: :Nread, :Nwrite, :NetUserPass {{{2 +com! -count=1 -nargs=* Nread let s:svpos= winsaveview()call netrw#NetRead(,)call winrestview(s:svpos) +com! -range=% -nargs=* Nwrite let s:svpos= winsaveview(),call netrw#NetWrite()call winrestview(s:svpos) +com! -nargs=* NetUserPass call NetUserPass() +com! -nargs=* Nsource let s:svpos= winsaveview()call netrw#NetSource()call winrestview(s:svpos) +com! -nargs=? Ntree call netrw#SetTreetop(1,) + +" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2 +com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(,0,0+0,) +com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(,1,0+0,) +com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(,1,2+0,) +com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(,1,4+0,) +com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(,0,6 ,) +com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,) +com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,) +com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(,0,) + +" Commands: NetrwSettings {{{2 +com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings() +com! -bang NetrwClean call netrw#Clean(0) + +" Maps: +if !exists("g:netrw_nogx") + if maparg('gx','n') == "" + if !hasmapto('NetrwBrowseX') + nmap gx NetrwBrowseX + endif + nno NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX())) + endif + if maparg('gx','x') == "" + if !hasmapto('NetrwBrowseXVis') + xmap gx NetrwBrowseXVis + endif + xno NetrwBrowseXVis :call netrw#BrowseXVis() + endif +endif +if exists("g:netrw_usetab") && g:netrw_usetab + if maparg('','n') == "" + nmap NetrwShrink + endif + nno NetrwShrink :call netrw#Shrink() +endif + +" --------------------------------------------------------------------- +" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2 +fun! s:LocalBrowse(dirname) + " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. + " Otherwise, the BufEnter event gets triggered when attempts to write to + " the DBG buffer are made. + + if !exists("s:vimentered") + " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, + " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. + " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)") + " call Dret("s:LocalBrowse") + return + endif + + " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")") + + if has("amiga") + " The check against '' is made for the Amiga, where the empty + " string is the current directory and not checking would break + " things such as the help command. + " call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)") + if a:dirname != '' && isdirectory(a:dirname) + sil! call netrw#LocalBrowseCheck(a:dirname) + if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt + exe w:netrw_bannercnt + endif + endif + + elseif isdirectory(a:dirname) + " call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)") + " call Dredir("LocalBrowse ft last set: ","verbose set ft") + " Jul 13, 2021: for whatever reason, preceding the following call with + " a sil! causes an unbalanced if-endif vim error + call netrw#LocalBrowseCheck(a:dirname) + if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt + exe w:netrw_bannercnt + endif + + else + " not a directory, ignore it + " call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...") + endif + + " call Dret("s:LocalBrowse") +endfun + +" --------------------------------------------------------------------- +" s:VimEnter: after all vim startup stuff is done, this function is called. {{{2 +" Its purpose: to look over all windows and run s:LocalBrowse() on +" them, which checks if they're directories and will create a directory +" listing when appropriate. +" It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter() +" has already been called. +fun! s:VimEnter(dirname) + " call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">") + if has('nvim') || v:version < 802 + " Johann Höchtl: reported that the call range... line causes an E488: Trailing characters + " error with neovim. I suspect its because neovim hasn't updated with recent + " vim patches. As is, this code will have problems with popup terminals + " instantiated before the VimEnter event runs. + " Ingo Karkat : E488 also in Vim 8.1.1602 + let curwin = winnr() + let s:vimentered = 1 + windo call s:LocalBrowse(expand("%:p")) + exe curwin."wincmd w" + else + " the following complicated expression comes courtesy of lacygoill; largely does the same thing as the windo and + " wincmd which are commented out, but avoids some side effects. Allows popup terminal before VimEnter. + let s:vimentered = 1 + call range(1, winnr('$'))->map({_, v -> win_execute(win_getid(v), 'call expand("%:p")->s:LocalBrowse()')}) + endif + " call Dret("s:VimEnter") +endfun + +" --------------------------------------------------------------------- +" NetrwStatusLine: {{{1 +fun! NetrwStatusLine() + " let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".") + if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") + let &stl= s:netrw_explore_stl + if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif + if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif + return "" + else + return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen + endif +endfun + +" ------------------------------------------------------------------------ +" NetUserPass: set username and password for subsequent ftp transfer {{{1 +" Usage: :call NetUserPass() -- will prompt for userid and password +" :call NetUserPass("uid") -- will prompt for password +" :call NetUserPass("uid","password") -- sets global userid and password +fun! NetUserPass(...) + + " get/set userid + if a:0 == 0 + " call Dfunc("NetUserPass(a:0<".a:0.">)") + if !exists("g:netrw_uid") || g:netrw_uid == "" + " via prompt + let g:netrw_uid= input('Enter username: ') + endif + else " from command line + " call Dfunc("NetUserPass(a:1<".a:1.">) {") + let g:netrw_uid= a:1 + endif + + " get password + if a:0 <= 1 " via prompt + " call Decho("a:0=".a:0." case <=1:") + let g:netrw_passwd= inputsecret("Enter Password: ") + else " from command line + " call Decho("a:0=".a:0." case >1: a:2<".a:2.">") + let g:netrw_passwd=a:2 + endif + " call Dret("NetUserPass") +endfun + +" ------------------------------------------------------------------------ +" Modelines And Restoration: {{{1 +let &cpo= s:keepcpo +unlet s:keepcpo +" vim:ts=8 sts=2 sw=2 et fdm=marker diff --git a/runtime/syntax/netrw.vim b/runtime/pack/dist/opt/netrw/syntax/netrw.vim similarity index 94% rename from runtime/syntax/netrw.vim rename to runtime/pack/dist/opt/netrw/syntax/netrw.vim index f5b7fdc2c6..a94af0c27a 100644 --- a/runtime/syntax/netrw.vim +++ b/runtime/pack/dist/opt/netrw/syntax/netrw.vim @@ -1,15 +1,12 @@ -" Language : Netrw Listing Syntax -" Maintainer: This runtime file is looking for a new maintainer. -" Former Maintainer: Charles E. Campbell -" Last Change: Nov 07, 2019 -" 2024 Feb 19 by Vim Project (announce adoption) -" Version : 20 -" --------------------------------------------------------------------- +" Maintainer: Luca Saccarola +" Former Maintainer: Charles E Campbell +" Upstream: +" Language: Netrw Listing Syntax + if exists("b:current_syntax") finish endif -" --------------------------------------------------------------------- " Directory List Syntax Highlighting: {{{1 syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim index d534b36966..6d7a8660ff 100644 --- a/runtime/plugin/netrwPlugin.vim +++ b/runtime/plugin/netrwPlugin.vim @@ -1,234 +1,9 @@ -" netrwPlugin.vim: Handles file transfer and remote directory listing across a network -" PLUGIN SECTION -" Maintainer: This runtime file is looking for a new maintainer. -" Date: Sep 09, 2021 -" Last Change: -" 2024 May 08 by Vim Project: cleanup legacy Win9X checks -" 2024 Oct 27 by Vim Project: cleanup gx mapping -" 2024 Oct 28 by Vim Project: further improvements -" 2024 Oct 31 by Vim Project: use autoloaded functions -" 2024 Dec 19 by Vim Project: change style (#16248) -" Former Maintainer: Charles E Campbell -" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim -" Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{1 -" Permission is hereby granted to use and distribute this code, -" with or without modifications, provided that this copyright -" notice is copied with it. Like anything else that's free, -" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided -" *as is* and comes with no warranty of any kind, either -" expressed or implied. By using this plugin, you agree that -" in no event will the copyright holder be liable for any damages -" resulting from the use of this software. -" -" But be doers of the Word, and not only hearers, deluding your own selves {{{1 -" (James 1:22 RSV) -" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -" Load Once: {{{1 -if &cp || exists("g:loaded_netrwPlugin") - finish -endif -let g:loaded_netrwPlugin = "v173" -let s:keepcpo = &cpo -set cpo&vim -"DechoRemOn - -" --------------------------------------------------------------------- -" Public Interface: {{{1 - -" Commands Launch/URL {{{2 -command -complete=shellcmd -nargs=1 Launch call netrw#Launch(trim()) -command -complete=file -nargs=1 Open call netrw#Open(trim()) -" " }}} -" Local Browsing Autocmds: {{{2 -augroup FileExplorer - au! - au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif - au BufEnter * sil call s:LocalBrowse(expand("")) - au VimEnter * sil call s:VimEnter(expand("")) - if has("win32") - au BufEnter .* sil call s:LocalBrowse(expand("")) - endif -augroup END - -" Network Browsing Reading Writing: {{{2 -augroup Network - au! - au BufReadCmd file://* call netrw#FileUrlEdit(expand("")) - au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand(""))|call netrw#Nread(2,expand(""))|exe "sil doau BufReadPost ".fnameescape(expand("")) - au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand(""))|call netrw#Nread(1,expand(""))|exe "sil doau FileReadPost ".fnameescape(expand("")) - au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand(""))|exe 'Nwrite '.fnameescape(expand(""))|exe "sil doau BufWritePost ".fnameescape(expand("")) - au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand(""))|exe "'[,']".'Nwrite '.fnameescape(expand(""))|exe "sil doau FileWritePost ".fnameescape(expand("")) - try - au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) - catch /^Vim\%((\a\+)\)\=:E216/ - au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) - endtry -augroup END - -" Commands: :Nread, :Nwrite, :NetUserPass {{{2 -com! -count=1 -nargs=* Nread let s:svpos= winsaveview()call netrw#NetRead(,)call winrestview(s:svpos) -com! -range=% -nargs=* Nwrite let s:svpos= winsaveview(),call netrw#NetWrite()call winrestview(s:svpos) -com! -nargs=* NetUserPass call NetUserPass() -com! -nargs=* Nsource let s:svpos= winsaveview()call netrw#NetSource()call winrestview(s:svpos) -com! -nargs=? Ntree call netrw#SetTreetop(1,) +" Load the netrw package. -" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2 -com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(,0,0+0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(,1,0+0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(,1,2+0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(,1,4+0,) -com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(,0,6 ,) -com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,) -com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(,0,) - -" Commands: NetrwSettings {{{2 -com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings() -com! -bang NetrwClean call netrw#Clean(0) - -" Maps: -if !exists("g:netrw_nogx") - if maparg('gx','n') == "" - if !hasmapto('NetrwBrowseX') - nmap gx NetrwBrowseX - endif - nno NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX())) - endif - if maparg('gx','x') == "" - if !hasmapto('NetrwBrowseXVis') - xmap gx NetrwBrowseXVis - endif - xno NetrwBrowseXVis :call netrw#BrowseXVis() - endif -endif -if exists("g:netrw_usetab") && g:netrw_usetab - if maparg('','n') == "" - nmap NetrwShrink - endif - nno NetrwShrink :call netrw#Shrink() +if &cp || exists("g:loaded_netrw") || exists("g:loaded_netrwPlugin") + finish endif -" --------------------------------------------------------------------- -" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2 -fun! s:LocalBrowse(dirname) - " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. - " Otherwise, the BufEnter event gets triggered when attempts to write to - " the DBG buffer are made. - - if !exists("s:vimentered") - " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, - " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. - " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)") - " call Dret("s:LocalBrowse") - return - endif - - " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")") - - if has("amiga") - " The check against '' is made for the Amiga, where the empty - " string is the current directory and not checking would break - " things such as the help command. - " call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)") - if a:dirname != '' && isdirectory(a:dirname) - sil! call netrw#LocalBrowseCheck(a:dirname) - if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt - exe w:netrw_bannercnt - endif - endif - - elseif isdirectory(a:dirname) - " call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)") - " call Dredir("LocalBrowse ft last set: ","verbose set ft") - " Jul 13, 2021: for whatever reason, preceding the following call with - " a sil! causes an unbalanced if-endif vim error - call netrw#LocalBrowseCheck(a:dirname) - if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt - exe w:netrw_bannercnt - endif - - else - " not a directory, ignore it - " call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...") - endif - - " call Dret("s:LocalBrowse") -endfun - -" --------------------------------------------------------------------- -" s:VimEnter: after all vim startup stuff is done, this function is called. {{{2 -" Its purpose: to look over all windows and run s:LocalBrowse() on -" them, which checks if they're directories and will create a directory -" listing when appropriate. -" It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter() -" has already been called. -fun! s:VimEnter(dirname) - " call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">") - if has('nvim') || v:version < 802 - " Johann Höchtl: reported that the call range... line causes an E488: Trailing characters - " error with neovim. I suspect its because neovim hasn't updated with recent - " vim patches. As is, this code will have problems with popup terminals - " instantiated before the VimEnter event runs. - " Ingo Karkat : E488 also in Vim 8.1.1602 - let curwin = winnr() - let s:vimentered = 1 - windo call s:LocalBrowse(expand("%:p")) - exe curwin."wincmd w" - else - " the following complicated expression comes courtesy of lacygoill; largely does the same thing as the windo and - " wincmd which are commented out, but avoids some side effects. Allows popup terminal before VimEnter. - let s:vimentered = 1 - call range(1, winnr('$'))->map({_, v -> win_execute(win_getid(v), 'call expand("%:p")->s:LocalBrowse()')}) - endif - " call Dret("s:VimEnter") -endfun - -" --------------------------------------------------------------------- -" NetrwStatusLine: {{{1 -fun! NetrwStatusLine() - " let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".") - if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") - let &stl= s:netrw_explore_stl - if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif - if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif - return "" - else - return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen - endif -endfun - -" ------------------------------------------------------------------------ -" NetUserPass: set username and password for subsequent ftp transfer {{{1 -" Usage: :call NetUserPass() -- will prompt for userid and password -" :call NetUserPass("uid") -- will prompt for password -" :call NetUserPass("uid","password") -- sets global userid and password -fun! NetUserPass(...) - - " get/set userid - if a:0 == 0 - " call Dfunc("NetUserPass(a:0<".a:0.">)") - if !exists("g:netrw_uid") || g:netrw_uid == "" - " via prompt - let g:netrw_uid= input('Enter username: ') - endif - else " from command line - " call Dfunc("NetUserPass(a:1<".a:1.">) {") - let g:netrw_uid= a:1 - endif - - " get password - if a:0 <= 1 " via prompt - " call Decho("a:0=".a:0." case <=1:") - let g:netrw_passwd= inputsecret("Enter Password: ") - else " from command line - " call Decho("a:0=".a:0." case >1: a:2<".a:2.">") - let g:netrw_passwd=a:2 - endif - " call Dret("NetUserPass") -endfun +packadd netrw -" ------------------------------------------------------------------------ -" Modelines And Restoration: {{{1 -let &cpo= s:keepcpo -unlet s:keepcpo -" vim:ts=8 sts=2 sw=2 et fdm=marker +" vim:ts=8 sts=2 sw=2 et From 3a738fccaaf6737c91641856ea00579dbe68bd4e Mon Sep 17 00:00:00 2001 From: Marces Engel Date: Fri, 17 Jan 2025 13:10:15 +0100 Subject: [PATCH 37/93] patch 9.1.1026: filetype: swc configuration files are not recognized Problem: filetype: swc configuration files are not recognized Solution: detect .swcrc files as json filetype (Marces Engel) References: https://swc.rs/docs/configuration/swcrc closes: #16462 Signed-off-by: Marces Engel Signed-off-by: Christian Brabandt --- runtime/filetype.vim | 2 +- src/testdir/test_filetype.vim | 2 +- src/version.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 095114ed39..f9d189f631 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1271,7 +1271,7 @@ au BufNewFile,BufRead *.ipynb,*.jupyterlab-settings setf json au BufNewFile,BufRead *.sublime-project,*.sublime-settings,*.sublime-workspace setf json " Other files that look like json -au BufNewFile,BufRead .prettierrc,.firebaserc,.stylelintrc,.lintstagedrc,flake.lock,deno.lock setf json +au BufNewFile,BufRead .prettierrc,.firebaserc,.stylelintrc,.lintstagedrc,flake.lock,deno.lock,.swcrc setf json " JSONC (JSON with comments) au BufNewFile,BufRead *.jsonc,.babelrc,.eslintrc,.jsfmtrc,bun.lock setf jsonc diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 1a54db9955..a9eac86544 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -397,7 +397,7 @@ def s:GetFilenameChecks(): dict> jq: ['file.jq'], json: ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', '.prettierrc', '.firebaserc', '.stylelintrc', '.lintstagedrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', - 'file.bd', 'file.bda', 'file.xci', 'flake.lock', 'pack.mcmeta', 'deno.lock'], + 'file.bd', 'file.bda', 'file.xci', 'flake.lock', 'pack.mcmeta', 'deno.lock', '.swcrc'], json5: ['file.json5'], jsonc: ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc', 'bun.lock', expand("$HOME/.config/VSCodium/User/settings.json")], jsonl: ['file.jsonl'], diff --git a/src/version.c b/src/version.c index 93f94c1364..46c4818b1c 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1026, /**/ 1025, /**/ From ca307efe486670b76563a4a287bc94dace57fb74 Mon Sep 17 00:00:00 2001 From: Jonathon Date: Fri, 17 Jan 2025 13:37:35 +0100 Subject: [PATCH 38/93] patch 9.1.1027: no sanitize check when running linematch Problem: no sanitize check when running linematch Solution: add sanitize check before applying the linematch algorithm, similar to diff_find_change() (Jonathon) closes: #16446 Signed-off-by: Jonathon Signed-off-by: Christian Brabandt --- src/diff.c | 3 +- src/testdir/dumps/Test_linematch_3diffs2.dump | 20 ++++++++ src/testdir/test_diffmode.vim | 47 +++++++++++++++---- src/version.c | 2 + 4 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 src/testdir/dumps/Test_linematch_3diffs2.dump diff --git a/src/diff.c b/src/diff.c index c348894ec9..41d61b1b56 100644 --- a/src/diff.c +++ b/src/diff.c @@ -2351,7 +2351,8 @@ diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus) // Don't run linematch when lnum is offscreen. Useful for scrollbind // calculations which need to count all the filler lines above the screen. if (lnum >= wp->w_topline && lnum < wp->w_botline - && !dp->is_linematched && diff_linematch(dp)) + && !dp->is_linematched && diff_linematch(dp) + && diff_check_sanity(curtab, dp)) run_linematch_algorithm(dp); if (dp->is_linematched) diff --git a/src/testdir/dumps/Test_linematch_3diffs2.dump b/src/testdir/dumps/Test_linematch_3diffs2.dump new file mode 100644 index 0000000000..3a333e6438 --- /dev/null +++ b/src/testdir/dumps/Test_linematch_3diffs2.dump @@ -0,0 +1,20 @@ +| +0#0000e05#a8a8a8255@1|a+0#0000000#5fd7ff255|b|c|d|q| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1|d+0#0000000#ffd7ff255|e|f| @19||+1&#ffffff0| +0#0000e05#a8a8a8255@1|d+0#0000000#ffd7ff255|e|f|q+2&#ff404010| +0&#ffd7ff255@17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21 +| +0#0000e05#a8a8a8255@1|h+0#0000000#ffd7ff255|i|j|k|l+2&#ff404010|m| +0&#ffd7ff255@16||+1&#ffffff0| +0#0000e05#a8a8a8255@1|h+0#0000000#ffd7ff255|i|j|k| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|h+0#0000000#ffd7ff255|i|j|k|l+2&#ff404010|m| +0&#ffd7ff255@15 +| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@22||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|n+0#0000000#ffd7ff255|o|p|q| @17||+1&#ffffff0| +0#0000e05#a8a8a8255@1|n+0#0000000#ffd7ff255|o|p|q|r+2&#ff404010| +0&#ffd7ff255@16 +| +0#0000e05#a8a8a8255@1> +0#0000000#ffd7ff255@22||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@21||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|s+2#0000000#ff404010|t|u|v| +0&#ffd7ff255@17 +|~+0#4040ff13#ffffff0| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|~| @23||+1#0000000&|~+0#4040ff13&| @22||+1#0000000&|~+0#4040ff13&| @22 +|<+3#0000000&|e|m|a|t|c|h|1| |[|+|]| |4|,|1| @5|A|l@1| |<+1&&|l|i|n|e|m|a|t|c|h|2| |3|,|1| @5|A|l@1| |<|l|i|n|e|m|a|t|c|h|3| |3|,|1| @5|A|l@1 +|-+2&&@1| |I|N|S|E|R|T| |-@1| +0&&@62 diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index 8939bb80c3..36d3d9ba65 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -1265,7 +1265,7 @@ func CloseoffSetup() call setline(1, ['one', 'tow', 'three']) diffthis call assert_equal(1, &diff) - only! + bw! endfunc func Test_diff_closeoff() @@ -2529,7 +2529,8 @@ func Test_diffget_diffput_linematch() call term_sendkeys(buf, "17gg") call term_sendkeys(buf, ":diffput\") call VerifyScreenDump(buf, 'Test_diff_get_put_linematch_19', {}) - + " clean up + call StopVimInTerminal(buf) endfunc func Test_linematch_diff() @@ -2549,7 +2550,8 @@ func Test_linematch_diff() \ 'abc d!', \ 'd!']) call VerifyScreenDump(buf, 'Test_linematch_diff1', {}) - + " clean up + call StopVimInTerminal(buf) endfunc func Test_linematch_diff_iwhite() @@ -2575,7 +2577,8 @@ func Test_linematch_diff_iwhite() call VerifyScreenDump(buf, 'Test_linematch_diff_iwhite1', {}) call term_sendkeys(buf, ":set diffopt+=iwhiteall\") call VerifyScreenDump(buf, 'Test_linematch_diff_iwhite2', {}) - + " clean up + call StopVimInTerminal(buf) endfunc func Test_linematch_diff_grouping() @@ -2612,7 +2615,8 @@ func Test_linematch_diff_grouping() \ '?C', \ '?C']) call VerifyScreenDump(buf, 'Test_linematch_diff_grouping2', {}) - + " clean up + call StopVimInTerminal(buf) endfunc func Test_linematch_diff_scroll() @@ -2643,11 +2647,10 @@ func Test_linematch_diff_scroll() call VerifyScreenDump(buf, 'Test_linematch_diff_grouping_scroll1', {}) call term_sendkeys(buf, "3\") call VerifyScreenDump(buf, 'Test_linematch_diff_grouping_scroll2', {}) - + " clean up + call StopVimInTerminal(buf) endfunc - - func Test_linematch_line_limit_exceeded() CheckScreendump call delete('.Xdifile1.swp') @@ -2694,7 +2697,8 @@ func Test_linematch_line_limit_exceeded() " alignment algorithm will run on the largest diff block here call term_sendkeys(buf, ":set diffopt+=linematch:30\") call VerifyScreenDump(buf, 'Test_linematch_line_limit_exceeded2', {}) - + " clean up + call StopVimInTerminal(buf) endfunc func Test_linematch_3diffs() @@ -2731,6 +2735,31 @@ func Test_linematch_3diffs() \ " BBB", \ " BBB"]) call VerifyScreenDump(buf, 'Test_linematch_3diffs1', {}) + " clean up + call StopVimInTerminal(buf) +endfunc +" this used to access invalid memory +func Test_linematch_3diffs_sanity_check() + CheckScreendump + call delete('.Xfile_linematch1.swp') + call delete('.Xfile_linematch2.swp') + call delete('.Xfile_linematch3.swp') + let lines =<< trim END + set diffopt+=linematch:60 + call feedkeys("Aq\") + call feedkeys("GAklm\") + call feedkeys("o") + END + call writefile(lines, 'Xlinematch_3diffs.vim', 'D') + call writefile(['abcd', 'def', 'hij'], 'Xfile_linematch1', 'D') + call writefile(['defq', 'hijk', 'nopq'], 'Xfile_linematch2', 'D') + call writefile(['hijklm', 'nopqr', 'stuv'], 'Xfile_linematch3', 'D') + call WriteDiffFiles3(0, [], [], []) + let buf = RunVimInTerminal('-d -S Xlinematch_3diffs.vim Xfile_linematch1 Xfile_linematch2 Xfile_linematch3', {}) + call VerifyScreenDump(buf, 'Test_linematch_3diffs2', {}) + + " clean up + call StopVimInTerminal(buf) endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 46c4818b1c..d6b73fd792 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1027, /**/ 1026, /**/ From c15de972e8131def2f506bb9eb6b306ca089629c Mon Sep 17 00:00:00 2001 From: John Marriott Date: Fri, 17 Jan 2025 13:54:49 +0100 Subject: [PATCH 39/93] patch 9.1.1028: too many strlen() calls in screen.c Problem: too many strlen() calls in screen.c Solution: refactor screen.c and remove calls to strlen(), verify that leadmultispace != NULL (John Marriott) closes: #16460 Signed-off-by: John Marriott Signed-off-by: Christian Brabandt --- src/screen.c | 133 ++++++++++++++++++++++++++------------------------ src/version.c | 2 + 2 files changed, 71 insertions(+), 64 deletions(-) diff --git a/src/screen.c b/src/screen.c index 8fb17ae87a..b4476c2674 100644 --- a/src/screen.c +++ b/src/screen.c @@ -240,13 +240,10 @@ win_draw_end( int compute_foldcolumn(win_T *wp, int col) { - int fdc = wp->w_p_fdc; int wmw = wp == curwin && p_wmw == 0 ? 1 : p_wmw; - int wwidth = wp->w_width; + int n = wp->w_width - (col + wmw); - if (fdc > wwidth - (col + wmw)) - fdc = wwidth - (col + wmw); - return fdc; + return MIN(wp->w_p_fdc, n); } /* @@ -271,6 +268,7 @@ fill_foldcolumn( size_t byte_counter = 0; int symbol = 0; int len = 0; + int n; // Init to all spaces. vim_memset(p, ' ', MAX_MCO * fdc + 1); @@ -284,7 +282,8 @@ fill_foldcolumn( if (first_level < 1) first_level = 1; - for (i = 0; i < MIN(fdc, level); i++) + n = MIN(fdc, level); // evaluate this once + for (i = 0; i < n; i++) { if (win_foldinfo.fi_lnum == lnum && first_level + i >= win_foldinfo.fi_low_level) @@ -1120,7 +1119,7 @@ win_redr_custom( // might change the option value and free the memory. stl = vim_strsave(stl); width = build_stl_str_hl(ewp, buf, sizeof(buf), - stl, opt_name, opt_scope, + (stl == NULL) ? (char_u *)"" : stl, opt_name, opt_scope, fillchar, maxwidth, &hltab, &tabtab); vim_free(stl); ewp->w_p_crb = p_crb_save; @@ -1129,12 +1128,13 @@ win_redr_custom( p = transstr(buf); if (p != NULL) { - vim_strncpy(buf, p, sizeof(buf) - 1); + len = vim_snprintf((char *)buf, sizeof(buf), "%s", p); vim_free(p); } + else + len = (int)STRLEN(buf); // fill up with "fillchar" - len = (int)STRLEN(buf); while (width < maxwidth && len < (int)sizeof(buf) - 1) { len += (*mb_char2bytes)(fillchar, buf + len); @@ -4368,8 +4368,7 @@ draw_tabline(void) { if (wincount > 1) { - vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount); - len = (int)STRLEN(NameBuff); + len = vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount); if (col + len >= Columns - 3) break; screen_puts_len(NameBuff, len, 0, col, @@ -4389,6 +4388,8 @@ draw_tabline(void) room = scol - col + tabwidth - 1; if (room > 0) { + int n; + // Get buffer name in NameBuff[] get_trans_bufname(cwp->w_buffer); shorten_dir(NameBuff); @@ -4405,8 +4406,9 @@ draw_tabline(void) p += len - room; len = room; } - if (len > Columns - col - 1) - len = Columns - col - 1; + n = Columns - col - 1; + if (len > n) + len = n; screen_puts_len(p, (int)STRLEN(p), 0, col, attr); col += len; @@ -4429,7 +4431,8 @@ draw_tabline(void) // Draw the 'showcmd' information if 'showcmdloc' == "tabline". if (p_sc && *p_sloc == 't') { - int width = MIN(10, (int)Columns - col - (tabcount > 1) * 3); + int n = (int)Columns - col - (tabcount > 1) * 3; + int width = MIN(10, n); if (width > 0) screen_puts_len(showcmd_buf, width, 0, (int)Columns @@ -4687,44 +4690,48 @@ get_encoded_char_adv(char_u **p) struct charstab { int *cp; - char *name; + string_T name; }; + +#define CHARSTAB_ENTRY(cp, name) \ + {(cp), {(char_u *)(name), STRLEN_LITERAL(name)}} + static fill_chars_T fill_chars; static struct charstab filltab[] = { - {&fill_chars.stl, "stl"}, - {&fill_chars.stlnc, "stlnc"}, - {&fill_chars.vert, "vert"}, - {&fill_chars.fold, "fold"}, - {&fill_chars.foldopen, "foldopen"}, - {&fill_chars.foldclosed, "foldclose"}, - {&fill_chars.foldsep, "foldsep"}, - {&fill_chars.diff, "diff"}, - {&fill_chars.eob, "eob"}, - {&fill_chars.lastline, "lastline"}, + CHARSTAB_ENTRY(&fill_chars.stl, "stl"), + CHARSTAB_ENTRY(&fill_chars.stlnc, "stlnc"), + CHARSTAB_ENTRY(&fill_chars.vert, "vert"), + CHARSTAB_ENTRY(&fill_chars.fold, "fold"), + CHARSTAB_ENTRY(&fill_chars.foldopen, "foldopen"), + CHARSTAB_ENTRY(&fill_chars.foldclosed, "foldclose"), + CHARSTAB_ENTRY(&fill_chars.foldsep, "foldsep"), + CHARSTAB_ENTRY(&fill_chars.diff, "diff"), + CHARSTAB_ENTRY(&fill_chars.eob, "eob"), + CHARSTAB_ENTRY(&fill_chars.lastline, "lastline") }; static lcs_chars_T lcs_chars; static struct charstab lcstab[] = { - {&lcs_chars.eol, "eol"}, - {&lcs_chars.ext, "extends"}, - {&lcs_chars.nbsp, "nbsp"}, - {&lcs_chars.prec, "precedes"}, - {&lcs_chars.space, "space"}, - {&lcs_chars.tab2, "tab"}, - {&lcs_chars.trail, "trail"}, - {&lcs_chars.lead, "lead"}, + CHARSTAB_ENTRY(&lcs_chars.eol, "eol"), + CHARSTAB_ENTRY(&lcs_chars.ext, "extends"), + CHARSTAB_ENTRY(&lcs_chars.nbsp, "nbsp"), + CHARSTAB_ENTRY(&lcs_chars.prec, "precedes"), + CHARSTAB_ENTRY(&lcs_chars.space, "space"), + CHARSTAB_ENTRY(&lcs_chars.tab2, "tab"), + CHARSTAB_ENTRY(&lcs_chars.trail, "trail"), + CHARSTAB_ENTRY(&lcs_chars.lead, "lead"), #ifdef FEAT_CONCEAL - {&lcs_chars.conceal, "conceal"}, + CHARSTAB_ENTRY(&lcs_chars.conceal, "conceal"), #else - {NULL, "conceal"}, + CHARSTAB_ENTRY(NULL, "conceal"), #endif - {NULL, "multispace"}, - {NULL, "leadmultispace"}, + CHARSTAB_ENTRY(NULL, "multispace"), + CHARSTAB_ENTRY(NULL, "leadmultispace") }; static char * -field_value_err(char *errbuf, size_t errbuflen, char *fmt, char *field) +field_value_err(char *errbuf, size_t errbuflen, char *fmt, char_u *field) { if (errbuf == NULL) return ""; @@ -4744,7 +4751,7 @@ field_value_err(char *errbuf, size_t errbuflen, char *fmt, char *field) set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, char *errbuf, size_t errbuflen) { - int round, i, len, entries; + int round, i, entries; char_u *p, *s; int c1 = 0, c2 = 0, c3 = 0; char_u *last_multispace = NULL; // Last occurrence of "multispace:" @@ -4767,7 +4774,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, tab = filltab; entries = ARRAY_LENGTH(filltab); if (wp->w_p_fcs[0] == NUL) - value = p_fcs; // local value is empty, us the global value + value = p_fcs; // local value is empty, use the global value } // first round: check for valid value, second round: assign values @@ -4797,7 +4804,8 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, { lcs_chars.leadmultispace = ALLOC_MULT(int, lead_multispace_len + 1); - lcs_chars.leadmultispace[lead_multispace_len] = NUL; + if (lcs_chars.leadmultispace != NULL) + lcs_chars.leadmultispace[lead_multispace_len] = NUL; } else lcs_chars.leadmultispace = NULL; @@ -4821,13 +4829,12 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, { for (i = 0; i < entries; ++i) { - len = (int)STRLEN(tab[i].name); - if (!(STRNCMP(p, tab[i].name, len) == 0 && p[len] == ':')) + if (!(STRNCMP(p, tab[i].name.string, tab[i].name.length) == 0 && p[tab[i].name.length] == ':')) continue; - if (is_listchars && strcmp(tab[i].name, "multispace") == 0) + s = p + tab[i].name.length + 1; + if (is_listchars && STRCMP(tab[i].name.string, "multispace") == 0) { - s = p + len + 1; if (round == 0) { // Get length of lcs-multispace string in first round @@ -4839,14 +4846,14 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, if (char2cells(c1) > 1) return field_value_err(errbuf, errbuflen, e_wrong_character_width_for_field_str, - tab[i].name); + tab[i].name.string); ++multispace_len; } if (multispace_len == 0) // lcs-multispace cannot be an empty string return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, - tab[i].name); + tab[i].name.string); p = s; } else @@ -4856,7 +4863,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, while (*s != NUL && *s != ',') { c1 = get_encoded_char_adv(&s); - if (p == last_multispace) + if (p == last_multispace && lcs_chars.multispace != NULL) lcs_chars.multispace[multispace_pos++] = c1; } p = s; @@ -4864,9 +4871,8 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, break; } - if (is_listchars && strcmp(tab[i].name, "leadmultispace") == 0) + if (is_listchars && STRCMP(tab[i].name.string, "leadmultispace") == 0) { - s = p + len + 1; if (round == 0) { // get length of lcs-leadmultispace string in first @@ -4879,14 +4885,14 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, if (char2cells(c1) > 1) return field_value_err(errbuf, errbuflen, e_wrong_character_width_for_field_str, - tab[i].name); + tab[i].name.string); ++lead_multispace_len; } if (lead_multispace_len == 0) // lcs-leadmultispace cannot be an empty string return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, - tab[i].name); + tab[i].name.string); p = s; } else @@ -4896,7 +4902,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, while (*s != NUL && *s != ',') { c1 = get_encoded_char_adv(&s); - if (p == last_lmultispace) + if (p == last_lmultispace && lcs_chars.leadmultispace != NULL) lcs_chars.leadmultispace[multispace_pos++] = c1; } p = s; @@ -4905,34 +4911,33 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, } c2 = c3 = 0; - s = p + len + 1; if (*s == NUL) return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, - tab[i].name); + tab[i].name.string); c1 = get_encoded_char_adv(&s); if (char2cells(c1) > 1) return field_value_err(errbuf, errbuflen, e_wrong_character_width_for_field_str, - tab[i].name); + tab[i].name.string); if (tab[i].cp == &lcs_chars.tab2) { if (*s == NUL) return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, - tab[i].name); + tab[i].name.string); c2 = get_encoded_char_adv(&s); if (char2cells(c2) > 1) return field_value_err(errbuf, errbuflen, e_wrong_character_width_for_field_str, - tab[i].name); + tab[i].name.string); if (!(*s == ',' || *s == NUL)) { c3 = get_encoded_char_adv(&s); if (char2cells(c3) > 1) return field_value_err(errbuf, errbuflen, e_wrong_character_width_for_field_str, - tab[i].name); + tab[i].name.string); } } @@ -4956,7 +4961,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply, else return field_value_err(errbuf, errbuflen, e_wrong_number_of_characters_for_field_str, - tab[i].name); + tab[i].name.string); } if (i == entries) @@ -5011,10 +5016,10 @@ set_listchars_option(win_T *wp, char_u *val, int apply, char *errbuf, char_u * get_fillchars_name(expand_T *xp UNUSED, int idx) { - if (idx >= (int)(sizeof(filltab) / sizeof(filltab[0]))) + if (idx < 0 || idx >= (int)ARRAY_LENGTH(filltab)) return NULL; - return (char_u*)filltab[idx].name; + return filltab[idx].name.string; } /* @@ -5024,10 +5029,10 @@ get_fillchars_name(expand_T *xp UNUSED, int idx) char_u * get_listchars_name(expand_T *xp UNUSED, int idx) { - if (idx >= (int)(sizeof(lcstab) / sizeof(lcstab[0]))) + if (idx < 0 || idx >= (int)ARRAY_LENGTH(lcstab)) return NULL; - return (char_u*)lcstab[idx].name; + return lcstab[idx].name.string; } /* diff --git a/src/version.c b/src/version.c index d6b73fd792..624147ca7a 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1028, /**/ 1027, /**/ From 2730d3873f222876cdd7459772fef6d935c23783 Mon Sep 17 00:00:00 2001 From: RestorerZ Date: Fri, 17 Jan 2025 14:04:44 +0100 Subject: [PATCH 40/93] patch 9.1.1029: the installer can be improved Problem: the installer can be improved Solution: update the installer with the correct README and LICENSE files, improve the documentation, add a Makefile for the installer, update the Makefiles (RestorerZ) fixes: #16378 closes: #16378 Signed-off-by: RestorerZ Signed-off-by: Christian Brabandt --- CONTRIBUTING.md | 4 +- Filelist | 8 +- Makefile | 59 ++--- lang/{LICENSE.itx => LICENSE.it.txt} | 0 lang/LICENSE.ru.txt | 109 +++++++++ lang/{README.itx => README.it.txt} | 0 README.rux.txt => lang/README.ru.txt | 2 +- nsis/Make_mvc.mak | 134 +++++++++++ nsis/Makefile | 95 ++++++++ nsis/README.txt | 100 ++++---- nsis/gvim.nsi | 143 +++--------- nsis/gvim_version.nsh | 1 + nsis/lang/README.txt | 10 +- nsis/lang/danish.nsi | 6 +- nsis/lang/dutch.nsi | 6 +- nsis/lang/english.nsi | 2 +- nsis/lang/german.nsi | 6 +- nsis/lang/greek.nsi | 6 +- nsis/lang/italian.nsi | 6 +- nsis/lang/japanese.nsi | 6 +- nsis/lang/russian.nsi | 4 +- nsis/lang/serbian.nsi | 6 +- nsis/lang/simpchinese.nsi | 6 +- nsis/lang/tradchinese.nsi | 6 +- nsis/lang/turkish.nsi | 6 +- runtime/doc/Make_mvc.mak | 17 +- runtime/doc/Makefile | 10 - runtime/doc/uganda.rux | 337 --------------------------- src/GvimExt/gvimext.inf | 2 +- src/Makefile | 36 ++- src/version.c | 2 + tools/rename.bat | 77 +++--- 32 files changed, 591 insertions(+), 621 deletions(-) rename lang/{LICENSE.itx => LICENSE.it.txt} (100%) create mode 100644 lang/LICENSE.ru.txt rename lang/{README.itx => README.it.txt} (100%) rename README.rux.txt => lang/README.ru.txt (99%) create mode 100644 nsis/Make_mvc.mak create mode 100644 nsis/Makefile delete mode 100644 runtime/doc/uganda.rux diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 99bfcfa2c8..17bb9b307d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -79,7 +79,7 @@ can be translated: * Menus, see [runtime/lang/README.txt][2] * Vim tutor, see [runtime/tutor/README.txt][3] * Manual pages, see [runtime/doc/\*.1][4] for examples -* Installer, see [nsis/lang/\*.nsi][5] for examples +* Installer, see [nsis/lang/README.txt][5] The help files can be translated and made available separately. See https://www.vim.org/translations.php for examples. @@ -103,7 +103,7 @@ mailing list. For other questions please use the [Vi Stack Exchange][8] website, [2]: https://github.com/vim/vim/blob/master/runtime/lang/README.txt [3]: https://github.com/vim/vim/blob/master/runtime/tutor/README.txt [4]: https://github.com/vim/vim/blob/master/runtime/doc/vim.1 -[5]: https://github.com/vim/vim/blob/master/nsis/lang/english.nsi +[5]: https://github.com/vim/vim/blob/master/nsis/lang/README.txt [6]: https://github.com/vim/vim/discussions/13087 [7]: https://github.com/vim/vim/blob/master/runtime/doc/develop.txt [8]: https://vi.stackexchange.com diff --git a/Filelist b/Filelist index 25ffa626bc..8e12302e18 100644 --- a/Filelist +++ b/Filelist @@ -609,6 +609,8 @@ SRC_DOS = \ src/xxd/Make_mvc.mak \ nsis/gvim.nsi \ nsis/gvim_version.nsh \ + nsis/Makefile \ + nsis/Make_mvc.mak \ nsis/README.txt \ nsis/lang/*.nsi \ nsis/lang/README.txt \ @@ -710,8 +712,6 @@ RT_ALL = \ README_VIM9.md \ LICENSE \ CONTRIBUTING.md \ - lang/LICENSE.itx \ - lang/README.itx \ runtime/bugreport.vim \ runtime/doc/*.awk \ runtime/doc/*.pl \ @@ -1043,7 +1043,8 @@ IN_README_DIR = \ # Generic language files. LANG_GEN = \ - README.??x.txt \ + lang/README.*.txt \ + lang/LICENSE.*.txt \ runtime/doc/*-da.1 \ runtime/doc/*-da.UTF-8.1 \ runtime/doc/*-de.1 \ @@ -1059,7 +1060,6 @@ LANG_GEN = \ runtime/doc/*-ru.UTF-8.1 \ runtime/doc/*-tr.1 \ runtime/doc/*-tr.UTF-8.1 \ - runtime/doc/uganda.??x \ runtime/lang/README.txt \ runtime/lang/Makefile \ runtime/lang/Make_all.mak \ diff --git a/Makefile b/Makefile index fddf33c930..3151c24aa8 100644 --- a/Makefile +++ b/Makefile @@ -96,8 +96,14 @@ syntaxtest: # To do all this you need the Unix archive and compiled binaries. # Before creating an archive first delete all backup files, *.orig, etc. -MAJOR = 9 -MINOR = 1 +# I think it is better to place getting the current version number in the +# configure script. And then automatically fill in the fields in the files +# listed below. (Restorer) + +MAJOR != grep -E 'VIM_VERSION_MAJOR\s{2,}' src/version.h | \ + awk '{ printf "%d",$$3 }' +MINOR != grep -E 'VIM_VERSION_MINOR\s{2,}' src/version.h | \ + awk '{ printf "%d",$$3 }' # CHECKLIST for creating a new version: # @@ -161,12 +167,12 @@ MINOR = 1 # - See src/INSTALLpc.txt for installing the compiler and SDK. # - Set environment for Visual C++ 2015: # > cd src -# > msvc2015.bat +# > msvc-latest.bat # - Build the console binary: -# > nmake -f Make_mvc.mak +# > nmake.exe -f Make_mvc.mak # - Run the tests and check the output: -# > nmake -f Make_mvc.mak testclean -# > nmake -f Make_mvc.mak test +# > nmake.exe -f Make_mvc.mak testclean +# > nmake.exe -f Make_mvc.mak test # - Rename (using ../tools/rename.bat): # vim.exe to vimw32.exe # tee/tee.exe to teew32.exe @@ -176,10 +182,10 @@ MINOR = 1 # uninstall.exe to uninstallw32.exe # Win32 GUI version build: # - > cd src -# > nmake -f Make_mvc.mak GUI=yes +# > nmake.exe -f Make_mvc.mak "GUI=yes" # - Run the tests and check the output: -# > nmake -f Make_mvc.mak testclean -# > nmake -f Make_mvc.mak testgvim +# > nmake.exe -f Make_mvc.mak testclean +# > nmake.exe -f Make_mvc.mak testgvim # - move "gvim.exe" to here (otherwise the OLE version will overwrite it). # - Move gvim.pdb to here. # - Copy "GvimExt/gvimext.dll" to here. @@ -191,8 +197,8 @@ MINOR = 1 # > cd src # > bigvim.bat # - Run the tests: -# > nmake -f Make_mvc.mak testclean -# > nmake -f Make_mvc.mak testgvim +# > nmake.exe -f Make_mvc.mak testclean +# > nmake.exe -f Make_mvc.mak testgvim # - check the output. # - Rename "gvim.exe" to "gvim_ole.exe". # - Rename gvim.pdb to "gvim_ole.pdb". @@ -216,9 +222,9 @@ MINOR = 1 # - Make sure there is a diff.exe two levels up (get it from a previous Vim # version). Also put winpty32.dll and winpty-agent.exe there. # - go to ../nsis and do: -# > unzip icons.zip -# > makensis gvim.nsi (takes a few minutes). -# ignore warning for libwinpthread-1.dll +# > nmake.exe -f Make_mvc.mak all +# (takes a few minutes). +# See nsis/README.txt for details. # - Copy gvim##.exe to the dist directory. # # 64 bit builds (these are not in the normal distribution, the 32 bit build @@ -226,9 +232,9 @@ MINOR = 1 # Like the console and GUI version, but first run vcvars64.bat or # "..\VC\vcvarsall.bat x86_amd64". # - Build the console version: -# > nmake -f Make_mvc.mak +# > nmake.exe -f Make_mvc.mak # - Build the GUI version: -# > nmake -f Make_mvc.mak GUI=yes +# > nmake.exe -f Make_mvc.mak "GUI=yes" # - Build the OLE version with interfaces: # > bigvim64.bat # @@ -266,8 +272,8 @@ dist: # Clean up some files to avoid they are included. # Copy README files to the top directory. prepare: - if test -f runtime/doc/uganda.nsis.txt; then \ - rm runtime/doc/uganda.nsis.???; fi + if test -f lang/LICENSE.nsis.txt; then \ + rm -f lang/LICENSE*.nsis.txt; fi for name in $(IN_README_DIR); do \ cp READMEdir/"$$name" .; \ done @@ -408,8 +414,7 @@ amisrc: dist prepare mv dist/vim$(VERSION)src.tar.gz dist/vim$(VERSION)src.tgz # MS-DOS sources -dossrc: dist dist/$(COMMENT_SRC) runtime/doc/uganda.nsis.txt \ - nsis/gvim_version.nsh +dossrc: dist dist/$(COMMENT_SRC) license nsis/gvim_version.nsh -rm -rf dist/vim$(VERSION)src.zip -rm -rf dist/vim mkdir dist/vim @@ -420,23 +425,19 @@ dossrc: dist dist/$(COMMENT_SRC) runtime/doc/uganda.nsis.txt \ $(SRC_DOS_BIN) \ $(SRC_AMI_DOS) \ $(SRC_DOS_UNIX) \ - runtime/doc/uganda.nsis.??? \ + lang/LICENSE.*.txt \ + lang/README.*.txt \ nsis/gvim_version.nsh \ | (cd dist/vim/$(VIMRTDIR); tar xf -) mv dist/vim/$(VIMRTDIR)/runtime/* dist/vim/$(VIMRTDIR) rmdir dist/vim/$(VIMRTDIR)/runtime cd dist && zip -9 -rD -z vim$(VERSION)src.zip vim <$(COMMENT_SRC) -runtime/doc/uganda.nsis.txt: runtime/doc/uganda.??? - cd runtime/doc && $(MAKE) uganda.nsis.txt +license: + cd nsis && $(MAKE) -f Makefile $@ nsis/gvim_version.nsh: Makefile - echo "# Generated from Makefile: define the version numbers" > $@ - echo "!ifndef __GVIM_VER__NSH__" >> $@ - echo "!define __GVIM_VER__NSH__" >> $@ - echo "!define VER_MAJOR $(MAJOR)" >> $@ - echo "!define VER_MINOR $(MINOR)" >> $@ - echo "!endif" >> $@ + cd nsis && $(MAKE) -f Makefile $(@F) dosrt: dist dist/$(COMMENT_RT) dosrt_files -rm -rf dist/vim$(VERSION)rt.zip diff --git a/lang/LICENSE.itx b/lang/LICENSE.it.txt similarity index 100% rename from lang/LICENSE.itx rename to lang/LICENSE.it.txt diff --git a/lang/LICENSE.ru.txt b/lang/LICENSE.ru.txt new file mode 100644 index 0000000000..ba9deae972 --- /dev/null +++ b/lang/LICENSE.ru.txt @@ -0,0 +1,109 @@ +ЛИЦЕНЗИЯ VIM + +I) Неизменённые копии программы Vim могут распространяться без ограничения + при условии включения данного текста лицензии. Распространение + неизменённых копий отдельных частей программы Vim также возможно + при соблюдении условия о включении данного текста лицензии. Подобным + образом разрешается добавлять исполняемые файлы, скомпилированные + из неизменённого исходного кода программы Vim, а также собственные + примеры использования и командные файлы редактора Vim. + +II) Изменённую (или дополненную) версию программы Vim, включающую + исполняемые файлы и/или исходный код, допускается распространять + при соблюдении следующих четырёх условий: + 1) Текст настоящей лицензии должен включаться в состав распространяемой + версии программы Vim без изменений. + 2) Изменённая версия программы Vim должна распространяться одним + из следующих пяти способов: + a) При внесении изменений в программу Vim, в дистрибутиве должны + быть явно указаны контактные данные лица, внёсшего эти изменения. + Ответственному разработчику по его запросу (в любой форме) должна + быть безвозмездно предоставлена копия распространяемой изменённой + версии программы Vim, включая её исходный код. Ответственный + разработчик оставляет за собой право включать сделанные изменения + в официальную версию программы Vim. Конкретные действия + ответственного разработчика, относительно переданных изменений, + а также лицензионные условия, на основании которых будет + осуществляться их распространение, могут быть дополнительно + согласованы. Если согласование не проводилось, сделанные изменения + будут распространяться на условиях настоящей лицензии или более + поздней её версии. Лица, в данное время являющиеся ответственными + за разработку, указаны в перечне, размещённом по адресу: + https://github.com/orgs/vim/people. В случае изменения этой + информации, актуальные данные будут опубликованы на + соответствующих ресурсах (вероятнее всего по интернет‐адресам + vim.sf.net, www.vim.org и/или comp.editors). В случае полной + невозможности установить контакт с ответственным разработчиком, + обязательства по отправке изменений утрачивают силу. После + передачи подтверждения о получении изменений от ответственного + разработчика, необходимость в повторной отправке копии изменённой + программы Vim неприменима. + b) Если лицом получена изменённая версия программа Vim, + распространяющаяся на условиях, указанных в ч. II) п. 2) пп. а) + допускается дальнейшее её распространение этим лицом без внесения + изменений и согласно ч. I) настоящей лицензии. В случае внесения + дополнительных изменений, на эти изменения будут распространяться + условия, указанные в ч. II) п. 2) пп. a). + c) Каждая копия распространяемой изменённой версии программы Vim + должна включать информацию обо всех произведённых изменениях, + включая исходный код. Эта информация может быть представлена + в виде построчного сравнения файлов. Выбор лицензии, по условиям + которой будет распространяться добавленный код, остаётся + за автором этих изменений. Изменения и лицензия на эти изменения + не должны запрещать другим лицам внесение своих собственных + изменений в официальную версию программы Vim. + d) Изменённая версия программы Vim, содержащая изменения в + соответствии с ч. II) п. 2 пп. c), может распространяться без + исходного кода для этих изменений, при соблюдении следующих трёх + условий: + - Лицензия, применяемая к внесённым изменениям, предоставляет + ответственному разработчику программы Vim возможность + безвозмездного и неограниченного распространения этих изменений, + а также право на безвозмездное и неограниченное включение этих + изменений в официальную версию программы Vim. + - Изменения должны сохраняться не менее трёх лет со времени + распространения соответствующей изменённой версии программы Vim. + В течение этого периода по запросу ответственного разработчика + или другого пользователя изменённой версии программы Vim + (в любой форме) необходимо предоставить исходный код данных + изменений. + - В дистрибутиве изменённой версии программы Vim должны быть явно + указаны контактные данные лица, внёсшего эти изменения. + Контактные данные должны сохранять актуальность в течение + не менее трёх лет со времени последнего распространения + соответствующей изменённой версии программы Vim или как можно + дольше. + e) Если к изменениям, внесённым в программу Vim, применимы условия + лицензии GNU General Public License (GNU GPL), допускается + распространение изменённой версия программы Vim на условиях + лицензии GNU GPL версии 2 или любой более поздней версии этой + лицензии. + 3) Необходимо добавить соответствующую информацию, которая должна быть + выведена в результате выполнения команды ":version" в программе Vim, + а также на экране приветствия программы Vim, чтобы пользователь + изменённой версии программы Vim имел возможность определить, + что он пользуется изменённой версией. При распространении + на условиях, указанных в ч. II) п. 2) пп. e) такую информацию + требуется добавлять только в том случае, когда она не противоречит + лицензии, распространяющейся на эти изменения. + 4) Контактная информация, которая указывается по требованию ч. II) п. 2) + пп. a) и ч. II) п. 2) пп. d) не должна удаляться или изменяться никем + другим, кроме лица, указавшего данную контактную информацию. + +III) При распространении изменённой версии программы Vim рекомендуется + пользоваться лицензией Vim для произведённых изменений и обеспечить + доступ к этим изменениям ответственного разработчика, включая исходный + код изменений. Предпочтительным способом предоставления доступа + к произведённым изменениям является отправка этих изменений через + электронную почту или размещение файлов на сервер с отправкой + URL-адреса по электронной почте. Если количество изменений + незначительно (например, изменения в файле Makefile), достаточно будет + отправить через электронную почту файл построчного сравнения. Изменения + или URL-адреса должны быть направлены на адрес электронной почты + maintainer@vim.org + +IV) Не допускается удаление настоящей лицензия из дистрибутива исходного + кода программы Vim, его отдельных частей или изменённой версии. + Допускается использование настоящей лицензию для предыдущих + изменённых выпусков программы Vim, взамен тех лицензий, с которыми + они распространялись. diff --git a/lang/README.itx b/lang/README.it.txt similarity index 100% rename from lang/README.itx rename to lang/README.it.txt diff --git a/README.rux.txt b/lang/README.ru.txt similarity index 99% rename from README.rux.txt rename to lang/README.ru.txt index be909280c8..a2a29db45b 100644 --- a/README.rux.txt +++ b/lang/README.ru.txt @@ -1,4 +1,4 @@ -README.rux.txt для версии 9.1 программы Vim — Vi IMproved. +README.ru.txt для версии 9.1 программы Vim — Vi IMproved. ЧТО ТАКОЕ РЕДАКТОР VIM? diff --git a/nsis/Make_mvc.mak b/nsis/Make_mvc.mak new file mode 100644 index 0000000000..c5aff151b9 --- /dev/null +++ b/nsis/Make_mvc.mak @@ -0,0 +1,134 @@ +# +# Makefile for MS Windows for create self-installing exe of Vim. +# 05/04/2024, Restorer restorer@mail2k.ru +# + + +#!INCLUDE .\Make_all.mak + +.SUFFIXES : + +!IFDEF PROGRAMW6432 +ProgFiles=%%PROGRAMFILES(x86)%% +!ELSE +ProgFiles=$(PROGRAMFILES) +!ENDIF + +!IFDEF VIMSRC +MKNSISFLAGS = /D"VIMSRC=$(VIMSRC)" +!ENDIF + +!IFDEF VIMRT +MKNSISFLAGS = $(MKNSISFLAGS) /D"VIMRT=$(VIMRT)" +!ENDIF + +!IFDEF VIMTOOLS +MKNSISFLAGS = $(MKNSISFLAGS) /D"VIMTOOLS=$(VIMTOOLS)" +!ENDIF + +!IFDEF GETTEXT +MKNSISFLAGS = $(MKNSISFLAGS) /D"GETTEXT=$(GETTEXT)" +!ENDIF + +!IFDEF HAVE_UPX +MKNSISFLAGS = $(MKNSISFLAGS) /DHAVE_UPX=$(HAVE_UPX) +!ENDIF + +!IFDEF HAVE_NLS +MKNSISFLAGS = $(MKNSISFLAGS) /DHAVE_NLS=$(HAVE_NLS) +!ENDIF + +!IFDEF HAVE_MULTI_LANG +MKNSISFLAGS = $(MKNSISFLAGS) /DHAVE_MULTI_LANG=$(HAVE_MULTI_LANG) +!ENDIF + +!IFDEF WIN64 +MKNSISFLAGS = $(MKNSISFLAGS) /DWIN64=$(WIN64) +!ENDIF + +!IFDEF INCLUDE_LIBGCC +MKNSISFLAGS = $(MKNSISFLAGS) /DINCLUDE_LIBGCC=$(INCLUDE_LIBGCC) +!ENDIF + +!IFDEF X +XX = /X"$(X:;=" /X")" +!ENDIF + +# If necessary, correct the full path of the NSIS compiler in the next line. +# Please do not enclose the path in quotation marks. +MKNSIS = $(ProgFiles)\NSIS + +PS = powershell.exe +RM = del /f /q +RD = rmdir /s /q + +MKNSISFLAGS = /INPUTCHARSET UTF8 $(MKNSISFLAGS) +PSFLAGS = -NoLogo -NoProfile -Command + +# Read MAJOR and MINOR from version.h. +!IF ![for /F "tokens=2,3" %G in ( \ + 'findstr /rc:"VIM_VERSION_MINOR[ ^]*[0-9^]" \ + /rc:"VIM_VERSION_MAJOR[ ^]*[0-9^]" ..\src\version.h') do \ + @if "VIM_VERSION_MAJOR"=="%G" (echo MAJOR=%H>>_ver.tmp) \ + else echo MINOR=%H>>_ver.tmp] +! INCLUDE .\_ver.tmp +! IF [$(RM) .\_ver.tmp] +! ENDIF +!ENDIF + +# Read PATCHLEVEL from version.c +!IF ![for /F %G in ( \ + 'findstr /nblc:"static int included_patches[^]" ..\src\version.c \ + ^| (set /p "_t=" ^& set /a _t+=2 ^)') do \ + @cmd /q /c "for /F "skip=%G delims=, " %H in (..\src\version.c) do \ + (echo PATCH=%H>_patchlvl.tmp & exit /b)"] +! INCLUDE .\_patchlvl.tmp +! IF [$(RM) .\_patchlvl.tmp] +! ENDIF +!ENDIF +!IF $(PATCH) < 10 +PATCH = 000$(PATCH) +!ELSEIF $(PATCH) < 100 +PATCH = 00$(PATCH) +!ELSEIF $(PATCH) < 1000 +PATCH = 0$(PATCH) +!ENDIF + + +all : makeinst + +makeinst : prepare + ^"$(MKNSIS)\makensis.exe" $(MKNSISFLAGS) gvim.nsi $(XX) + +prepare : unzipicons gvim_version.nsh license rename + +unzipicons : icons.zip + @ if exist %|fF\nul $(RD) %|fF + @ $(PS) $(PSFLAGS) \ + Add-Type -AssemblyName 'System.IO.Compression.FileSystem'; \ + [System.IO.Compression.ZipFile]::ExtractToDirectory(\"$**\", \".\") + +gvim_version.nsh : Make_mvc.mak + @ 1> $@ echo:^# Generated from Makefile: define the version numbers + @ 1>> $@ echo:^!ifndef __GVIM_VER__NSH__ + @ 1>> $@ echo:^!define __GVIM_VER__NSH__ + @ 1>> $@ echo:^!define VER_MAJOR $(MAJOR) + @ 1>> $@ echo:^!define VER_MINOR $(MINOR) + @ 1>> $@ echo:^!define PATCHLEVEL $(PATCH) + @ 1>> $@ echo:^!endif + +license : ..\lang\LICENSE.*.txt ..\LICENSE + !@ $(PS) $(PSFLAGS) \ + Get-Content -Path '$**' -Encoding UTF8 ^| \ + Set-Content -Path '..\lang\$(**B).nsis.txt' -Enc Unicode -Force + +rename : + @ ..\tools\rename.bat "$(SRC)" "$(DST)" 1> nul + +clean : + @ if exist .\gvim_version.nsh $(RM) .\gvim_version.nsh + @ if exist ..\lang\LICENSE*.nsis.txt $(RM) ..\lang\LICENSE*.nsis.txt + @ if exist .\icons\nul $(RD) .\icons + @ if exist .\gvim??.exe $(RM) .\gvim??.exe + +# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: diff --git a/nsis/Makefile b/nsis/Makefile new file mode 100644 index 0000000000..fdbc12012f --- /dev/null +++ b/nsis/Makefile @@ -0,0 +1,95 @@ +# +# Makefile for UNIX-like for create self-installing exe of Vim. +# 15/12/2024, Restorer restorer@mail2k.ru +# + + +.SUFFIXES: +.PHONY: all makeinst prepare rename clean + +ifdef VIMSRC +MKNSISFLAGS := -D"VIMSRC=$(VIMSRC)" +endif + +ifdef VIMRT +MKNSISFLAGS := $(MKNSISFLAGS) -D"VIMRT=$(VIMRT)" +endif + +ifdef VIMTOOLS +MKNSISFLAGS := $(MKNSISFLAGS) -D"VIMTOOLS=$(VIMTOOLS)" +endif + +ifdef GETTEXT +MKNSISFLAGS := $(MKNSISFLAGS) -D"GETTEXT=$(GETTEXT)" +endif + +ifdef HAVE_UPX +MKNSISFLAGS := $(MKNSISFLAGS) -DHAVE_UPX=$(HAVE_UPX) +endif + +ifdef HAVE_NLS +MKNSISFLAGS := $(MKNSISFLAGS) -DHAVE_NLS=$(HAVE_NLS) +endif + +ifdef HAVE_MULTI_LANG +MKNSISFLAGS := $(MKNSISFLAGS) -DHAVE_MULTI_LANG=$(HAVE_MULTI_LANG) +endif + +ifdef WIN64 +MKNSISFLAGS := $(MKNSISFLAGS) -DWIN64=$(WIN64) +endif + +ifdef INCLUDE_LIBGCC +MKNSISFLAGS := $(MKNSISFLAGS) -DINCLUDE_LIBGCC=$(INCLUDE_LIBGCC) +endif + +ifdef X +XX := -X"$(X:;=" -X")" +endif + +MAJOR != grep -E 'VIM_VERSION_MAJOR\s{2,}' ../src/version.h | \ + awk '{ printf "%d",$$3 }' +MINOR != grep -E 'VIM_VERSION_MINOR\s{2,}' ../src/version.h | \ + awk '{ printf "%d",$$3 }' +PATCH != awk '/number below this line/,/,/' ../src/version.c | \ + awk 'NR == 3 { printf "%04d",$$1 }' | sed -e 's/[ ,]//g' + +MKNSISFLAGS := -INPUTCHARSET UTF8 $(MKNSISFLAGS) + +all: makeinst + +makeinst: prepare + makensis $(MKNSISFLAGS) gvim.nsi $(XX) + +prepare: unzipicons gvim_version.nsh license rename + +unzipicons: icons.zip + if test -d `basename $? .zip` ; then rm -rf `basename $? .zip` ; fi + unzip $? + +gvim_version.nsh: Makefile + echo "# Generated from Makefile: define the version numbers" > $@ + echo "!ifndef __GVIM_VER__NSH__" >> $@ + echo "!define __GVIM_VER__NSH__" >> $@ + echo "!define VER_MAJOR $(MAJOR)" >> $@ + echo "!define VER_MINOR $(MINOR)" >> $@ + echo "!define PATCHLEVEL $(PATCH)" >> $@ + echo "!endif" >> $@ + +license: ../lang/LICENSE.*.txt ../LICENSE + for lic in $? ; do \ + bn=`basename $$lic .txt` ; \ + awk 'sub("$$", "\r")' < $$lic | \ + iconv -f UTF-8 -t UTF-16 > ../lang/$$bn.nsis.txt ; \ + done + +rename: + ../tools/rename.bat "$(SRC)" "$(DST)" + +clean: + if test -f gvim_version.nsh ; then rm -f gvim_version.nsh ; fi + rm -f ../lang/LICENSE*.nsis.txt + if test -d icons ; then rm -rf icons ; fi + if test -f gvim??.exe ; then rm -f gvim??.exe ; fi + +# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: diff --git a/nsis/README.txt b/nsis/README.txt index 79c1952133..4b4b7a0fbc 100644 --- a/nsis/README.txt +++ b/nsis/README.txt @@ -3,22 +3,15 @@ Installation System (NSIS), available at http://nsis.sourceforge.net/ To build the installable .exe file: -1. Unpack three archives: - PC sources - PC runtime - PC language files - You can generate these from the Unix sources and runtime plus the extra - archive (see the Makefile in the top directory). - -2. Go to the src directory and build: - gvim.exe (the OLE version), - vimrun.exe, - install.exe, - uninstall.exe, - tee/tee.exe, - xxd/xxd.exe - - Then execute tools/rename.bat to rename the executables. +Preparatory stage + +1. Clone using the git tool the Vim repository or download its zip file + available at: + https://github.com/vim/vim + +2. Go to the "/src" directory and build the Vim editor, making sure to use the + following variable values: "GUI=yes"; "OLE=yes"; "VIMDLL=yes". See + INSTALLpc.txt and Make_mvc.mak for details. 3. Go to the GvimExt directory and build gvimext.dll (or get it from a binary archive). Both 64- and 32-bit versions are needed and should be placed @@ -32,8 +25,8 @@ To build the installable .exe file: https://www.mediafire.com/file/9edk4g3xvfgzby0/diff4Vim.zip/file When will you have "diff.exe" put it in the "../.." directory (above the "vim91" directory, it's the same for all Vim versions). However, you can - specify another directory by passing /DVIMTOOLS= option to the - "makensis.exe" program via the command line. + specify a different directory by specifying the appropriate makefile value. + How to do this is described below. 5. For the terminal window to work in Vim, the library winpty is required. You can get it at the following url: @@ -41,8 +34,8 @@ To build the installable .exe file: For the 32-bit version, rename "winpty.dll" from ia32/bin to "winpty32.dll", and for the 64-bit version — "winpty.dll" from x64/bin to "winpty64.dll". Put the renamed file and "winpty-agent.exe" in "../.." (above the "vim91" - directory). However, you can specify another directory by passing - /DVIMTOOLS= option to the "makensis.exe" program via the command line. + directory). However, you can specify a different directory by specifying + the appropriate makefile value. How to do this is described below. 6. To use stronger encryption, add the Sodium library. You can get it here: https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19-msvc.zip @@ -52,12 +45,7 @@ To build the installable .exe file: "../.." directory (above the "vim91" directory, where "diff.exe" and "winpty{32|64}.dll"). -7. On MS Windows do "nmake.exe -f Make_mvc.mak uganda.nsis.txt" in runtime/doc. - On Unix-like system do "make runtime/doc/uganda.nsis.txt" in top directory - or "make uganda.nsis.txt" in runtime/doc. The created files - "uganda.nsis.???" will be automatically converted to DOS file format. - -8. Get gettext and iconv DLLs from the following site: +7. Get gettext and iconv DLLs from the following site: https://github.com/mlocati/gettext-iconv-windows/releases Both 64- and 32-bit versions are needed. Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract @@ -74,35 +62,47 @@ To build the installable .exe file: libintl-8.dll libiconv-2.dll - The default is "..", however, you can specify another - directory by passing /DGETTEXT= option to "makensis.exe" program via - the command line. + The default is "../..". However, you can specify a + different directory by specifying the appropriate makefile value. How to do + this is described below. - -Install NSIS if you didn't do that already. -Download Unicode version the ShellExecAsUser plug-in for NSIS from: +8. Install NSIS if you didn't do that already. + Download Unicode version the ShellExecAsUser plug-in for NSIS from: https://nsis.sourceforge.io/ShellExecAsUser_plug-in -and put ShellExecAsUser.dll to path\to\NSIS\Plugins\x86-unicode + and put "ShellExecAsUser.dll" to path\to\NSIS\Plugins\x86-unicode + +Installer assembly stage + + On MS Windows, open the Developer Command Prompt for VS and go to the + "/nsis" directory and type the command + nmake.exe -lf Make_mvc.mak [variables] all + After the installer is created and you copy it to the desired location, run + the following command in the "/nsis" directory + nmake.exe -lf Make_mvc.mak clean + + On UNIX-like systems, go to the "/nsis" directory and type the command + make -f Makefile [variables] all -Unpack the images: - cd nsis - unzip icons.zip or 7z x icons.zip (on Unix-like or MS Windows) - WinRar.exe x icons.zip (on MS Windows) + After the installer is created and you copy it to the desired location, run + the following command in the "/nsis" directory + make -f Makefile clean -Then build gvim.exe: - cd nsis - makensis.exe [options] gvim.nsi +Variables and their values available for building the installer (not mandatory): -Options (not mandatory): - /DVIMSRC= — directory where location of gvim_ole.exe, vimw32.exe, + "VIMSRC=" — directory where location of gvim_ole.exe, vimw32.exe, GvimExt/*, etc. - /DVIMRT= — directory where location of runtime files - /DVIMTOOLS= — directory where location of extra tools: diff.exe, - winpty{32|64}.dll, winpty-agent.exe, libsodium.dll - /DGETTEXT= — directory where location of gettext libraries - /DHAVE_UPX=1 — additional compression of the installer. UPX program + "VIMRT=" — directory where location of runtime files. + "VIMTOOLS=" — directory where location of extra tools: diff.exe, + winpty{32|64}.dll, winpty-agent.exe, libsodium.dll. + "GETTEXT=" — directory where location of gettext libraries. + "HAVE_UPX=1" — additional compression of the installer. UPX program must be installed. - /DHAVE_NLS=0 — do not add native language support - /DHAVE_MULTI_LANG=0 — to create an English-only the installer - /DWIN64=1 — to create a 64-bit the installer + "HAVE_NLS=0" — do not add native language support. + "HAVE_MULTI_LANG=0" — to create an English-only the installer. + "WIN64=1" — to create a 64-bit the installer. + "X=" — executes scriptcmd in script. If multiple scriptcmd + are specified, they are separated by a semicolon. + Example "X=OutFile MyVim.exe;XPMode on" + "MKNSIS=" — the directory where the "makensis.exe" program is + located. diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi index 3ea1d15de1..878867f68f 100644 --- a/nsis/gvim.nsi +++ b/nsis/gvim.nsi @@ -1,6 +1,6 @@ # NSIS file to create a self-installing exe for Vim. # It requires NSIS version 3.0 or later. -# Last Change: 2024 Mar 20 +# Last Change: 2025 Jan 05 Unicode true @@ -14,19 +14,19 @@ Unicode true # Location of runtime files !ifndef VIMRT - !define VIMRT ".." + !define VIMRT "..\runtime" !endif # Location of extra tools: diff.exe, winpty{32|64}.dll, winpty-agent.exe, etc. !ifndef VIMTOOLS - !define VIMTOOLS ..\.. + !define VIMTOOLS "..\.." !endif # Location of gettext. # It must contain two directories: gettext32 and gettext64. # See README.txt for detail. !ifndef GETTEXT - !define GETTEXT ${VIMRT} + !define GETTEXT ${VIMTOOLS} !endif # If you have UPX, use the switch /DHAVE_UPX=1 on the command line makensis.exe. @@ -74,6 +74,8 @@ Unicode true !include "nsDialogs.nsh" !include "Sections.nsh" !include "x64.nsh" +!include "StrFunc.nsh" +${StrRep} # See https://nsis.sourceforge.io/LogicLib ;FileExists is already part of LogicLib, but returns true for directories @@ -246,6 +248,9 @@ Var vim_nsd_mouse Var vim_compat_stat Var vim_keymap_stat Var vim_mouse_stat +!if ${HAVE_NLS} +Var lng_usr +!endif # Reserve files @@ -423,6 +428,7 @@ Section "$(str_section_exe)" id_section_exe File /oname=xxd.exe ${VIMSRC}\xxdw32.exe File ..\vimtutor.bat File ..\README.txt + File /oname=LICENSE.txt ..\LICENSE File ..\uninstall.txt File ${VIMRT}\*.vim @@ -621,110 +627,23 @@ SectionGroupEnd Section "$(str_section_nls)" id_section_nls SectionIn 1 3 -#; FIXME: When adding new translations, do not forget to make changes here. - SetOutPath $0 -!if /FileExists ..\README.dax.txt - ${If} $Language = ${LANG_DANISH} - File ..\README.dax.txt - ${EndIf} -!endif -!if /FileExists ..\README.nlx.txt - ${If} $Language = ${LANG_DUTCH} - File ..\README.nlx.txt - ${EndIf} -!endif -!if /FileExists ..\README.dex.txt - ${If} $Language = ${LANG_GERMAN} - File ..\README.dex.txt - ${EndIf} -!endif -!if /FileExists ..\README.itx.txt - ${If} $Language = ${LANG_ITALIAN} - File ..\README.itx.txt - ${EndIf} -!endif -!if /FileExists ..\README.jax.txt - ${If} $Language = ${LANG_JAPANESE} - File ..\README.jax.txt - ${EndIf} -!endif -!if /FileExists ..\README.rux.txt - ${If} $Language = ${LANG_RUSSIAN} - File ..\README.rux.txt - ${EndIf} -!endif -!if /FileExists ..\README.srx.txt - ${If} $Language = ${LANG_SERBIAN} - File ..\README.srx.txt - ${EndIf} -!endif -!if /FileExists ..\README.cnx.txt - ${If} $Language = ${LANG_SIMPCHINESE} - File ..\README.cnx.txt - ${EndIf} -!endif -!if /FileExists ..\README.twx.txt - ${If} $Language = ${LANG_TRADCHINESE} - File ..\README.twx.txt - ${EndIf} -!endif -!if /FileExists ..\README.trx.txt - ${OrIf} $Language = ${LANG_TURKISH} - File ..\README.trx.txt - ${EndIf} -!endif -#; FIXME: When adding new translations, do not forget to make changes here. - SetOutPath $0\doc -!if /FileExists "${VIMRT}\doc\uganda.dax" - ${If} $Language = ${LANG_DANISH} - File ${VIMRT}\doc\uganda.dax - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.nlx" - ${If} $Language = ${LANG_DUTCH} - File ${VIMRT}\doc\uganda.nlx - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.dex" - ${If} $Language = ${LANG_GERMAN} - File ${VIMRT}\doc\uganda.dex - ${EndIf} + SetOutPath $INSTDIR +!if /FileExists "..\lang\README.*.txt" + File ..\lang\README.*.txt + CopyFiles /SILENT /FILESONLY $INSTDIR\README.$lng_usr.txt \ + $INSTDIR\vim${VER_MAJOR}${VER_MINOR}\README.$lng_usr.txt + Delete $INSTDIR\README.*.txt !endif -!if /FileExists "${VIMRT}\doc\uganda.itx" - ${If} $Language = ${LANG_ITALIAN} - File ${VIMRT}\doc\uganda.itx - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.jax" - ${If} $Language = ${LANG_JAPANESE} - File ${VIMRT}\doc\uganda.jax - ${EndIf} +!if /FileExists "..\lang\LICENSE.??.txt" + File ..\lang\LICENSE.??.txt +!if /FileExists "..\lang\LICENSE.??_??.txt" + File ..\lang\LICENSE.??_??.txt !endif -!if /FileExists "${VIMRT}\doc\uganda.rux" - ${If} $Language = ${LANG_RUSSIAN} - File ${VIMRT}\doc\uganda.rux - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.srx" - ${If} $Language = ${LANG_SERBIAN} - File ${VIMRT}\doc\uganda.srx - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.cnx" - ${If} $Language = ${LANG_SIMPCHINESE} - File ${VIMRT}\doc\uganda.cnx - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.twx" - ${If} $Language = ${LANG_TRADCHINESE} - File ${VIMRT}\doc\uganda.twx - ${EndIf} -!endif -!if /FileExists "${VIMRT}\doc\uganda.trx" - ${If} $Language = ${LANG_TURKISH} - File ${VIMRT}\doc\uganda.trx - ${EndIf} + CopyFiles /SILENT /FILESONLY $INSTDIR\LICENSE.$lng_usr.txt \ + $INSTDIR\vim${VER_MAJOR}${VER_MINOR}\LICENSE.$lng_usr.txt + Delete $INSTDIR\LICENSE.*.txt !endif + SetOutPath $0\lang File /r /x Makefile ${VIMRT}\lang\*.* SetOutPath $0 @@ -883,6 +802,20 @@ Function .onInit !insertmacro MUI_LANGDLL_DISPLAY !endif +!if ${HAVE_NLS} + ClearErrors + System::Call 'kernel32::GetUserDefaultLocaleName(t.r19, *i${NSIS_MAX_STRLEN})' + StrCmp $R9 "zh-cn" coincide 0 + StrCmp $R9 "zh-tw" 0 part + coincide: + System::Call 'User32::CharLower(t r19 r19)*i${NSIS_MAX_STRLEN}' + ${StrRep} $lng_usr "$R9" "-" "_" + Goto done + part: + StrCpy $lng_usr $R9 2 + done: +!endif + ${If} $INSTDIR == ${DEFAULT_INSTDIR} # Check $VIM ReadEnvStr $3 "VIM" diff --git a/nsis/gvim_version.nsh b/nsis/gvim_version.nsh index aee434ba06..c59366a74c 100644 --- a/nsis/gvim_version.nsh +++ b/nsis/gvim_version.nsh @@ -3,4 +3,5 @@ !define __GVIM_VER__NSH__ !define VER_MAJOR 9 !define VER_MINOR 1 +!define PATCHLEVEL 0 !endif diff --git a/nsis/lang/README.txt b/nsis/lang/README.txt index 68ff1124ca..07899cbe2d 100644 --- a/nsis/lang/README.txt +++ b/nsis/lang/README.txt @@ -18,17 +18,17 @@ allowable length of strings. For example: drop-down lists on the .vimrc page - 55 characters. Characters in this case mean characters of the English alphabet. -If you do not yet have a translated "uganda.txt" file and a main "README.txt" +If you do not yet have a translated "LICENSE" file and/or a main "README.txt" file, set the following values: for the license file -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" for the readme.txt file LangString vim_readme_file 0 "README.txt" Once you have the translations of these files, then set the values for these variables similarly to what is done in the other translation files. -Also add the appropriate entries to the "gvim.nsi" file as done for other -languages. - +Translation files should be located in the "lang" subdirectory of the root +directory. The name of the files is as follows: "README.xx.txt", where xx is the +language code according to ISO639. diff --git a/nsis/lang/danish.nsi b/nsis/lang/danish.nsi index ceb18be2f1..c4000312f2 100644 --- a/nsis/lang/danish.nsi +++ b/nsis/lang/danish.nsi @@ -19,15 +19,15 @@ LangString ^UninstallCaption ${LANG_DANISH} "$(^Name) Uninstall" # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_DANISH} "${VIMRT}\doc\uganda.nsis.dax" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_DANISH} "..\lang\LICENSE.da.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_DANISH} "README.dax.txt" +#LangString vim_readme_file ${LANG_DANISH} "README.da.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/dutch.nsi b/nsis/lang/dutch.nsi index 49b1ed07c9..5a2ba14ce5 100644 --- a/nsis/lang/dutch.nsi +++ b/nsis/lang/dutch.nsi @@ -21,15 +21,15 @@ LangString ^UninstallCaption ${LANG_DUTCH} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_DUTCH} "${VIMRT}\doc\uganda.nsis.nlx" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_DUTCH} "..\lang\LICENSE.nl.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_DUTCH} "README.nlx.txt" +#LangString vim_readme_file ${LANG_DUTCH} "README.nl.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/english.nsi b/nsis/lang/english.nsi index 6f69f58df1..d80f6f3686 100644 --- a/nsis/lang/english.nsi +++ b/nsis/lang/english.nsi @@ -21,7 +21,7 @@ LangString ^UninstallCaption ${LANG_ENGLISH} \ # License file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file ${LANG_ENGLISH} "${VIMRT}\doc\uganda.nsis.txt" +LicenseLangString page_lic_file ${LANG_ENGLISH} "..\lang\LICENSE.nsis.txt" ############################################################################## # README.txt file, which is opened after installation {{{1 diff --git a/nsis/lang/german.nsi b/nsis/lang/german.nsi index 21cf80e52e..59d65a3425 100644 --- a/nsis/lang/german.nsi +++ b/nsis/lang/german.nsi @@ -21,15 +21,15 @@ LangString ^UninstallCaption ${LANG_GERMAN} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_GERMAN} "${VIMRT}\doc\uganda.nsis.dex" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_GERMAN} "..\lang\LICENSE.de.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_GERMAN} "README.dex.txt" +#LangString vim_readme_file ${LANG_GERMAN} "README.de.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/greek.nsi b/nsis/lang/greek.nsi index b92d3f326b..d746cb3a2c 100644 --- a/nsis/lang/greek.nsi +++ b/nsis/lang/greek.nsi @@ -21,15 +21,15 @@ LangString ^UninstallCaption ${LANG_GREEK} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_GREEK} "${VIMRT}\doc\uganda.nsis.elx" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_GREEK} "..\lang\LICENSE.el.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_GREEK} "README.elx.txt" +#LangString vim_readme_file ${LANG_GREEK} "README.el.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/italian.nsi b/nsis/lang/italian.nsi index 5f326809a7..629d476589 100644 --- a/nsis/lang/italian.nsi +++ b/nsis/lang/italian.nsi @@ -21,15 +21,13 @@ LangString ^UninstallCaption ${LANG_ITALIAN} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_ITALIAN} "${VIMRT}\doc\uganda.nsis.itx" +LicenseLangString page_lic_file ${LANG_ITALIAN} "..\lang\LICENSE.it.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## -LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_ITALIAN} "README.itx.txt" +LangString vim_readme_file ${LANG_ITALIAN} "README.it.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/japanese.nsi b/nsis/lang/japanese.nsi index d290355d10..c28529cb46 100644 --- a/nsis/lang/japanese.nsi +++ b/nsis/lang/japanese.nsi @@ -31,15 +31,15 @@ LangString ^InstallBtn ${LANG_JAPANESE} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_JAPANESE} "${VIMRT}\doc\uganda.nsis.jax" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_JAPANESE} "..\lang\LICENSE.ja.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_JAPANESE} "README.jax.txt" +#LangString vim_readme_file ${LANG_JAPANESE} "README.ja.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/russian.nsi b/nsis/lang/russian.nsi index 876bef2b89..bcb54672fd 100644 --- a/nsis/lang/russian.nsi +++ b/nsis/lang/russian.nsi @@ -21,13 +21,13 @@ LangString ^UninstallCaption ${LANG_RUSSIAN} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file ${LANG_RUSSIAN} "${VIMRT}\doc\uganda.nsis.rux" +LicenseLangString page_lic_file ${LANG_RUSSIAN} "..\lang\LICENSE.ru.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## -LangString vim_readme_file ${LANG_RUSSIAN} "README.rux.txt" +LangString vim_readme_file ${LANG_RUSSIAN} "README.ru.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/serbian.nsi b/nsis/lang/serbian.nsi index 122727d11a..9b829ef961 100644 --- a/nsis/lang/serbian.nsi +++ b/nsis/lang/serbian.nsi @@ -21,15 +21,15 @@ LangString ^UninstallCaption ${LANG_SERBIAN} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_SERBIAN} "${VIMRT}\doc\uganda.nsis.srx" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_SERBIAN} "..\lang\LICENSE.sr.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_SERBIAN} "README.srx.txt" +#LangString vim_readme_file ${LANG_SERBIAN} "README.sr.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/simpchinese.nsi b/nsis/lang/simpchinese.nsi index 8d2d073f79..0c9290eab4 100644 --- a/nsis/lang/simpchinese.nsi +++ b/nsis/lang/simpchinese.nsi @@ -22,16 +22,16 @@ LangString ^UninstallCaption ${LANG_SIMPCHINESE} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" #LicenseLangString page_lic_file ${LANG_SIMPCHINESE} \ -# "${VIMRT}\doc\uganda.nsis.cnx" +# "..\lang\LICENSE.zh_cn.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_SIMPCHINESE} "README.cnx.txt" +#LangString vim_readme_file ${LANG_SIMPCHINESE} "README.zh_cn.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/tradchinese.nsi b/nsis/lang/tradchinese.nsi index 66bb1b8800..5d9a5d3a56 100644 --- a/nsis/lang/tradchinese.nsi +++ b/nsis/lang/tradchinese.nsi @@ -22,16 +22,16 @@ LangString ^UninstallCaption ${LANG_TRADCHINESE} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" #LicenseLangString page_lic_file ${LANG_TRADCHINESE} \ -# "${VIMRT}\doc\uganda.nsis.twx" +# "..\lang\LICENSE.zh_tw.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_TRADCHINESE} "README.twx.txt" +#LangString vim_readme_file ${LANG_TRADCHINESE} "README.zh_tw.txt" ############################################################################## # MUI Configuration Strings {{{1 diff --git a/nsis/lang/turkish.nsi b/nsis/lang/turkish.nsi index 429cbb3d90..3522faa7f4 100644 --- a/nsis/lang/turkish.nsi +++ b/nsis/lang/turkish.nsi @@ -20,15 +20,15 @@ LangString ^UninstallCaption ${LANG_TURKISH} \ # Translated license file for the license page {{{1 ############################################################################## -LicenseLangString page_lic_file 0 "${VIMRT}\doc\uganda.nsis.txt" -#LicenseLangString page_lic_file ${LANG_TURKISH} "${VIMRT}\doc\uganda.nsis.trx" +LicenseLangString page_lic_file 0 "..\lang\LICENSE.nsis.txt" +#LicenseLangString page_lic_file ${LANG_TURKISH} "..\lang\LICENSE.tr.nsis.txt" ############################################################################## # Translated README.txt file, which is opened after installation {{{1 ############################################################################## LangString vim_readme_file 0 "README.txt" -#LangString vim_readme_file ${LANG_TURKISH} "README.trx.txt" +#LangString vim_readme_file ${LANG_TURKISH} "README.tr.txt" ############################################################################## diff --git a/runtime/doc/Make_mvc.mak b/runtime/doc/Make_mvc.mak index a6af4baf8a..064aa3ebf3 100644 --- a/runtime/doc/Make_mvc.mak +++ b/runtime/doc/Make_mvc.mak @@ -12,7 +12,7 @@ # Correct the following line for the where executable file vim is installed. # Please do not put the path in quotes. -VIMPROG = D:\Programs\Vim\vim91\vim.exe +VIMPROG = ..\..\src\vim.exe # Correct the following line for the directory where iconv installed. # Please do not put the path in quotes. @@ -54,7 +54,7 @@ tags : doctags $(DOCS) doctags.exe $(DOCS) | sort /L C /O tags $(PS) $(PSFLAGS) \ (Get-Content -Raw tags ^| Get-Unique ^| %%{$$_ -replace \"`r\", \"\"}) \ - ^| New-Item -Path . -Force -ItemType file -Name tags + ^| New-Item -Path . -Name tags -ItemType file -Force doctags : doctags.c $(CC) doctags.c @@ -65,15 +65,6 @@ doctags : doctags.c vimtags : $(DOCS) @"$(VIMPROG)" --clean -esX -V1 -u doctags.vim - -uganda.nsis.txt : uganda.??? - ! $(PS) $(PSFLAGS) (Get-Content $? -Encoding UTF8 \ - ^| %%{$$_ -replace '[\t\s]*\*.*\*', '' -replace 'vim:tw=\d\d:.*', ''}) \ - ^| Set-Content \"$(@B)$$((Get-Item $?).Extension)\" -Encoding Unicode - ! $(PS) $(PSFLAGS)\ - (Get-Content $(@B)$$((Get-Item $?).Extension) -Raw).Trim() -replace '(\r\n){3,}', '$$1$$1' \ - ^| Set-Content \"$(@B)$$((Get-Item $?).Extension)\" -Encoding Unicode - # TODO: #html: noerrors tags $(HTMLS) # if exist errors.log (more errors.log) @@ -108,8 +99,8 @@ test_urls : "$(VIMPROG)" --clean -S test_urls.vim clean : - $(RM) doctags.exe doctags.obj - $(RM) *.html vim-stylesheet.css + - $(RM) doctags.exe doctags.obj + - $(RM) *.html vim-stylesheet.css arabic.txt : diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile index 00ea5411d9..82b5680812 100644 --- a/runtime/doc/Makefile +++ b/runtime/doc/Makefile @@ -49,16 +49,6 @@ vimtutor.man: vimtutor.1 xxd.man: xxd.1 nroff -man $? | sed -e s/.//g > $@ -uganda.nsis.txt : uganda.??? - for dpn in $?; do \ - trg=$@; \ - sed -e 's/[ ]*\*.*\*//g' -e 's/vim:tw=[[:digit:]][[:digit:]]:.*//' \ - $${dpn} | uniq > $${trg%txt}$${dpn##*.}; \ - done -# This files needs to be in dos fileformat for NSIS. - $(VIMPROG) -e -X -u NONE --cmd "set notitle noicon nocp noml viminfo=" \ - -c "argdo write ++ff=dos" -c "qa" uganda.nsis.??? - # Awk version of .txt to .html conversion. html: noerrors tags $(HTMLS) @if test -f errors.log; then more errors.log; fi diff --git a/runtime/doc/uganda.rux b/runtime/doc/uganda.rux deleted file mode 100644 index 6f0f205f86..0000000000 --- a/runtime/doc/uganda.rux +++ /dev/null @@ -1,337 +0,0 @@ -*uganda.txt* для Vim version 9.1 редакция от 14 авг 2024 г. - - - СПРАВОЧНИК ПО РЕДАКТОРУ VIM - автор Брам Моленар - - - *uganda* *Uganda* *copying* *copyright* *license* -КРАТКОЕ ОПИСАНИЕ - *iccf* *ICCF* -Редактор Vim является благотворительным программным обеспечением. -Использование и копирование программы Vim не ограничено, однако -рекомендуется сделать добровольное пожертвование для нуждающихся детей в -Уганде. Ознакомьтесь с разделом |kcc| далее в этом документе или посетите -веб-сайт организации ICCF, доступный по указанным ниже адресам: - - https://iccf-holland.org/ - https://www.vim.org/iccf/ - https://www.iccf.nl/ - -Также возможно оказание финансовой помощи для разработки программы Vim, -см. раздел |sponsor|. В любом случае деньги направляются в Уганду. - -Документация, поставляемая в составе программы Vim, распространяется на -условиях лицензии на Открытые публикации, см. раздел |manual-copyright|. - -=== начало лицензии === - -ЛИЦЕНЗИЯ VIM - -I) Неизменённые копии программы Vim могут распространяться без ограничения - при условии включения данного текста лицензии. Распространение - неизменённых копий отдельных частей программы Vim также возможно при - соблюдении условия о включении данного текста лицензии. Подобным образом - разрешается добавлять исполняемые файлы, скомпилированные из - неизменённого исходного кода программы Vim, а также собственные примеры - использования и командные файлы редактора Vim. - -II) Изменённую (или дополненную) версию программы Vim, включающую - исполняемые файлы и/или исходный код, допускается распространять при - соблюдении следующих четырёх условий: - 1) Текст настоящей лицензии должен включаться в состав распространяемой - версии программы Vim без изменений. - 2) Изменённая версия программы Vim должна распространяться одним из - следующих пяти способов: - a) При внесении изменений в программу Vim, в дистрибутиве должны - быть явно указаны контактные данные лица, внёсшего эти изменения. - Ответственному разработчику по его запросу (в любой форме) должна - быть безвозмездно предоставлена копия распространяемой изменённой - версии программы Vim, включая её исходный код. Ответственный - разработчик оставляет за собой право включать сделанные изменения - в официальную версию программы Vim. Конкретные действия - ответственного разработчика, относительно переданных изменений, а - также лицензионные условия, на основании которых будет - осуществляться их распространение, могут быть дополнительно - согласованы. Если согласование не проводилось, сделанные изменения - будут распространяться на условиях настоящей лицензии или более - поздней её версии. Лица, в данное время являющиеся ответственными - за разработку, указаны в перечне, размещённом по следующему адресу: - https://github.com/orgs/vim/people. В случае изменения этой - информации, актуальные данные будут опубликованы на - соответствующих ресурсах (вероятнее всего по интернет‐адресам - vim.sf.net, www.vim.org и/или comp.editors). В случае полной - невозможности установить контакт с ответственным разработчиком, - обязательства по отправке изменений утрачивают силу. После - передачи подтверждения о получении изменений от ответственного - разработчика, необходимость в повторной отправке копии изменённой - программы Vim неприменима. - b) Если лицом получена изменённая версия программа Vim, - распространяющаяся на условиях, указанных в ч. II) п. 2) пп. а) - допускается дальнейшее её распространение этим лицом без внесения - изменений и согласно ч. I) настоящей лицензии. В случае внесения - дополнительных изменений, на эти изменения будут распространяться - условия, указанные в ч. II) п. 2) пп. a). - c) Каждая копия распространяемой изменённой версии программы Vim - должна включать информацию обо всех произведённых изменениях, - включая исходный код. Эта информация может быть представлена в - виде построчного сравнения файлов. Выбор лицензии, по условиям - которой будет распространяться добавленный код, остаётся за - автором этих изменений. Изменения и лицензия на эти изменения не - должны запрещать другим лицам внесение своих собственных - изменений в официальную версию программы Vim. - d) Изменённая версия программы Vim, содержащая изменения в - соответствии с ч. II) п. 2 пп. c), может распространяться без - исходного кода для этих изменений, при соблюдении следующих трёх - условий: - - Лицензия, применяемая к внесённым изменениям, предоставляет - ответственному разработчику программы Vim возможность - безвозмездного и неограниченного распространения этих изменений, - а также право на безвозмездное и неограниченное включение этих - изменений в официальную версию программы Vim. - - Изменения должны сохраняться не менее трёх лет со времени - распространения соответствующей изменённой версии программы Vim. - В течение этого периода по запросу ответственного разработчика - или другого пользователя изменённой версии программы Vim - (в любой форме) необходимо предоставить исходный код данных - изменений. - - В дистрибутиве изменённой версии программы Vim должны быть явно - указаны контактные данные лица, внёсшего эти изменения. - Контактные данные должны сохранять актуальность в течение - не менее трёх лет со времени последнего распространения - соответствующей изменённой версии программы Vim или как можно - дольше. - e) Если к изменениям, внесённым в программу Vim, применимы условия - лицензии GNU General Public License (GNU GPL), допускается - распространение изменённой версия программы Vim на условиях - лицензии GNU GPL версии 2 или любой более поздней версии этой - лицензии. - 3) Необходимо добавить соответствующую информацию, которая должна быть - выведена в результате выполнения команды ":version" в программе Vim, - а также на экране приветствия программы Vim, чтобы пользователь - изменённой версии программы Vim имел возможность определить, что он - пользуется изменённой версией. При распространении на условиях, - указанных в ч. II) п. 2) пп. e) такую информацию требуется добавлять - только в том случае, когда она не противоречит лицензии, - распространяющейся на эти изменения. - 4) Контактная информация, которая указывается по требованию ч. II) п. 2) - пп. a) и ч. II) п. 2) пп. d) не должна удаляться или изменяться никем - другим, кроме лица, указавшего данную контактную информацию. - -III) При распространении изменённой версии программы Vim рекомендуется - пользоваться лицензией Vim для произведённых изменений и обеспечить - доступ к этим изменениям ответственного разработчика, включая исходный - код изменений. Предпочтительным способом предоставления доступа к - произведённым изменениям является отправка этих изменений по - электронной почте или загрузка файлов на сервер с отправкой URL-адреса - по электронной почте. Если количество изменений незначительно - (например, изменения в файле Makefile) достаточно будет отправить по - электронной почте файл построчного сравнения. Изменения или URL-адреса - должны быть отправлены на адрес электронной почты maintainer@vim.org - -IV) Не допускается удаление настоящей лицензия из дистрибутива исходного - кода программы Vim, его отдельных частей или изменённой версии. - Допускается использование настоящей лицензию для предыдущих изменённых - выпусков программы Vim, взамен тех лицензий, с которыми они - распространялись. - -=== конец лицензии === - -Примечание. - -- Если вам нравится программа Vim, дочитайте до конца и подумайте над - оказанием помощи нуждающимся детям в Уганде. - -- При наличии желания поддержать дальнейшую разработку программы Vim, - рассмотрите возможность оказания финансовой поддержки (см. раздел - |sponsor|). В любом случае деньги отправляются в Уганду. - -- Ричард Столлман (Richard Stallman) подтвердил, что лицензия Vim совместима - с лицензией GNU GPL. С момента его последней проверки были внесены - незначительные изменения, но они не должны оказать на это никакого влияния. - -- Если сборка программы Vim осуществляется с использованием библиотеки, на - которую распространяется лицензия GNU GPL, дальнейшее распространение - программы может осуществляться только на условиях лицензии GNU GPL. Даже - если в саму программу Vim не было внесено никаких изменений. - -- Если были внесены изменения, на которые распространяется лицензия GNU GPL, - все дальнейшие изменения также должны добавляться на условиях лицензии - GNU GPL или другой совместимой лицензии. - -- При распространении изменённой версии программы Vim, своё имя и контактную - информацию можно добавлять с помощью аргумента конфигурации - "--with-modified-by" или директивы define MODIFIED_BY. - -============================================================================== -Детский центр в Кибаале *kcc* *Kibaale* *charity* - -Детский центр в Кибаале (Kibaale Children's Centre, KCC) находится в гор. -Кибаал. Это небольшой городок в восточной Африке на юге Уганды недалеко от -Танзании на территории округа Ракаи. Большая часть населения занимается -земледелием. Несмотря на бедность жителей, здесь обычно бывает достаточно -пищи. Однако по числу заболевших СПИД этот округ превосходит любую другую -точку планеты. Существует мнение, что именно отсюда началось распространение -этой смертельной болезни. По некоторым оценкам в прошлом от 10 до 30 -процентов жителей Уганды были заражены ВИЧ. Высокая смертность родителей -стала причиной появления большого количества сирот. При населении округа -в 350 000 человек, 60 000 детей потеряло одного или обоих родителей. Однако -даже несомненные успехи в уменьшении масштабов распространения СПИД -не могут привести к полному исчезновению проблем. - -Дети очень нуждаются в помощи. Организация KCC прилагает все усилия для -предоставления нуждающимся пищи, медицинской помощи и образования. Пища и -медицинская помощь предоставляются для поддержания здоровья, а образование -даёт возможность позаботиться о себе в будущем. Организация KCC работает на -базе христианской миссии, но помощь оказывается всем детям независимо от их -приверженности к какой-либо религии. - -В данном случае ключом к решению проблем является возможность получения -образования. В последнее время при правлении президента Иди Амина (Idi Amin -Dada Oumee), а также в ходе последовавших гражданских войн, этой проблеме не -уделялось достаточно внимания. Однако сейчас после стабилизации деятельности -правительства детям и их родителям нужно учиться жить и заботиться самим о -себе, избегая при этом риска заражения инфекционными заболеваниями. Поэтому -наряду с оказанием помощи больным и голодающим, основной целью миссии -является предупреждение заболеваемости и прививание навыков по употреблению -здоровой пищи. - -Большинство сирот проживают у близких родственников, воспитываются дядями -или старшими сёстрами. Вследствие больших размеров семей и низких доходов -(если таковые имеются), большим везением для ребёнка будет обеспечение -здоровым питанием. Про одежду, медицинскую помощь и школьное обучение -говорить уже не приходится. Для оказания помощи таким нуждающимся детям была -организована программа оказания финансовой помощи. Она позволяет взять -ребёнка на финансовое обеспечение. За несколько долларов в месяц организация -KCC обеспечит его необходимыми предметами обихода, будет следить за его -здоровьем, организует школьное обучение, а также сделает всё необходимое для -ребёнка и семьи, которая поддерживает его развитие. - -Помимо непосредственного оказания помощи ребёнку, необходимо также проводить -комплексное развитие среды, в которой живут дети. С этой целью организация -KCC предоставляет школам помощь по улучшению методов обучения. На базе -центра имеется показательная школа, в которой организуется обучение для -учителей. Также проводится обучение медицинских работников, прививаются -санитарно-гигиенические нормы, пропагандируется постройка туалетов -надлежащей конструкции в местах проживания. Также лично мною была оказана -помощь в постройке производственного объекта по созданию железобетонных плит, -которые применяются при постройке туалетов и продаются по сниженным ценам. - -На балансе проекта содержится клиника, в которой предоставляется медицинская -помощь детям и их семьям. В 2020 году было открыто родильное отделение и -пункт круглосуточного оказания медицинской помощи. При необходимости -осуществляется доставка в больницу. Проводятся программы иммунизации -населения, и предоставляется помощь при вспышках эпидемии (случаются вспышки -кори и холеры). - *donate* -С лета 1994 года до лета 1995 года мне целый год довелось провести в центре, -работая там в качестве волонтёра. Я помогал в расширении центра и трудился в -сфере водоснабжения и санитарно-гигиенического контроля. Там я убедился в -эффективности той помощи, которую оказывает организация KCC. По возвращении -в Нидерланды утвердилось желание продолжить поддержку организации KCC. -С этой целью я провожу сбор средств и организую программу оказания -финансовой помощи. Поэтому предлагаю вам рассмотреть одну из следующих -возможностей: - -1. Предоставить финансовую помощь ребёнку в начальной школе — 17 евро в - месяц (или больше). -2. Предоставить финансовую помощь ребёнку в средней школе — 25 евро в месяц - (или больше). -3. Предоставить финансовую помощь клинике — любая сумма раз в месяц или - в квартал. -4. Единовременное пожертвование. - -По сравнению с другими программами оказания финансовой поддержки детям, -указанные выше суммы выглядят весьма скромно. Причина столь небольшого -размера пожертвований заключается в том, что деньги направляются -непосредственно в центр. На администрацию тратиться менее 5 %, что стало -возможным благодаря малым размерам организации и привлечению волонтёров. -Если вы предполагаете взять на финансовое обеспечение ребёнка, то важно -понимать, что регулярное оказание помощи должно осуществляться на протяжении -не менее одного года. - -Я понимаю, что вам нужны гарантии поступления средств по адресу. Прежде -всего, я готов предоставить свои личные гарантии, как автор программы Vim. -Я доверяю людям, работающим в этом центре, и знаю их лично. Кроме того, -финансирование и инспектирование центра осуществлялось совместно с такими -общеизвестными благотворительными организациями, как «World Vision», -«Save the Children», а теперь центр находится на попечении организации -«Pacific Academy Outreach Society». Посещение центра осуществляется (за свой -собственный счёт) примерно раз в год для проверки хода выполнения текущих -задач. Я сам неоднократно посещал этот центр, начиная с 1993 года. Отчёты о -посещениях размещаются на веб-сайте организации ICCF. - -Если у вас остались вопросы, можете задать их по электронной почте -. - -Адрес центра: - Kibaale Children's Centre - p.o. box 1658 - Masaka, Uganda, East Africa - -Перечисление средств *iccf-donations* - -Самая свежая информация доступна на веб-сайте организации ICCF! -См. раздел |iccf|. - - - США - Можно использовать методы, перечисленные ниже. Если - требуется отправить чек, то отправьте его нашему партнёру в - Канаде, адрес: https://www.kuwasha.net/ - - Канада - Свяжитесь с командой Kuwasha в гор. Сарри, Канада. Они - могут оказать содействие благотворителям из Канады для - помощи детям в гор. Кибаале. Команда Kuwasha переводит 100% - средств, поступивших в пользу проекта в Уганде. - Единовременное пожертвование может быть отправлено им - напрямую. - На их веб-сайте также можно ознакомиться с информацией по - оказанию финансовой поддержки https://www.kuwasha.net/ - При отправке пожертвований через Kuwasha вы получите - налоговое уведомление, которое можно будет подать вместе с - налоговой декларацией. - - Нидерланды - Перевод на счёт «Stichting ICCF Holland», Amersfoort. Можно - будет получить налоговый вычет, если вы проживаете в - Нидерландах. Банк ING, IBAN: NL95 INGB 0004 5487 74 - - Германия - Можно сделать пожертвование, дающее право на налоговый - вычет. Ознакомьтесь с последней информацией на веб-сайте - организации ICCF - https://iccf-holland.org/germany.html - - Европа - Банковский перевод. См. далее «Другие варианты», - где указан код Swift и номер IBAN. - Любые другие платёжные методы также должны работать. - Проконсультируйтесь по вопросу отправки средств на - благотворительные цели. - - Банковская карта - Можно воспользоваться платёжной системой PayPal для - отправки денег с банковской карты. Это наиболее - распространённая и чрезвычайно простая в использовании - платёжная система на основе сети Интернет. Больше информации - можно найти по адресу - https://www.paypal.com/en_US/mrb/pal=XAC62PML3GF8Q - Адрес электронной почты для обсуждения вопросов по - отправке средств - Bram@iccf-holland.org - - Другие варианты - Средства можно отправить на указанный ниже счёт. - Банк ING. IBAN: NL95 INGB 0004 5487 74 - Код SWIFT: INGBNL2A - на имя «stichting ICCF Holland», Amersfoort - Чеки не принимаются. - -============================================================================= - -© Казорин Сергей, перевод на русский язык, 2022, -© Restorer, редакторская правка, 2024, - - vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/src/GvimExt/gvimext.inf b/src/GvimExt/gvimext.inf index 8b45bb19eb..d2faf0b86b 100644 --- a/src/GvimExt/gvimext.inf +++ b/src/GvimExt/gvimext.inf @@ -16,7 +16,7 @@ HKCR,CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32 HKCR,*\shellex\ContextMenuHandlers\gvim HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved",{51EEE242-AD87-11d3-9C1E-0090278BBD99} HKLM,Software\Vim\Gvim -HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 6.0" +HKLM,"Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.1" [Strings] ThisDll="gvimext.dll" diff --git a/src/Makefile b/src/Makefile index 7f26c908c8..84496b3014 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1182,6 +1182,9 @@ KMAPSOURCE = ../runtime/keymap # Where to look for print resource files PRINTSOURCE = ../runtime/print +# Where to look translated README and LICENSE files +TRANSSOURCE = ../lang + # If you are using Linux, you might want to use this to make vim the # default vi editor, it will create a link from vi to Vim when doing # "make install". An existing file will be overwritten! @@ -2407,6 +2410,11 @@ installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(VIMTARGET) $(DEST_RT) \ chmod $(VIMSCRIPTMOD) $(SYS_INDOFF_FILE) $(INSTALL_DATA) $(SCRIPTSOURCE)/optwin.vim $(SYS_OPTWIN_FILE) chmod $(VIMSCRIPTMOD) $(SYS_OPTWIN_FILE) +# install README and LICENCE files + $(INSTALL_DATA) ../README.txt $(DEST_RT) + chmod $(HELPMOD) $(DEST_RT)/README.txt + $(INSTALL_DATA) ../LICENSE $(DEST_RT) + chmod $(HELPMOD) $(DEST_RT)/LICENSE # install the print resource files cd $(PRINTSOURCE); $(INSTALL_DATA) *.ps $(DEST_PRINT) cd $(DEST_PRINT); chmod $(FILEMOD) *.ps @@ -2545,7 +2553,7 @@ install-tool-languages: # install the language specific files, if they were unpacked -install-languages: languages $(DEST_LANG) $(DEST_KMAP) +install-languages: languages $(DEST_LANG) $(DEST_KMAP) $(DEST_RT) -$(SHELL) ./installman.sh install $(DEST_MAN_DA) "-da" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_DA_I) "-da" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_DA_U) "-da.UTF-8" $(INSTALLMANARGS) @@ -2621,6 +2629,29 @@ install-languages: languages $(DEST_LANG) $(DEST_KMAP) $(INSTALL_DATA) $(KMAPSOURCE)/README.txt $(KMAPSOURCE)/*.vim $(DEST_KMAP); \ chmod $(FILEMOD) $(DEST_KMAP)/README.txt $(DEST_KMAP)/*.vim; \ fi +# Installing translated README and LICENSE files + if test -d $(TRANSSOURCE) ; then \ + if test -n "$(LANG)" ; then \ + lngusr=$${LANG%%.*} ; \ + elif test -n "$(LANGUAGE)" ; then \ + lngusr=$${LANGUAGE%%:*} ; \ + elif test -n "$(LC_MESSAGES)" ; then \ + lngusr=$${LC_MESSAGES%%.*} ; \ + fi; \ + if test "$$lngusr" = "zh_TW" -o "$$lngusr" = "zh_CN" ; then \ + lngusr=`echo $$lngusr | tr '[:upper:]' '[:lower:]'` ; \ + elif test -n "$$lngusr" -a "$$lngusr" != "C" -a "$$lngusr" != "POSIX" ; then \ + lngusr=$${lngusr%%_*} ; \ + fi ; \ + if test -f $(TRANSSOURCE)/README.$$lngusr.txt ; then \ + $(INSTALL_DATA) $(TRANSSOURCE)/README.$$lngusr.txt $(DEST_RT) ; \ + chmod $(HELPMOD) $(DEST_RT)/README.$$lngusr.txt ; \ + fi ; \ + if test -f $(TRANSSOURCE)/LICENSE.$$lngusr.txt ; then \ + $(INSTALL_DATA) $(TRANSSOURCE)/LICENSE.$$lngusr.txt $(DEST_RT) ; \ + chmod $(HELPMOD) $(DEST_RT)/LICENSE.$$lngusr.txt ; \ + fi ; \ + fi # Install the icons for KDE, if the directory exists and the icon doesn't. # Always when $(DESTDIR) is not empty. @@ -2882,6 +2913,9 @@ uninstall_runtime: -rm -f $(DEST_PLUG)/*.vim $(DEST_PLUG)/README.txt -rmdir $(DEST_FTP) $(DEST_AUTO)/dist $(DEST_AUTO)/xml $(DEST_AUTO)/cargo $(DEST_AUTO)/rust $(DEST_AUTO) -rmdir $(DEST_IMPORT)/dist $(DEST_IMPORT) + -rm -f $(DEST_RT)/README.??.txt + -rm -f $(DEST_RT)/LICENSE.??.txt + -rm -f $(DEST_RT)/README.txt $(DEST_RT)/LICENSE -rmdir $(DEST_PLUG) $(DEST_RT) # This will fail when other Vim versions are installed, no worries. -rmdir $(DEST_VIM) diff --git a/src/version.c b/src/version.c index 624147ca7a..6e16a5e9b2 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1029, /**/ 1028, /**/ diff --git a/tools/rename.bat b/tools/rename.bat index 3df6352882..0037144795 100755 --- a/tools/rename.bat +++ b/tools/rename.bat @@ -1,38 +1,57 @@ @ 2>/dev/null # 2>nul & goto:win32 #!/bin/sh -if test -e ../src/vim.exe ; then mv ../src/vim.exe ../src/vimw32.exe ; fi -if test -e ../src/vim.pdb ; then mv ../src/vim.pdb ../src/vimw32.pdb ; fi -if test -e ../src/gvim.exe ; then mv ../src/gvim.exe ../src/gvim_ole.exe ; fi -if test -e ../src/gvim.pdb ; then mv ../src/gvim.pdb ../src/gvim_ole.pdb ; fi -if test -e ../src/install.exe ; - then - mv ../src/install.exe ../src/installw32.exe ; -fi -if test -e ../src/uninstall.exe ; - then - mv ../src/uninstall.exe ../src/uninstallw32.exe ; -fi -if test -e ../src/tee/tee.exe ; - then - mv ../src/tee/tee.exe ../src/teew32.exe ; -fi -if test -e ../src/xxd/xxd.exe ; - then - mv ../src/xxd/xxd.exe ../src/xxdw32.exe ; +if test -z "$1" ; then src=../src ; else src=$1 ; fi +if test -z "$2" ; then dst=${src} ; else dst=$2 ; fi +if test -f "${src}/vim.exe" ; + then mv -f "${src}/vim.exe" "${dst}/vimw32.exe" ; +fi +if test -f "${src}/vim.pdb" ; + then mv -f "${src}/vim.pdb" "${dst}/vimw32.pdb" ; +fi +if test -f "${src}/gvim.exe" ; + then mv -f "${src}/gvim.exe" "${dst}/gvim_ole.exe" ; +fi +if test -f "${src}/gvim.pdb" ; + then mv -f "${src}/gvim.pdb" "${dst}/gvim_ole.pdb" ; +fi +if test -f "${src}/install.exe" ; + then mv "${src}/install.exe" "${dst}/installw32.exe" ; +fi +if test -f "${src}/uninstall.exe" ; + then mv -f "${src}/uninstall.exe" "${dst}/uninstallw32.exe" ; +fi +if test -f "${src}/tee/tee.exe" ; + then mv -f "${src}/tee/tee.exe" "${dst}/teew32.exe" ; +elif test -f "${src}/tee.exe" ; + then mv -f "${src}/tee.exe" "${dst}/teew32.exe" ; +fi +if test -f "${src}/xxd/xxd.exe" ; + then mv -f "${src}/xxd/xxd.exe" "${dst}/xxdw32.exe" ; +elif test -f "${src}/xxd.exe" ; + then mv -f "${src}/xxd.exe" "${dst}/xxdw32.exe" ; fi # Uncomment return if the file is run through the command "source" #return exit :win32 -if exist mv.exe (set "mv=mv.exe -f") else (set "mv=move /y") -if exist ..\src\vim.exe %mv% ..\src\vim.exe ..\src\vimw32.exe -if exist ..\src\vim.pdb %mv% ..\src\vim.pdb ..\src\vimw32.pdb -if exist ..\src\gvim.exe %mv% ..\src\gvim.exe ..\src\gvim_ole.exe -if exist ..\src\gvim.pdb %mv% ..\src\gvim.pdb ..\src\gvim_ole.pdb -if exist ..\src\install.exe %mv% ..\src\install.exe ..\src\installw32.exe -if exist ..\src\uninstall.exe %mv% ..\src\uninstall.exe ..\src\uninstallw32.exe -if exist ..\src\tee\tee.exe %mv% ..\src\tee\tee.exe ..\src\teew32.exe -if exist ..\src\xxd\xxd.exe %mv% ..\src\xxd\xxd.exe ..\src\xxdw32.exe -set "mv=" +SetLocal +if exist mv.exe (set "mv=mv.exe -f") else (set "mv=move /Y") +if ""=="%~1" (set "src=..\src") else (set "src=%~1") +if ""=="%~2" (set "dst=%src%") else (set "dst=%~2") +if exist "%src%\vim.exe" %mv% "%src%\vim.exe" "%dst%\vimw32.exe" +if exist "%src%\vim.pdb" %mv% "%src%\vim.pdb" "%dst%\vimw32.pdb" +if exist "%src%\gvim.exe" %mv% "%src%\gvim.exe" "%dst%\gvim_ole.exe" +if exist "%src%\gvim.pdb" %mv% "%src%\gvim.pdb" "%dst%\gvim_ole.pdb" +if exist "%src%\install.exe" %mv% "%src%\install.exe" "%dst%\installw32.exe" +if exist "%src%\uninstall.exe" ( + %mv% "%src%\uninstall.exe" "%dst%\uninstallw32.exe" +) +if exist "%src%\tee\tee.exe" (%mv% "%src%\tee\tee.exe" "%dst%\teew32.exe" + ) else (if exist "%src%\tee.exe" %mv% "%src%\tee.exe" "%dst%\teew32.exe" +) +if exist "%src%\xxd\xxd.exe" (%mv% "%src%\xxd\xxd.exe" "%dst%\xxdw32.exe" + ) else (if exist "%src%\xxd.exe" %mv% "%src%\xxd.exe" "%dst%\xxdw32.exe" +) +EndLocal goto:EOF From c2a967a1b9adca6c929e3dc5c218dfada00059b6 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 17 Jan 2025 14:12:16 +0100 Subject: [PATCH 41/93] runtime(c): Update syntax and ftplugin files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - highlight more C keywords, including some from C23 Conditionally highlight C23 features: - #embed, #elifdef and #elifndef preprocessor directives - predefined macros - UTF-8 character constants - binary integer constants, _BitInt literals, and digit separators - nullptr_t type and associated constant - decimal real floating-point, bit precise and char types - typeof operators Matchit: - update for new preprocessor directives fixes: #13667 fixes: #13679 closes: #12984 Co-authored-by: Albin Ahlbäck Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/doc/syntax.txt | 1 + runtime/doc/tags | 1 + runtime/ftplugin/c.vim | 2 +- runtime/syntax/c.vim | 135 +++++++++++++++--- .../testdir/dumps/c_bool_constant_00.dump | 20 +++ .../testdir/dumps/c_bool_constant_01.dump | 20 +++ .../dumps/c_character_constant_00.dump | 20 +++ .../dumps/c_character_constant_01.dump | 20 +++ .../dumps/c_character_constant_02.dump | 20 +++ .../testdir/dumps/c_integer_constant_00.dump | 20 +++ .../testdir/dumps/c_integer_constant_01.dump | 20 +++ .../testdir/dumps/c_integer_constant_02.dump | 20 +++ .../dumps/c_preprocessor_conditional_00.dump | 20 +++ .../dumps/c_preprocessor_conditional_01.dump | 20 +++ .../dumps/c_preprocessor_conditional_02.dump | 20 +++ .../dumps/c_preprocessor_embed_00.dump | 20 +++ .../dumps/c_preprocessor_embed_01.dump | 20 +++ .../dumps/c_preprocessor_error_00.dump | 20 +++ .../testdir/dumps/c_string_literal_00.dump | 20 +++ .../testdir/dumps/c_string_literal_01.dump | 20 +++ .../testdir/dumps/c_string_literal_02.dump | 20 +++ .../testdir/dumps/c_string_literal_03.dump | 20 +++ 22 files changed, 481 insertions(+), 18 deletions(-) create mode 100644 runtime/syntax/testdir/dumps/c_bool_constant_00.dump create mode 100644 runtime/syntax/testdir/dumps/c_bool_constant_01.dump create mode 100644 runtime/syntax/testdir/dumps/c_character_constant_00.dump create mode 100644 runtime/syntax/testdir/dumps/c_character_constant_01.dump create mode 100644 runtime/syntax/testdir/dumps/c_character_constant_02.dump create mode 100644 runtime/syntax/testdir/dumps/c_integer_constant_00.dump create mode 100644 runtime/syntax/testdir/dumps/c_integer_constant_01.dump create mode 100644 runtime/syntax/testdir/dumps/c_integer_constant_02.dump create mode 100644 runtime/syntax/testdir/dumps/c_preprocessor_conditional_00.dump create mode 100644 runtime/syntax/testdir/dumps/c_preprocessor_conditional_01.dump create mode 100644 runtime/syntax/testdir/dumps/c_preprocessor_conditional_02.dump create mode 100644 runtime/syntax/testdir/dumps/c_preprocessor_embed_00.dump create mode 100644 runtime/syntax/testdir/dumps/c_preprocessor_embed_01.dump create mode 100644 runtime/syntax/testdir/dumps/c_preprocessor_error_00.dump create mode 100644 runtime/syntax/testdir/dumps/c_string_literal_00.dump create mode 100644 runtime/syntax/testdir/dumps/c_string_literal_01.dump create mode 100644 runtime/syntax/testdir/dumps/c_string_literal_02.dump create mode 100644 runtime/syntax/testdir/dumps/c_string_literal_03.dump diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 2fb320efcb..9b204780a7 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1062,6 +1062,7 @@ Variable Highlight ~ *c_no_cformat* don't highlight %-formats in strings *c_no_c99* don't highlight C99 standard items *c_no_c11* don't highlight C11 standard items +*c_no_c23* don't highlight C23 standard items *c_no_bsd* don't highlight BSD specific types *c_functions* highlight function calls and definitions *c_function_pointers* highlight function pointers definitions diff --git a/runtime/doc/tags b/runtime/doc/tags index 6d1bf96995..0e4c14c626 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -6360,6 +6360,7 @@ c_no_ansi syntax.txt /*c_no_ansi* c_no_bracket_error syntax.txt /*c_no_bracket_error* c_no_bsd syntax.txt /*c_no_bsd* c_no_c11 syntax.txt /*c_no_c11* +c_no_c23 syntax.txt /*c_no_c23* c_no_c99 syntax.txt /*c_no_c99* c_no_cformat syntax.txt /*c_no_cformat* c_no_curly_error syntax.txt /*c_no_curly_error* diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index 378d58065a..915861b8d5 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -44,7 +44,7 @@ endif " When the matchit plugin is loaded, this makes the % command skip parens and " braces in comments properly. if !exists("b:match_words") - let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' + let b:match_words = '^\s*#\s*if\%(\|def\|ndef\)\>:^\s*#\s*elif\%(\|def\|ndef\)\>:^\s*#\s*else\>:^\s*#\s*endif\>' let b:match_skip = 's:comment\|string\|character\|special' let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words" endif diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim index 30db9438d0..eb56239f3d 100644 --- a/runtime/syntax/c.vim +++ b/runtime/syntax/c.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: C -" Maintainer: The Vim Project -" Last Change: 2023 Aug 10 +" Language: C +" Maintainer: The Vim Project +" Last Change: 2025 Jan 15 " Former Maintainer: Bram Moolenaar " Quit when a (custom) syntax file was already loaded @@ -111,6 +111,20 @@ if (s:ft ==# "c" && !exists("c_no_c11")) || (s:in_cpp_family && !exists("cpp_no_ syn match cSpecialCharacter display "[Uu]'\\x\x\+'" endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp17")) + syn match cCharacter "u8'[^\\]'" + syn match cCharacter "u8'[^']*'" contains=cSpecial + if exists("c_gnu") + syn match cSpecialError "u8'\\[^'\"?\\abefnrtv]'" + syn match cSpecialCharacter "u8'\\['\"?\\abefnrtv]'" + else + syn match cSpecialError "u8'\\[^'\"?\\abfnrtv]'" + syn match cSpecialCharacter "u8'\\['\"?\\abfnrtv]'" + endif + syn match cSpecialCharacter display "u8'\\\o\{1,3}'" + syn match cSpecialCharacter display "u8'\\x\x\+'" +endif + "when wanted, highlight trailing white space if exists("c_space_errors") if !exists("c_no_trail_space_error") @@ -191,12 +205,25 @@ syn case ignore syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal " Same, but without octal error (for comments) syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal -syn match cNumber display contained "\d\+\%(u\=l\{0,2}\|ll\=u\)\>" -"hex number -syn match cNumber display contained "0x\x\+\%(u\=l\{0,2}\|ll\=u\)\>" -" Flag the first zero of an octal number as something special -syn match cOctal display contained "0\o\+\%(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero -syn match cOctalZero display contained "\<0" + +" cpp.vim handles these +if !exists("c_no_c23") && !s:in_cpp_family + syn match cNumber display contained "\d\%('\=\d\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" + "hex number + syn match cNumber display contained "0x\x\%('\=\x\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" + " Flag the first zero of an octal number as something special + syn match cOctal display contained "0\o\%('\=\o\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" contains=cOctalZero + "binary number + syn match cNumber display contained "0b[01]\%('\=[01]\+\)*\%(u\=l\{0,2}\|ll\=u\|u\=wb\|wbu\=\)\>" +else + syn match cNumber display contained "\d\+\%(u\=l\{0,2}\|ll\=u\)\>" + "hex number + syn match cNumber display contained "0x\x\+\%(u\=l\{0,2}\|ll\=u\)\>" + " Flag the first zero of an octal number as something special + syn match cOctal display contained "0\o\+\%(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero + syn match cOctalZero display contained "\<0" +endif + "floating point number, with dot, optional exponent syn match cFloat display contained "\d\+\.\d*\%(e[-+]\=\d\+\)\=[fl]\=" "floating point number, starting with a dot, optional exponent @@ -277,6 +304,13 @@ if !exists("c_no_c99") " ISO C99 syn keyword cType intptr_t uintptr_t syn keyword cType intmax_t uintmax_t endif +if !exists("c_no_c23") && !s:in_cpp_family + syn keyword cOperator typeof typeof_unqual + syn keyword cType _BitInt _Decimal32 _Decimal64 _Decimal128 +endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) + syn keyword cType nullptr_t +endif syn keyword cTypedef typedef syn keyword cStructure struct union enum @@ -312,10 +346,15 @@ if !exists("c_no_c11") syn keyword cType atomic_intmax_t atomic_uintmax_t endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp20")) + syn keyword cType char8_t +endif + if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") if exists("c_gnu") syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ __func__ endif + " TODO: __STDC_HOSTED__ is C99 and C++11 syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ __STDC_VERSION__ __STDC_HOSTED__ syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX @@ -324,6 +363,8 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX if !exists("c_no_c99") + syn keyword cConstant __STDC_ISO_10646__ __STDC_IEC_559_COMPLEX__ + syn keyword cConstant __STDC_MB_MIGHT_NEQ_WC__ syn keyword cConstant __func__ __VA_ARGS__ syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN @@ -340,6 +381,26 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX endif + if !exists("c_no_c11") + syn keyword cConstant __STDC_UTF_16__ __STDC_UTF_32__ __STDC_ANALYZABLE__ + syn keyword cConstant __STDC_LIB_EXT1__ __STDC_NO_ATOMICS__ + syn keyword cConstant __STDC_NO_COMPLEX__ __STDC_NO_THREADS__ + syn keyword cConstant __STDC_NO_VLA__ + endif + if !exists("c_no_c23") + syn keyword cConstant __STDC_UTF_16__ __STDC_UTF_32__ + syn keyword cConstant __STDC_EMBED_NOT_FOUND__ __STDC_EMBED_FOUND__ + syn keyword cConstant __STDC_EMBED_EMPTY__ __STDC_IEC_60559_BFP__ + syn keyword cConstant __STDC_IEC_60559_DFP__ __STDC_IEC_60559_COMPLEX__ + syn keyword cConstant __STDC_IEC_60559_TYPES__ + syn keyword cConstant BITINT_MAXWIDTH + endif + if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp20")) + syn keyword cConstant __VA_OPT__ + endif + if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) + syn keyword cConstant nullptr + endif syn keyword cConstant FLT_RADIX FLT_ROUNDS FLT_DIG FLT_MANT_DIG FLT_EPSILON DBL_DIG DBL_MANT_DIG DBL_EPSILON syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MAX_10_EXP syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP DBL_MIN_10_EXP DBL_MAX_10_EXP LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP @@ -377,37 +438,77 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") endif if !exists("c_no_c99") " ISO C99 syn keyword cConstant true false + syn keyword cConstant INFINITY NAN + " math.h + syn keyword cConstant HUGE_VAL HUGE_VALF HUGE_VALL + syn keyword cConstant FP_FAST_FMAF FP_FAST_FMA FP_FAST_FMAL + syn keyword cConstant FP_ILOGB0 FP_ILOGBNAN + syn keyword cConstant math_errhandling MATH_ERRNO MATH_ERREXCEPT + syn keyword cConstant FP_NORMAL FP_SUBNORMAL FP_ZERO FP_INFINITE FP_NAN endif " Accept %: for # (C99) -syn region cPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock +if !exists("c_no_c23") + syn region cPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(el\)\=\%(if\|ifdef\|ifndef\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +else + syn region cPreCondit start="^\s*\zs\%(%:\|#\)\s*\%(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError +endif syn match cPreConditMatch display "^\s*\zs\%(%:\|#\)\s*\%(else\|endif\)\>" if !exists("c_no_if0") syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip syn region cCppOutWrapper start="^\s*\zs\%(%:\|#\)\s*if\s\+0\+\s*\%($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\%(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse if !exists("c_no_if0_fold") - syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + if !exists("c_no_c23") + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + else + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold + endif else - syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + if !exists("c_no_c23") + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + else + syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0\+\s*\%($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell + endif + endif + if !exists("c_no_c23") + syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|el\%(if\|ifdef\|ifndef\)\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit + else + syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit endif - syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit syn region cCppInWrapper start="^\s*\zs\%(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\%($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\%(%:\|#\)\s*endif\>" contains=TOP,cPreCondit if !exists("c_no_if0_fold") - syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + if !exists("c_no_c23") + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + else + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold + endif + else + if !exists("c_no_c23") + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|el\%(if\|ifdef\|ifndef\)\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + else + syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + endif + endif + if !exists("c_no_c23") + syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|el\%(if\|ifdef\|ifndef\)\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell else - syn region cCppInElse contained start="^\s*\%(%:\|#\)\s*\%(else\>\|elif\s\+\%(0*[1-9]\d*\s*\%($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 + syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell endif - syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(else\|elif\)\%([^/]\|/[^/*]\)*" end="^\s*\%(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell syn region cCppOutSkip contained start="^\s*\%(%:\|#\)\s*\%(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\%(%:\|#\)\s*\%(if\s\+\%(\d\+\s*\%($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\%(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc endif syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ syn match cIncluded display contained "<[^>]*>" syn match cInclude display "^\s*\zs\%(%:\|#\)\s*include\>\s*["<]" contains=cIncluded +if !exists("c_no_c23") && !s:in_cpp_family + syn region cInclude start="^\s*\zs\%(%:\|#\)\s*embed\>" skip="\\$" end="$" keepend contains=cEmbed,cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError + syn match cEmbed contained "\%(%:\|#\)\s*embed\>" nextgroup=cIncluded skipwhite transparent + syn cluster cPreProcGroup add=cEmbed +endif "syn match cLineSkip "\\$" -syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock syn region cDefine start="^\s*\zs\%(%:\|#\)\s*\%(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell syn region cPreProc start="^\s*\zs\%(%:\|#\)\s*\%(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell diff --git a/runtime/syntax/testdir/dumps/c_bool_constant_00.dump b/runtime/syntax/testdir/dumps/c_bool_constant_00.dump new file mode 100644 index 0000000000..6aff5d9573 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_bool_constant_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |b|o@1|l|e|a|n| |c|o|n|s|t|a|n|t|s| +0#0000000&@52 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|l|a|n|g|u|a|g|e|/|b|o@1|l|_|c|o|n|s|t|a|n|t| +0#0000000&@9 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|a|s@1|e|r|t|.|h|>| +0#0000000&@55 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|)| @64 +|{| @73 +@4|a|s@1|e|r|t|(|t+0#e000002&|r|u|e| +0#0000000&|=@1| |1+0#e000002&| +0#0000000&|&@1| |0+0#e000002&| +0#0000000&|=@1| |f+0#e000002&|a|l|s|e|)+0#0000000&|;| @38 +|}| @73 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/c_bool_constant_01.dump b/runtime/syntax/testdir/dumps/c_bool_constant_01.dump new file mode 100644 index 0000000000..b1d4e57321 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_bool_constant_01.dump @@ -0,0 +1,20 @@ +> +0&#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|0|,|0|-|1| @8|A|l@1| diff --git a/runtime/syntax/testdir/dumps/c_character_constant_00.dump b/runtime/syntax/testdir/dumps/c_character_constant_00.dump new file mode 100644 index 0000000000..458e2b8078 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_character_constant_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s| +0#0000000&@50 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|l|a|n|g|u|a|g|e|/|c|h|a|r|a|c|t|e|r|_|c|o|n|s|t|a|n|t| +0#0000000&@4 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d@1|e|f|.|h|>| +0#0000000&@55 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|u|c|h|a|r|.|h|>| +0#0000000&@56 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n| |(|v+0#00e0003&|o|i|d|)+0#0000000&| @59 +|{| @73 +@4|p|r|i|n|t|f|(|"+0#e000002&|c|o|n|s|t|a|n|t| |v|a|l|u|e| @4|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @38 +@4|p|r|i|n|t|f|(|"+0#e000002&|-@7| |-@9|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @38 +@75 +@4|/+0#0000e05&@1| |i|n|t|e|g|e|r| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s|,| +0#0000000&@39 +@4|i+0#00e0003&|n|t| +0#0000000&|c|1|=|'+0#e000002&|a|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|a|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |c|1|)|;| @28 +@4|i+0#00e0003&|n|t| +0#0000000&|c|2|=|'+0#e000002&|🍌*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|🍌*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |c|2|)|;| |/+0#0000e05&@1| |i|m|p|l|e|m|e|n|t|a|t|i|o|n|-|d|e|f|i|n|e +|d| +0#0000000&@73 +@75 +@4|/+0#0000e05&@1| |m|u|l|t|i|c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t| +0#0000000&@44 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_character_constant_01.dump b/runtime/syntax/testdir/dumps/c_character_constant_01.dump new file mode 100644 index 0000000000..f0ed04d32b --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_character_constant_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|/+0#0000e05&@1| |i|n|t|e|g|e|r| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s|,| +0#0000000&@39 +@4|i+0#00e0003&|n|t| +0#0000000&|c|1|=|'+0#e000002&|a|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|a|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |c|1|)|;| @28 +@4|i+0#00e0003&|n|t| +0#0000000&|c|2|=|'+0#e000002&|🍌*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|🍌*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |c|2|)|;| |/+0#0000e05&@1| |i|m|p|l|e|m|e|n|t|a|t|i|o|n|-|d|e|f|i|n|e +|d| +0#0000000&@73 +@75 +@4>/+0#0000e05&@1| |m|u|l|t|i|c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t| +0#0000000&@44 +@4|i+0#00e0003&|n|t| +0#0000000&|c|3|=|'|a|b|'|;| |p|r|i|n|t|f|(|"+0#e000002&|'|a|b|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |c|3|)|;| |/+0#0000e05&@1| |i|m|p|l|e|m|e|n|t|a|t|i|o|n|-|d|e|f|i|n|e +|d| +0#0000000&@73 +@75 +@4|/+0#0000e05&@1| |1|6|-|b|i|t| |w|i|d|e| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s| +0#0000000&@36 +@4|c+0#00e0003&|h|a|r|1|6|_|t| +0#0000000&|u|c|1| |=| |u+0#e000002&|'|a|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|a|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|u|c|1|)|;| @13 +@4|c+0#00e0003&|h|a|r|1|6|_|t| +0#0000000&|u|c|2| |=| |u+0#e000002&|'|¢|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|¢|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|u|c|2|)|;| @13 +@4|c+0#00e0003&|h|a|r|1|6|_|t| +0#0000000&|u|c|3| |=| |u+0#e000002&|'|猫*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|猫*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|u|c|3|)|;| @11 +@4|/+0#0000e05&@1| |i|m|p|l|e|m|e|n|t|a|t|i|o|n|-|d|e|f|i|n|e|d| |(|🍌*&| +&|m|a|p|s| |t|o| |t|w|o| |1|6|-|b|i|t| |c|h|a|r|a|c|t|e|r|s|)| +0#0000000&@10 +@4|c+0#00e0003&|h|a|r|1|6|_|t| +0#0000000&|u|c|4| |=| |u+0#e000002&|'|🍌*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|🍌*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|u|c|4|)|;| @9 +@75 +@4|/+0#0000e05&@1| |3|2|-|b|i|t| |w|i|d|e| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s| +0#0000000&@36 +@4|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|U|c|1| |=| |U+0#e000002&|'|a|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|a|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|U|c|1|)|;| @13 +@4|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|U|c|2| |=| |U+0#e000002&|'|¢|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|¢|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|U|c|2|)|;| @13 +@57|1|8|,|5| @9|5|6|%| diff --git a/runtime/syntax/testdir/dumps/c_character_constant_02.dump b/runtime/syntax/testdir/dumps/c_character_constant_02.dump new file mode 100644 index 0000000000..e08b11b9db --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_character_constant_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|U|c|2| |=| |U+0#e000002&|'|¢|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|¢|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|U|c|2|)|;| @13 +@4|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|U|c|3| |=| |U+0#e000002&|'|猫*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|猫*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|U|c|3|)|;| @11 +@4|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|U|c|4| |=| |U+0#e000002&|'|🍌*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|🍌*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|U|c|4|)|;| @9 +@75 +@4|/+0#0000e05&@1| |w|i|d|e| |c|h|a|r|a|c|t|e|r| |c|o|n|s|t|a|n|t|s| +0#0000000&@43 +@4>w+0#00e0003&|c|h|a|r|_|t| +0#0000000&|w|c|1| |=| |L+0#e000002&|'|a|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|a|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|w|c|1|)|;| @14 +@4|w+0#00e0003&|c|h|a|r|_|t| +0#0000000&|w|c|2| |=| |L+0#e000002&|'|¢|'|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|¢|'|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|w|c|2|)|;| @14 +@4|w+0#00e0003&|c|h|a|r|_|t| +0#0000000&|w|c|3| |=| |L+0#e000002&|'|猫*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|猫*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|w|c|3|)|;| @12 +@4|w+0#00e0003&|c|h|a|r|_|t| +0#0000000&|w|c|4| |=| |L+0#e000002&|'|🍌*&|'+&|;+0#0000000&| |p|r|i|n|t|f|(|"+0#e000002&|'|🍌*&|'+&|:|\+0#e000e06&|t| +0#e000002&|%+0#e000e06&|#|0|1|0|x|\|n|\|n|"+0#e000002&|,+0#0000000&| |(|i+0#00e0003&|n|t|)+0#0000000&|w|c|4|)|;| @10 +|}| @73 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|5|,|5| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/c_integer_constant_00.dump b/runtime/syntax/testdir/dumps/c_integer_constant_00.dump new file mode 100644 index 0000000000..2a87e5bc2f --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_integer_constant_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |i|n|t|e|g|e|r| |c|o|n|s|t|a|n|t|s| +0#0000000&@52 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|l|a|n|g|u|a|g|e|/|i|n|t|e|g|e|r|_|c|o|n|s|t|a|n|t| +0#0000000&@6 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|i|n|t@1|y|p|e|s|.|h|>| +0#0000000&@53 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @60 +|{| @73 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|2|3| |=| |%+0#e000e06&|d|\|n|"+0#e000002&|,+0#0000000&| |1+0#e000002&|2|3|)+0#0000000&|;| @44 +@4|p|r|i|n|t|f|(|"+0#e000002&|0|1|2|3| |=| |%+0#e000e06&|d|\|n|"+0#e000002&|,+0#0000000&| |0+0#e000002&|1|2|3|)+0#0000000&|;| @42 +@4|p|r|i|n|t|f|(|"+0#e000002&|0|x|1|2|3| |=| |%+0#e000e06&|d|\|n|"+0#e000002&|,+0#0000000&| |0+0#e000002&|x|1|2|3|)+0#0000000&|;| @40 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u|l@1| |=| |%+0#e000e06&|l@1|u|\|n|"+0#e000002&|,+0#0000000&| |1+0#e000002&|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u|l@1|)+0#0000000&|;| @2 +@4|/+0#0000e05&@1| |t|h|e| |t|y|p|e| |i|s| |a| |6|4|-|b|i|t| |t|y|p|e| |(|u|n|s|i|g|n|e|d| |l|o|n|g| |l|o|n|g| |o|r| |p|o|s@1|i|b|l|y| |u|n|s|i|g|n|e|d| |l +|o|n|g|)| +0#0000000&@70 +@4|/+0#0000e05&@1| |e|v|e|n| |w|i|t|h|o|u|t| |a| |l|o|n|g| |s|u|f@1|i|x| +0#0000000&@41 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u| |=| |%|"|P+0#0000000&|R|I|u|6|4|"+0#e000002&|\+0#e000e06&|n|"+0#e000002&|,+0#0000000&| |1+0#e000002&|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u| +0#0000000&|)|;| +@75 +@4|/+0#0000e05&@1| |p|r|i|n|t|f|(|"|%|l@1|d|\|n|"|,| |-|9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8|)|;| |/@1| |E|r@1|o|r|:| +0#0000000&@18 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_integer_constant_01.dump b/runtime/syntax/testdir/dumps/c_integer_constant_01.dump new file mode 100644 index 0000000000..f1ebddd15a --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_integer_constant_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|/+0#0000e05&@1| |t|h|e| |t|y|p|e| |i|s| |a| |6|4|-|b|i|t| |t|y|p|e| |(|u|n|s|i|g|n|e|d| |l|o|n|g| |l|o|n|g| |o|r| |p|o|s@1|i|b|l|y| |u|n|s|i|g|n|e|d| |l +|o|n|g|)| +0#0000000&@70 +@4|/+0#0000e05&@1| |e|v|e|n| |w|i|t|h|o|u|t| |a| |l|o|n|g| |s|u|f@1|i|x| +0#0000000&@41 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u| |=| |%|"|P+0#0000000&|R|I|u|6|4|"+0#e000002&|\+0#e000e06&|n|"+0#e000002&|,+0#0000000&| |1+0#e000002&|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|u| +0#0000000&|)|;| +@75 +@4>/+0#0000e05&@1| |p|r|i|n|t|f|(|"|%|l@1|d|\|n|"|,| |-|9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8|)|;| |/@1| |E|r@1|o|r|:| +0#0000000&@18 +@8|/+0#0000e05&@1| |t|h|e| |v|a|l|u|e| |9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8| |c|a|n@1|o|t| |f|i|t| |i|n| |s|i|g|n|e|d| |l|o|n|g| |l|o|n|g|,| |w|h +|i|c|h| +0#0000000&@71 +@8|/+0#0000e05&@1| |i|s| |t|h|e| |b|i|g@1|e|s|t| |t|y|p|e| |a|l@1|o|w|e|d| |f|o|r| |u|n|s|u|f@1|i|x|e|d| |d|e|c|i|m|a|l| |i|n|t|e|g|e|r| |c|o|n|s|t +|a|n|t| +0#0000000&@71 +@75 +@4|p|r|i|n|t|f|(|"+0#e000002&|%+0#e000e06&|l@1|u|\|n|"+0#e000002&|,+0#0000000&| |-|9+0#e000002&|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8|u|l@1| +0#0000000&|)|;| @27 +@4|/+0#0000e05&@1| |u|n|a|r|y| |m|i|n|u|s| |a|p@1|l|i|e|d| |t|o| |u|n|s|i|g|n|e|d| |v|a|l|u|e| |s|u|b|t|r|a|c|t|s| |i|t| |f|r|o|m| |2|^|6|4|,| +0#0000000&@6 +@4|/+0#0000e05&@1| |t|h|i|s| |g|i|v|e|s| |u|n|s|i|g|n|e|d| |9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8| +0#0000000&@28 +@75 +@4|p|r|i|n|t|f|(|"+0#e000002&|%+0#e000e06&|l@1|d|\|n|"+0#e000002&|,+0#0000000&| |-|9+0#e000002&|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|7|l@1| +0#0000000&|-| |1+0#e000002&|)+0#0000000&|;| @25 +@4|/+0#0000e05&@1| |c|o|r@1|e|c|t| |w|a|y| |t|o| |f|o|r|m| |s|i|g|n|e|d| |v|a|l|u|e| |-|9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8| +0#0000000&@14 +|}| @73 +@75 +@57|1|8|,|5| @9|5|2|%| diff --git a/runtime/syntax/testdir/dumps/c_integer_constant_02.dump b/runtime/syntax/testdir/dumps/c_integer_constant_02.dump new file mode 100644 index 0000000000..0fd7251643 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_integer_constant_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|i+0#00e0003&|n|t| +0#0000000&|d| |=| |4+0#e000002&|2|;+0#0000000&| @63 +|i+0#00e0003&|n|t| +0#0000000&|o| |=| |0+0#e000002&|5|2|;+0#0000000&| @62 +|i+0#00e0003&|n|t| +0#0000000&|x| |=| |0+0#e000002&|x|2|a|;+0#0000000&| @61 +|i+0#00e0003&|n|t| +0#0000000&|X| |=| |0+0#e000002&|X|2|A|;+0#0000000&| @61 +>i+0#00e0003&|n|t| +0#0000000&|b| |=| |0+0#e000002&|b|1|0|1|0|1|0|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@50 +@75 +|/+0#0000e05&@1| |T|h|e| |f|o|l@1|o|w|i|n|g| |v|a|r|i|a|b|l|e|s| |a|r|e| |a|l|s|o| |i|n|i|t|i|a|l|i|z|e|d| |t|o| |t|h|e| |s|a|m|e| |v|a|l|u|e|:| +0#0000000&@8 +@75 +|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|1| |=| |1+0#e000002&|8|4@1|6|7|4@1|0|7|3|7|0|9|5@1|0|5|9|2|u|l@1|;+0#0000000&| |/+0#0000e05&@1| |C|9@1| +0#0000000&@19 +|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|2| |=| |1+0#e000002&|8|'|4@1|6|'|7|4@1|'|0|7|3|'|7|0|9|'|5@1|0|'|5|9|2|l@1|u|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@13 +|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|3| |=| |1+0#e000002&|8|4@1|'|6|7|4@1|'|0|7|3|7|'|0|9|5@1|'|0|5|9|2|u|L@1|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@15 +|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|4| |=| |1+0#e000002&|8|4@1|6|7|'|4@1|0|7|3|7|'|0|'|9|5@1|0|5|'|9|2|L@1|U|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@15 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|4|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_conditional_00.dump b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_00.dump new file mode 100644 index 0000000000..c8a8e3a4f1 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |p|r|e|p|r|o|c|e|s@1|o|r| |-| |c|o|n|d|i|t|i|o|n|a|l| |i|n|c|l|u|s|i|o|n| +0#0000000&@33 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|p|r|e|p|r|o|c|e|s@1|o|r|/|c|o|n|d|i|t|i|o|n|a|l| +0#0000000&@7 +@75 +|#+0#e000e06&|d|e|f|i|n|e| |A|B|C|D| |2+0#e000002&| +0#0000000&@60 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @60 +|{| @73 +@75 +|#+0#e000e06&|i|f|d|e|f| |A|B|C|D| +0#0000000&@63 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|:| |y|e|s|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|p|r|i|n|t|f|(|"+0#e000002&|1|:| |n|o|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @52 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|#+0#e000e06&|i|f|n|d|e|f| |A|B|C|D| +0#0000000&@62 +@4|p|r|i|n|t|f|(|"+0#e000002&|2|:| |n|o|1|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|l|i|f| |A|B|C|D| |=@1| |2+0#e000002&| +0#0000000&@59 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_conditional_01.dump b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_01.dump new file mode 100644 index 0000000000..c63205e87f --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|p|r|i|n|t|f|(|"+0#e000002&|1|:| |n|o|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @52 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|#+0#e000e06&|i|f|n|d|e|f| |A|B|C|D| +0#0000000&@62 +@4|p|r|i|n|t|f|(|"+0#e000002&|2|:| |n|o|1|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +>#+0#e000e06&|e|l|i|f| |A|B|C|D| |=@1| |2+0#e000002&| +0#0000000&@59 +@4|p|r|i|n|t|f|(|"+0#e000002&|2|:| |y|e|s|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|p|r|i|n|t|f|(|"+0#e000002&|2|:| |n|o|2|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|#+0#e000e06&|i|f| |!|d|e|f|i|n|e|d|(|D|C|B|A|)| |&@1| |(|A|B|C|D| |<| |2+0#e000002&| +0#e000e06&|*| |4+0#e000002&| +0#e000e06&|-| |3+0#e000002&|)+0#e000e06&| +0#0000000&@34 +@4|p|r|i|n|t|f|(|"+0#e000002&|3|:| |y|e|s|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|/+0#0000e05&@1| |C|2|3| |d|i|r|e|c|t|i|v|e|s| |#|e|l|i|f|d|e|f|/|#|e|l|i|f|n|d|e|f| +0#0000000&@38 +|#+0#e000e06&|i|f|d|e|f| |C|P|U| +0#0000000&@64 +@4|p|r|i|n|t|f|(|"+0#e000002&|4|:| |n|o|1|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|l|i|f|d|e|f| |G|P|U| +0#0000000&@62 +@57|1|9|,|1| @9|6|1|%| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_conditional_02.dump b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_02.dump new file mode 100644 index 0000000000..17bbac19f0 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_conditional_02.dump @@ -0,0 +1,20 @@ +|#+0#e000e06#ffffff0|e|l|i|f|d|e|f| |G|P|U| +0#0000000&@62 +@4|p|r|i|n|t|f|(|"+0#e000002&|4|:| |n|o|2|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @51 +|#+0#e000e06&|e|l|i|f|n|d|e|f| |R|A|M| +0#0000000&@61 +@4|p|r|i|n|t|f|(|"+0#e000002&|4|:| |y|e|s|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| |/+0#0000e05&@1| |s|e|l|e|c|t|e|d| |i|n| |C|2|3| |m|o|d|e|,| |m|a|y| |b|e| |s|e|l|e|c|t|e|d| |i|n| |p|r|e|-|C|2|3 +| |m|o|d|e| +0#0000000&@69 +>#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|p|r|i|n|t|f|(|"+0#e000002&|4|:| |n|o|3|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| |/+0#0000e05&@1| |m|a|y| |b|e| |s|e|l|e|c|t|e|d| |i|n| |p|r|e|-|C|2|3| |m|o|d|e| +0#0000000&@16 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +|}| @73 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|3|6|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_embed_00.dump b/runtime/syntax/testdir/dumps/c_preprocessor_embed_00.dump new file mode 100644 index 0000000000..ead46401e4 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_embed_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |p|r|e|p|r|o|c|e|s@1|o|r| |-| |b|i|n|a|r|y| |r|e|s|o|u|r|c|e| |i|n|c|l|u|s|i|o|n| +0#0000000&@29 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|p|r|e|p|r|o|c|e|s@1|o|r|/|e|m|b|e|d| +0#0000000&@13 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|n|t|.|h|>| +0#0000000&@55 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +@75 +|c+0#00e0003&|o|n|s|t| +0#0000000&|u+0#00e0003&|i|n|t|8|_|t| +0#0000000&|i|m|a|g|e|_|d|a|t|a|[|]| |=| |{| @44 +|#+0#e000e06&|e|m|b|e|d| |"+0#e000002&|i|m|a|g|e|.|p|n|g|"| +0#0000000&@56 +|}|;| @72 +@75 +|c+0#00e0003&|o|n|s|t| +0#0000000&|c+0#00e0003&|h|a|r| +0#0000000&|m|e|s@1|a|g|e|[|]| |=| |{| @50 +|#+0#e000e06&|e|m|b|e|d| |"+0#e000002&|m|e|s@1|a|g|e|.|t|x|t|"| +0#e000e06&|i|f|_|e|m|p|t|y|(|'+0#e000002&|M|'|,+0#e000e06&| |'+0#e000002&|i|'|,+0#e000e06&| |'+0#e000002&|s|'|,+0#e000e06&| |'+0#e000002&|s|'|,+0#e000e06&| |'+0#e000002&|i|'|,+0#e000e06&| |'+0#e000002&|n|'|,+0#e000e06&| |'+0#e000002&|g|'|,+0#e000e06&| |'|\|n|'|)| +0#0000000&@4 +|,|'+0#e000e06&|\|0|'| +0#0000000&|/+0#0000e05&@1| |n|u|l@1| |t|e|r|m|i|n|a|t|o|r| +0#0000000&@50 +|}|;| @72 +@75 +|v+0#00e0003&|o|i|d| +0#0000000&|d|u|m|p|(|c+0#00e0003&|o|n|s|t| +0#0000000&|u+0#00e0003&|i|n|t|8|_|t| +0#0000000&|a|r@1|[|]|,| |s+0#00e0003&|i|z|e|_|t| +0#0000000&|s|i|z|e|)| @31 +|{| @73 +@4|f+0#af5f00255&|o|r| +0#0000000&|(|s+0#00e0003&|i|z|e|_|t| +0#0000000&|i| |=| |0+0#e000002&|;+0#0000000&| |i| |!|=| |s|i|z|e|;| |+@1|i|)| @36 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_embed_01.dump b/runtime/syntax/testdir/dumps/c_preprocessor_embed_01.dump new file mode 100644 index 0000000000..0f594266a8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_embed_01.dump @@ -0,0 +1,20 @@ +|,+0&#ffffff0|'+0#e000e06&|\|0|'| +0#0000000&|/+0#0000e05&@1| |n|u|l@1| |t|e|r|m|i|n|a|t|o|r| +0#0000000&@50 +|}|;| @72 +@75 +|v+0#00e0003&|o|i|d| +0#0000000&|d|u|m|p|(|c+0#00e0003&|o|n|s|t| +0#0000000&|u+0#00e0003&|i|n|t|8|_|t| +0#0000000&|a|r@1|[|]|,| |s+0#00e0003&|i|z|e|_|t| +0#0000000&|s|i|z|e|)| @31 +|{| @73 +@4>f+0#af5f00255&|o|r| +0#0000000&|(|s+0#00e0003&|i|z|e|_|t| +0#0000000&|i| |=| |0+0#e000002&|;+0#0000000&| |i| |!|=| |s|i|z|e|;| |+@1|i|)| @36 +@8|p|r|i|n|t|f|(|"+0#e000002&|%+0#e000e06&|0|2|X|%|c|"+0#e000002&|,+0#0000000&| |a|r@1|[|i|]|,| |(|i| |+| |1+0#e000002&|)+0#0000000&| |%| |1+0#e000002&|6| +0#0000000&|?| |'+0#e000002&| |'| +0#0000000&|:| |'+0#e000e06&|\|n|'|)+0#0000000&|;| @14 +@4|p|u|t|s|(|"+0#e000002&@1|)+0#0000000&|;| @61 +|}| @73 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|)| @64 +|{| @73 +@4|p|u|t|s|(|"+0#e000002&|i|m|a|g|e|_|d|a|t|a|[|]|:|"|)+0#0000000&|;| @48 +@4|d|u|m|p|(|i|m|a|g|e|_|d|a|t|a|,| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|i|m|a|g|e|_|d|a|t|a|)|;| @34 +@4|p|u|t|s|(|"+0#e000002&|m|e|s@1|a|g|e|[|]|:|"|)+0#0000000&|;| @51 +@4|d|u|m|p|(@1|c+0#00e0003&|o|n|s|t| +0#0000000&|u+0#00e0003&|i|n|t|8|_|t|*+0#0000000&|)|m|e|s@1|a|g|e|,| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|m|e|s@1|a|g|e|)|;| @24 +|}| @73 +@75 +|~+0#4040ff13&| @73 +| +0#0000000&@56|1|9|,|5| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/c_preprocessor_error_00.dump b/runtime/syntax/testdir/dumps/c_preprocessor_error_00.dump new file mode 100644 index 0000000000..b178efee79 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_preprocessor_error_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |p|r|e|p|r|o|c|e|s@1|o|r| |-| |d|i|a|g|n|o|s|t|i|c| |d|i|r|e|c|t|i|v|e|s| +0#0000000&@33 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|p|r|e|p|r|o|c|e|s@1|o|r|/|e|r@1|o|r| +0#0000000&@13 +@75 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_@1| |!|=| |1+0#e000002&| +0#0000000&@57 +|#+0#e000e06&| @1|e|r@1|o|r| |"+0#e000002&|N|o|t| |a| |s|t|a|n|d|a|r|d| |c|o|m|p|l|i|a|n|t| |c|o|m|p|i|l|e|r|"| +0#0000000&@30 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +|#+0#e000e06&| @1|w|a|r|n|i|n|g| |"+0#e000002&|U|s|i|n|g| |#|w|a|r|n|i|n|g| |a|s| |a| |s|t|a|n|d|a|r|d| |f|e|a|t|u|r|e|"| +0#0000000&@25 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n| |(|v+0#00e0003&|o|i|d|)+0#0000000&| @59 +|{| @73 +@4|p|r|i|n|t|f|(|"+0#e000002&|T|h|e| |c|o|m|p|i|l|e|r| |u|s|e|d| |c|o|n|f|o|r|m|s| |t|o| |t|h|e| |I|S|O| |C| |S|t|a|n|d|a|r|d| |!@1|"|)+0#0000000&|;| @8 +|}| @73 +@75 +@57|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/c_string_literal_00.dump b/runtime/syntax/testdir/dumps/c_string_literal_00.dump new file mode 100644 index 0000000000..65f222db5f --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_string_literal_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |s|t|r|i|n|g| |l|i|t|e|r|a|l|s| +0#0000000&@54 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|l|a|n|g|u|a|g|e|/|s|t|r|i|n|g|_|l|i|t|e|r|a|l| +0#0000000&@8 +@75 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|i|n|t@1|y|p|e|s|.|h|>| +0#0000000&@53 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|l|o|c|a|l|e|.|h|>| +0#0000000&@55 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d@1|e|f|.|h|>| +0#0000000&@55 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@56 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|l|i|b|.|h|>| +0#0000000&@55 +|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|u|c|h|a|r|.|h|>| +0#0000000&@56 +@75 +|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @60 +|{| @73 +@4|c+0#00e0003&|h|a|r| +0#0000000&|s|1|[|]| |=| |"+0#e000002&|a|猫*&|🍌|"+&|;+0#0000000&| |/+0#0000e05&@1| |o|r| |"|a|\|u|7|3|2|B|\|U|0@2|1|F|3|4|C|"| +0#0000000&@24 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +@4|c+0#00e0003&|h|a|r|8|_|t| +0#0000000&@63 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|c+0#00e0003&|h|a|r| +0#0000000&@66 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_string_literal_01.dump b/runtime/syntax/testdir/dumps/c_string_literal_01.dump new file mode 100644 index 0000000000..a2c5a46a61 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_string_literal_01.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|c+0#00e0003&|h|a|r| +0#0000000&|s|1|[|]| |=| |"+0#e000002&|a|猫*&|🍌|"+&|;+0#0000000&| |/+0#0000e05&@1| |o|r| |"|a|\|u|7|3|2|B|\|U|0@2|1|F|3|4|C|"| +0#0000000&@24 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +@4|c+0#00e0003&|h|a|r|8|_|t| +0#0000000&@63 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|c+0#00e0003&|h|a|r| +0#0000000&@66 +>#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@4|s|2|[|]| |=| |u+0#e000002&|8|"|a|猫*&|🍌|"+&|;+0#0000000&| @53 +@4|c+0#00e0003&|h|a|r|1|6|_|t| +0#0000000&|s|3|[|]| |=| |u+0#e000002&|"|a|猫*&|🍌|"+&|;+0#0000000&| @45 +@4|c+0#00e0003&|h|a|r|3|2|_|t| +0#0000000&|s|4|[|]| |=| |U+0#e000002&|"|a|猫*&|🍌|"+&|;+0#0000000&| @45 +@4|w+0#00e0003&|c|h|a|r|_|t| +0#0000000&|s|5|[|]| |=| |L+0#e000002&|"|a|猫*&|🍌|"+&|;+0#0000000&| @46 +@75 +@4|s|e|t|l|o|c|a|l|e|(|L+0#e000002&|C|_|A|L@1|,+0#0000000&| |"+0#e000002&|e|n|_|U|S|.|u|t|f|8|"|)+0#0000000&|;| @38 +@4|p|r|i|n|t|f|(|"+0#e000002&| @1|\+0#e000e06&|"|%|s|\|"| +0#e000002&|i|s| |a| |c|h|a|r|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| @4|{| |"|,+0#0000000&| |s|1|,| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|1| |/| |s+0#af5f00255&|i|z|e|o|f +| +0#0000000&|*|s|1|)|;| @68 +@4|f+0#af5f00255&|o|r|(+0#0000000&|s+0#00e0003&|i|z|e|_|t| +0#0000000&|n| |=| |0+0#e000002&|;+0#0000000&| |n| |<| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|1| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|1|;| |+@1|n|)| @20 +@8|p|r|i|n|t|f|(|"+0#e000002&|0|x|%+0#e000e06&|0|2|X| +0#e000002&|"|,+0#0000000&| |+|(|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|c+0#00e0003&|h|a|r|)+0#0000000&|s|1|[|n|]|)|;| @25 +@4|p|u|t|s|(|"+0#e000002&|}|"|)+0#0000000&|;| @60 +@4|p|r|i|n|t|f|(| @63 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +@57|1|9|,|1| @9|3@1|%| diff --git a/runtime/syntax/testdir/dumps/c_string_literal_02.dump b/runtime/syntax/testdir/dumps/c_string_literal_02.dump new file mode 100644 index 0000000000..a038a36634 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_string_literal_02.dump @@ -0,0 +1,20 @@ +|#+0#e000e06#ffffff0|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +@4|"+0#e000002&|u|8|\+0#e000e06&|"|%|s|\|"| +0#e000002&|i|s| |a| |c|h|a|r|8|_|t|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| @1|{| |"| +0#0000000&@30 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@4|"+0#e000002&|u|8|\+0#e000e06&|"|%|s|\|"| +0#e000002&|i|s| |a| |c|h|a|r|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| @4|{| |"| +0#0000000&@30 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +>,| |s|2|,| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|2| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|2|)|;| @44 +@4|f+0#af5f00255&|o|r|(+0#0000000&|s+0#00e0003&|i|z|e|_|t| +0#0000000&|n| |=| |0+0#e000002&|;+0#0000000&| |n| |<| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|2| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|2|;| |+@1|n|)| @20 +|#+0#e000e06&|i|f| |_@1|S|T|D|C|_|V|E|R|S|I|O|N|_@1| |>|=| |2+0#e000002&|0|2|3|1@1|L| +0#0000000&@43 +@7|p|r|i|n|t|f|(|"+0#e000002&|0|x|%+0#e000e06&|0|2|X| +0#e000002&|"|,+0#0000000&| |s|2|[|n|]|)|;| @42 +|#+0#e000e06&|e|l|s|e| +0#0000000&@69 +@7|p|r|i|n|t|f|(|"+0#e000002&|0|x|%+0#e000e06&|0|2|X| +0#e000002&|"|,+0#0000000&| |+|(|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|c+0#00e0003&|h|a|r|)+0#0000000&|s|2|[|n|]|)|;| @26 +|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68 +@4|p|u|t|s|(|"+0#e000002&|}|"|)+0#0000000&|;| @60 +@4|p|r|i|n|t|f|(|"+0#e000002&| |u|\+0#e000e06&|"|a+0#e000002&|猫*&|🍌|\+0#e000e06&|"| +0#e000002&|i|s| |a| |c|h|a|r|1|6|_|t|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| |{| |"|,+0#0000000&| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|3| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000& +|*|s|3|)|;| @69 +@4|f+0#af5f00255&|o|r|(+0#0000000&|s+0#00e0003&|i|z|e|_|t| +0#0000000&|n| |=| |0+0#e000002&|;+0#0000000&| |n| |<| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|3| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|3|;| |+@1|n|)| @20 +@7|p|r|i|n|t|f|(|"+0#e000002&|0|x|%|0|4|"| +0#0000000&|P|R|I|X|L|E|A|S|T|1|6|"+0#e000002&| |"|,+0#0000000&| |s|3|[|n|]|)|;| @29 +@4|p|u|t|s|(|"+0#e000002&|}|"|)+0#0000000&|;| @60 +@4|p|r|i|n|t|f|(|"+0#e000002&| |U|\+0#e000e06&|"|a+0#e000002&|猫*&|🍌|\+0#e000e06&|"| +0#e000002&|i|s| |a| |c|h|a|r|3|2|_|t|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| |{| |"|,+0#0000000&| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|4| |/| |s+0#af5f00255&|i|z|e|@+0#4040ff13&@2 +| +0#0000000&@56|3|6|,|1| @9|7|5|%| diff --git a/runtime/syntax/testdir/dumps/c_string_literal_03.dump b/runtime/syntax/testdir/dumps/c_string_literal_03.dump new file mode 100644 index 0000000000..081796705a --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_string_literal_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@3|p|r|i|n|t|f|(|"+0#e000002&| |U|\+0#e000e06&|"|a+0#e000002&|猫*&|🍌|\+0#e000e06&|"| +0#e000002&|i|s| |a| |c|h|a|r|3|2|_|t|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| |{| |"|,+0#0000000&| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|4| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000& +|*|s|4|)|;| @69 +@4|f+0#af5f00255&|o|r|(+0#0000000&|s+0#00e0003&|i|z|e|_|t| +0#0000000&|n| |=| |0+0#e000002&|;+0#0000000&| |n| |<| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|4| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|4|;| |+@1|n|)| @20 +@7|p|r|i|n|t|f|(|"+0#e000002&|0|x|%|0|8|"| +0#0000000&|P|R|I|X|L|E|A|S|T|3|2|"+0#e000002&| |"|,+0#0000000&| |s|4|[|n|]|)|;| @29 +@4|p|u|t|s|(|"+0#e000002&|}|"|)+0#0000000&|;| @60 +@4>p|r|i|n|t|f|(|"+0#e000002&| |L|\+0#e000e06&|"|%|l|s|\|"| +0#e000002&|i|s| |a| |w|c|h|a|r|_|t|[|%+0#e000e06&|z|u|]+0#e000002&| |h|o|l|d|i|n|g| @1|{| |"|,+0#0000000&| |s|5|,| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|5| |/| |s+0#af5f00255&|i|z|e|o +|f| +0#0000000&|*|s|5|)|;| @67 +@4|f+0#af5f00255&|o|r|(+0#0000000&|s+0#00e0003&|i|z|e|_|t| +0#0000000&|n| |=| |0+0#e000002&|;+0#0000000&| |n| |<| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|s|5| |/| |s+0#af5f00255&|i|z|e|o|f| +0#0000000&|*|s|5|;| |+@1|n|)| @20 +@7|p|r|i|n|t|f|(|"+0#e000002&|0|x|%+0#e000e06&|0|8|X| +0#e000002&|"|,+0#0000000&| |(|u+0#00e0003&|n|s|i|g|n|e|d|)+0#0000000&|s|5|[|n|]|)|;| @32 +@4|p|u|t|s|(|"+0#e000002&|}|"|)+0#0000000&|;| @60 +|}| @73 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|5|2|,|5| @9|B|o|t| From 727c567a0934643e2d6e1dd92d4e636b17d9067f Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 18 Jan 2025 10:03:46 +0100 Subject: [PATCH 42/93] patch 9.1.1030: filetype: setting bash filetype is backwards incompatible Problem: filetype: setting bash filetype is backwards incompatible Solution: revert patch v9.1.0965, detect bash scripts again as sh filetype This reverts commit b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721. related: #16309 Signed-off-by: Christian Brabandt --- runtime/autoload/dist/ft.vim | 1 - runtime/doc/version9.txt | 4 +--- src/testdir/test_filetype.vim | 20 +++++++------------- src/version.c | 2 ++ 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 47b2fede17..5bbf8ee251 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -900,7 +900,6 @@ export def SetFileTypeSH(name: string, setft = true): string if exists("b:is_sh") unlet b:is_sh endif - return SetFileTypeShell("bash", setft) elseif name =~ '\' || name =~ '\' # Ubuntu links "sh" to "dash", thus it is expected to work the same way b:is_sh = 1 diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index ecdb555dc2..6cbd1022a8 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2025 Jan 16 +*version9.txt* For Vim version 9.1. Last change: 2025 Jan 18 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41617,8 +41617,6 @@ Changed~ |CompleteDone| autocommand in the |v:event| dictionary - the default fontsize for the GTK builds of Vim (Windows and Unix) has been increased to 12pt to accomodate modern high-dpi monitors -- filetype detection now detects bash scripts as a separate "bash" filetype - instead of the "sh" filetype - the default value of the 'keyprotocol' option has been updated by support for the ghostty terminal emulator (using kitty protocol) - |complete_info()| returns the list of matches shown in the poppu menu via diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index a9eac86544..8495e98aca 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -127,10 +127,6 @@ def s:GetFilenameChecks(): dict> ave: ['file.ave'], awk: ['file.awk', 'file.gawk'], b: ['file.mch', 'file.ref', 'file.imp'], - bash: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', - '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', - '.bash-history', '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', - 'file.bash', 'file.bats', 'file.cygport'], basic: ['file.bas', 'file.bi', 'file.bm'], bass: ['file.bass'], bc: ['file.bc'], @@ -690,13 +686,11 @@ def s:GetFilenameChecks(): dict> services: ['/etc/services', 'any/etc/services'], setserial: ['/etc/serial.conf', 'any/etc/serial.conf'], sexplib: ['file.sexp'], - sh: ['/usr/share/doc/bash-completion/filter.sh', - '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', - '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile', - 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', - 'file.mdd', '.env', '.envrc', 'devscripts.conf', '.devscripts', 'file.lo', - 'file.la', 'file.lai'], - shaderslang: ['file.slang'], + sh: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history', + '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh', + '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile', + 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', 'file.mdd', 'file.cygport', '.env', '.envrc', 'devscripts.conf', + '.devscripts', 'file.lo', 'file.la', 'file.lai'], sieve: ['file.siv', 'file.sieve'], sil: ['file.sil'], simula: ['file.sim'], @@ -988,11 +982,11 @@ def s:GetScriptChecks(): dict>> clojure: [['#!/path/clojure']], scala: [['#!/path/scala']], sh: [['#!/path/sh'], + ['#!/path/bash'], + ['#!/path/bash2'], ['#!/path/dash'], ['#!/path/ksh'], ['#!/path/ksh93']], - bash: [['#!/path/bash'], - ['#!/path/bash2']], csh: [['#!/path/csh']], tcsh: [['#!/path/tcsh']], zsh: [['#!/path/zsh']], diff --git a/src/version.c b/src/version.c index 6e16a5e9b2..43a84e8b9e 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1030, /**/ 1029, /**/ From 866f229591eb8114eed2aa44b90f23d1828bf1ee Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 18 Jan 2025 10:06:59 +0100 Subject: [PATCH 43/93] runtime(c): Add missing syntax test files These were missing from commit c2a967a. closes: #16470 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- .../testdir/dumps/c_bool_constant_01.dump | 20 ------- .../testdir/dumps/c_integer_constant_01.dump | 2 +- .../testdir/dumps/c_integer_constant_02.dump | 12 ++-- .../syntax/testdir/input/c_bool_constant.c | 11 ++++ .../testdir/input/c_character_constant.c | 40 +++++++++++++ .../syntax/testdir/input/c_integer_constant.c | 44 ++++++++++++++ .../input/c_preprocessor_conditional.c | 40 +++++++++++++ .../testdir/input/c_preprocessor_embed.c | 31 ++++++++++ .../testdir/input/c_preprocessor_error.c | 19 +++++++ .../syntax/testdir/input/c_string_literal.c | 57 +++++++++++++++++++ 10 files changed, 249 insertions(+), 27 deletions(-) delete mode 100644 runtime/syntax/testdir/dumps/c_bool_constant_01.dump create mode 100644 runtime/syntax/testdir/input/c_bool_constant.c create mode 100644 runtime/syntax/testdir/input/c_character_constant.c create mode 100644 runtime/syntax/testdir/input/c_integer_constant.c create mode 100644 runtime/syntax/testdir/input/c_preprocessor_conditional.c create mode 100644 runtime/syntax/testdir/input/c_preprocessor_embed.c create mode 100644 runtime/syntax/testdir/input/c_preprocessor_error.c create mode 100644 runtime/syntax/testdir/input/c_string_literal.c diff --git a/runtime/syntax/testdir/dumps/c_bool_constant_01.dump b/runtime/syntax/testdir/dumps/c_bool_constant_01.dump deleted file mode 100644 index b1d4e57321..0000000000 --- a/runtime/syntax/testdir/dumps/c_bool_constant_01.dump +++ /dev/null @@ -1,20 +0,0 @@ -> +0&#ffffff0@74 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|0|,|0|-|1| @8|A|l@1| diff --git a/runtime/syntax/testdir/dumps/c_integer_constant_01.dump b/runtime/syntax/testdir/dumps/c_integer_constant_01.dump index f1ebddd15a..920731f70b 100644 --- a/runtime/syntax/testdir/dumps/c_integer_constant_01.dump +++ b/runtime/syntax/testdir/dumps/c_integer_constant_01.dump @@ -17,4 +17,4 @@ @4|/+0#0000e05&@1| |c|o|r@1|e|c|t| |w|a|y| |t|o| |f|o|r|m| |s|i|g|n|e|d| |v|a|l|u|e| |-|9|2@1|3@1|7|2|0|3|6|8|5|4|7@1|5|8|0|8| +0#0000000&@14 |}| @73 @75 -@57|1|8|,|5| @9|5|2|%| +@57|1|8|,|5| @9|4|6|%| diff --git a/runtime/syntax/testdir/dumps/c_integer_constant_02.dump b/runtime/syntax/testdir/dumps/c_integer_constant_02.dump index 0fd7251643..3b03c7785c 100644 --- a/runtime/syntax/testdir/dumps/c_integer_constant_02.dump +++ b/runtime/syntax/testdir/dumps/c_integer_constant_02.dump @@ -1,20 +1,20 @@ | +0&#ffffff0@74 +|/+0#0000e05&@1| |T|h|e| |f|o|l@1|o|w|i|n|g| |v|a|r|i|a|b|l|e|s| |a|r|e| |i|n|i|t|i|a|l|i|z|e|d| |t|o| |t|h|e| |s|a|m|e| |v|a|l|u|e|:| +0#0000000&@13 +@75 |i+0#00e0003&|n|t| +0#0000000&|d| |=| |4+0#e000002&|2|;+0#0000000&| @63 |i+0#00e0003&|n|t| +0#0000000&|o| |=| |0+0#e000002&|5|2|;+0#0000000&| @62 -|i+0#00e0003&|n|t| +0#0000000&|x| |=| |0+0#e000002&|x|2|a|;+0#0000000&| @61 +>i+0#00e0003&|n|t| +0#0000000&|x| |=| |0+0#e000002&|x|2|a|;+0#0000000&| @61 |i+0#00e0003&|n|t| +0#0000000&|X| |=| |0+0#e000002&|X|2|A|;+0#0000000&| @61 ->i+0#00e0003&|n|t| +0#0000000&|b| |=| |0+0#e000002&|b|1|0|1|0|1|0|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@50 +|i+0#00e0003&|n|t| +0#0000000&|b| |=| |0+0#e000002&|b|1|0|1|0|1|0|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@50 @75 -|/+0#0000e05&@1| |T|h|e| |f|o|l@1|o|w|i|n|g| |v|a|r|i|a|b|l|e|s| |a|r|e| |a|l|s|o| |i|n|i|t|i|a|l|i|z|e|d| |t|o| |t|h|e| |s|a|m|e| |v|a|l|u|e|:| +0#0000000&@8 +|/+0#0000e05&@1| |T|h|e| |f|o|l@1|o|w|i|n|g| |v|a|r|i|a|b|l|e|s| |a|r|e| |a|l|s|o| |i|n|i|t|i|a|l|i|z|e|d| |t|o| |t|h|e| |s|a|m|e| |v|a|l|u|e|:| | +0#0000000&@7 @75 |u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|1| |=| |1+0#e000002&|8|4@1|6|7|4@1|0|7|3|7|0|9|5@1|0|5|9|2|u|l@1|;+0#0000000&| |/+0#0000e05&@1| |C|9@1| +0#0000000&@19 |u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|2| |=| |1+0#e000002&|8|'|4@1|6|'|7|4@1|'|0|7|3|'|7|0|9|'|5@1|0|'|5|9|2|l@1|u|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@13 |u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|3| |=| |1+0#e000002&|8|4@1|'|6|7|4@1|'|0|7|3|7|'|0|9|5@1|'|0|5|9|2|u|L@1|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@15 |u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l+0#00e0003&|o|n|g| +0#0000000&|l|4| |=| |1+0#e000002&|8|4@1|6|7|'|4@1|0|7|3|7|'|0|'|9|5@1|0|5|'|9|2|L@1|U|;+0#0000000&| |/+0#0000e05&@1| |C|2|3| +0#0000000&@15 +@75 |~+0#4040ff13&| @73 |~| @73 |~| @73 -|~| @73 -|~| @73 -|~| @73 | +0#0000000&@56|3|4|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/c_bool_constant.c b/runtime/syntax/testdir/input/c_bool_constant.c new file mode 100644 index 0000000000..8c80728865 --- /dev/null +++ b/runtime/syntax/testdir/input/c_bool_constant.c @@ -0,0 +1,11 @@ +// C boolean constants + +// Source: https://en.cppreference.com/w/c/language/bool_constant + +#include + +int main() +{ + assert(true == 1 && 0 == false); +} + diff --git a/runtime/syntax/testdir/input/c_character_constant.c b/runtime/syntax/testdir/input/c_character_constant.c new file mode 100644 index 0000000000..0962f9b7ec --- /dev/null +++ b/runtime/syntax/testdir/input/c_character_constant.c @@ -0,0 +1,40 @@ +// C character constants + +// Source: https://en.cppreference.com/w/c/language/character_constant + +#include +#include +#include + +int main (void) +{ + printf("constant value \n"); + printf("-------- ----------\n"); + + // integer character constants, + int c1='a'; printf("'a':\t %#010x\n", c1); + int c2='🍌'; printf("'🍌':\t %#010x\n\n", c2); // implementation-defined + + // multicharacter constant + int c3='ab'; printf("'ab':\t %#010x\n\n", c3); // implementation-defined + + // 16-bit wide character constants + char16_t uc1 = u'a'; printf("'a':\t %#010x\n", (int)uc1); + char16_t uc2 = u'¢'; printf("'¢':\t %#010x\n", (int)uc2); + char16_t uc3 = u'猫'; printf("'猫':\t %#010x\n", (int)uc3); + // implementation-defined (🍌 maps to two 16-bit characters) + char16_t uc4 = u'🍌'; printf("'🍌':\t %#010x\n\n", (int)uc4); + + // 32-bit wide character constants + char32_t Uc1 = U'a'; printf("'a':\t %#010x\n", (int)Uc1); + char32_t Uc2 = U'¢'; printf("'¢':\t %#010x\n", (int)Uc2); + char32_t Uc3 = U'猫'; printf("'猫':\t %#010x\n", (int)Uc3); + char32_t Uc4 = U'🍌'; printf("'🍌':\t %#010x\n\n", (int)Uc4); + + // wide character constants + wchar_t wc1 = L'a'; printf("'a':\t %#010x\n", (int)wc1); + wchar_t wc2 = L'¢'; printf("'¢':\t %#010x\n", (int)wc2); + wchar_t wc3 = L'猫'; printf("'猫':\t %#010x\n", (int)wc3); + wchar_t wc4 = L'🍌'; printf("'🍌':\t %#010x\n\n", (int)wc4); +} + diff --git a/runtime/syntax/testdir/input/c_integer_constant.c b/runtime/syntax/testdir/input/c_integer_constant.c new file mode 100644 index 0000000000..155fd8f74f --- /dev/null +++ b/runtime/syntax/testdir/input/c_integer_constant.c @@ -0,0 +1,44 @@ +// C integer constants + +// Source: https://en.cppreference.com/w/c/language/integer_constant + +#include +#include + +int main(void) +{ + printf("123 = %d\n", 123); + printf("0123 = %d\n", 0123); + printf("0x123 = %d\n", 0x123); + printf("12345678901234567890ull = %llu\n", 12345678901234567890ull); + // the type is a 64-bit type (unsigned long long or possibly unsigned long) + // even without a long suffix + printf("12345678901234567890u = %"PRIu64"\n", 12345678901234567890u ); + + // printf("%lld\n", -9223372036854775808); // Error: + // the value 9223372036854775808 cannot fit in signed long long, which + // is the biggest type allowed for unsuffixed decimal integer constant + + printf("%llu\n", -9223372036854775808ull ); + // unary minus applied to unsigned value subtracts it from 2^64, + // this gives unsigned 9223372036854775808 + + printf("%lld\n", -9223372036854775807ll - 1); + // correct way to form signed value -9223372036854775808 +} + +// The following variables are initialized to the same value: + +int d = 42; +int o = 052; +int x = 0x2a; +int X = 0X2A; +int b = 0b101010; // C23 + +// The following variables are also initialized to the same value: + +unsigned long long l1 = 18446744073709550592ull; // C99 +unsigned long long l2 = 18'446'744'073'709'550'592llu; // C23 +unsigned long long l3 = 1844'6744'0737'0955'0592uLL; // C23 +unsigned long long l4 = 184467'440737'0'95505'92LLU; // C23 + diff --git a/runtime/syntax/testdir/input/c_preprocessor_conditional.c b/runtime/syntax/testdir/input/c_preprocessor_conditional.c new file mode 100644 index 0000000000..8faabcf10d --- /dev/null +++ b/runtime/syntax/testdir/input/c_preprocessor_conditional.c @@ -0,0 +1,40 @@ +// C preprocessor - conditional inclusion + +// Source: https://en.cppreference.com/w/c/preprocessor/conditional + +#define ABCD 2 +#include + +int main(void) +{ + +#ifdef ABCD + printf("1: yes\n"); +#else + printf("1: no\n"); +#endif + +#ifndef ABCD + printf("2: no1\n"); +#elif ABCD == 2 + printf("2: yes\n"); +#else + printf("2: no2\n"); +#endif + +#if !defined(DCBA) && (ABCD < 2 * 4 - 3) + printf("3: yes\n"); +#endif + +// C23 directives #elifdef/#elifndef +#ifdef CPU + printf("4: no1\n"); +#elifdef GPU + printf("4: no2\n"); +#elifndef RAM + printf("4: yes\n"); // selected in C23 mode, may be selected in pre-C23 mode +#else + printf("4: no3\n"); // may be selected in pre-C23 mode +#endif +} + diff --git a/runtime/syntax/testdir/input/c_preprocessor_embed.c b/runtime/syntax/testdir/input/c_preprocessor_embed.c new file mode 100644 index 0000000000..3800cecef4 --- /dev/null +++ b/runtime/syntax/testdir/input/c_preprocessor_embed.c @@ -0,0 +1,31 @@ +// C preprocessor - binary resource inclusion + +// Source: https://en.cppreference.com/w/c/preprocessor/embed + +#include +#include + +const uint8_t image_data[] = { +#embed "image.png" +}; + +const char message[] = { +#embed "message.txt" if_empty('M', 'i', 's', 's', 'i', 'n', 'g', '\n') +,'\0' // null terminator +}; + +void dump(const uint8_t arr[], size_t size) +{ + for (size_t i = 0; i != size; ++i) + printf("%02X%c", arr[i], (i + 1) % 16 ? ' ' : '\n'); + puts(""); +} + +int main() +{ + puts("image_data[]:"); + dump(image_data, sizeof image_data); + puts("message[]:"); + dump((const uint8_t*)message, sizeof message); +} + diff --git a/runtime/syntax/testdir/input/c_preprocessor_error.c b/runtime/syntax/testdir/input/c_preprocessor_error.c new file mode 100644 index 0000000000..ea89a31e7b --- /dev/null +++ b/runtime/syntax/testdir/input/c_preprocessor_error.c @@ -0,0 +1,19 @@ +// C preprocessor - diagnostic directives + +// Source: https://en.cppreference.com/w/c/preprocessor/error + +#if __STDC__ != 1 +# error "Not a standard compliant compiler" +#endif + +#if __STDC_VERSION__ >= 202311L +# warning "Using #warning as a standard feature" +#endif + +#include + +int main (void) +{ + printf("The compiler used conforms to the ISO C Standard !!"); +} + diff --git a/runtime/syntax/testdir/input/c_string_literal.c b/runtime/syntax/testdir/input/c_string_literal.c new file mode 100644 index 0000000000..a59d58db6c --- /dev/null +++ b/runtime/syntax/testdir/input/c_string_literal.c @@ -0,0 +1,57 @@ +// C string literals + +// Source: https://en.cppreference.com/w/c/language/string_literal + +#include +#include +#include +#include +#include +#include + +int main(void) +{ + char s1[] = "a猫🍌"; // or "a\u732B\U0001F34C" +#if __STDC_VERSION__ >= 202311L + char8_t +#else + char +#endif + s2[] = u8"a猫🍌"; + char16_t s3[] = u"a猫🍌"; + char32_t s4[] = U"a猫🍌"; + wchar_t s5[] = L"a猫🍌"; + + setlocale(LC_ALL, "en_US.utf8"); + printf(" \"%s\" is a char[%zu] holding { ", s1, sizeof s1 / sizeof *s1); + for(size_t n = 0; n < sizeof s1 / sizeof *s1; ++n) + printf("0x%02X ", +(unsigned char)s1[n]); + puts("}"); + printf( +#if __STDC_VERSION__ >= 202311L + "u8\"%s\" is a char8_t[%zu] holding { " +#else + "u8\"%s\" is a char[%zu] holding { " +#endif +, s2, sizeof s2 / sizeof *s2); + for(size_t n = 0; n < sizeof s2 / sizeof *s2; ++n) +#if __STDC_VERSION__ >= 202311L + printf("0x%02X ", s2[n]); +#else + printf("0x%02X ", +(unsigned char)s2[n]); +#endif + puts("}"); + printf(" u\"a猫🍌\" is a char16_t[%zu] holding { ", sizeof s3 / sizeof *s3); + for(size_t n = 0; n < sizeof s3 / sizeof *s3; ++n) + printf("0x%04" PRIXLEAST16" ", s3[n]); + puts("}"); + printf(" U\"a猫🍌\" is a char32_t[%zu] holding { ", sizeof s4 / sizeof *s4); + for(size_t n = 0; n < sizeof s4 / sizeof *s4; ++n) + printf("0x%08" PRIXLEAST32" ", s4[n]); + puts("}"); + printf(" L\"%ls\" is a wchar_t[%zu] holding { ", s5, sizeof s5 / sizeof *s5); + for(size_t n = 0; n < sizeof s5 / sizeof *s5; ++n) + printf("0x%08X ", (unsigned)s5[n]); + puts("}"); +} + From 54cb514c9a8320d77650a63f0f7405aa8cc5b0d7 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Sat, 18 Jan 2025 10:11:28 +0100 Subject: [PATCH 44/93] runtime(sh): update syntax script - remove duplicated keywords - add bash coproc and COPROC_PID keywords Signed-off-by: Eisuke Kawashima Signed-off-by: Christian Brabandt --- runtime/syntax/sh.vim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index d71a966553..67268cdfe3 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -6,6 +6,7 @@ " Last Change: 2024 Mar 04 by Vim Project " 2024 Nov 03 by Aliaksei Budavei <0x000c70 AT gmail DOT com> (improved bracket expressions, #15941) " 2025 Jan 06 add $PS0 to bashSpecialVariables (#16394) +" 2025 Jan 18 add bash coproc, remove duplicate syn keywords (#16467) " Version: 208 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax @@ -24,7 +25,7 @@ elseif getline(1) =~ '\' elseif getline(1) =~ '\' let b:is_dash = 1 elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") && !exists("g:is_dash") - " user did not specify which shell to use, and + " user did not specify which shell to use, and " the script itself does not specify which shell to use. FYI: /bin/sh is ambiguous. " Assuming /bin/sh is executable, and if its a link, find out what it links to. let s:shell = "" @@ -352,7 +353,7 @@ if exists("b:is_bash") ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end=";&" end=";;&" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment elseif exists("b:is_kornshell") ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end=";&" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment -else +else ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment endif ShFoldIfDoFor syn region shCaseEsac matchgroup=shConditional start="\" end="\" contains=@shCaseEsacList @@ -405,7 +406,7 @@ syn region shCmdParenRegion matchgroup=shCmdSubRegion start="((\@!" skip='\\\\\| if exists("b:is_bash") syn cluster shCommandSubList add=bashSpecialVariables,bashStatement syn cluster shCaseList add=bashAdminStatement,bashStatement - syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ALIASES BASH_ARGC BASH_ARGC BASH_ARGV BASH_ARGV BASH_CMDS BASH_CMDS BASH_COMMAND BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_EXECUTION_STRING BASH_LINENO BASH_LINENO BASHOPTS BASHOPTS BASHPID BASHPID BASH_REMATCH BASH_REMATCH BASH_SOURCE BASH_SOURCE BASH_SUBSHELL BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD BASH_XTRACEFD CDPATH COLUMNS COLUMNS COMP_CWORD COMP_CWORD COMP_KEY COMP_KEY COMP_LINE COMP_LINE COMP_POINT COMP_POINT COMPREPLY COMPREPLY COMP_TYPE COMP_TYPE COMP_WORDBREAKS COMP_WORDBREAKS COMP_WORDS COMP_WORDS COPROC COPROC DIRSTACK EMACS EMACS ENV ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNAME FUNCNEST FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_NUMERIC LINENO LINES LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT POSIXLY_CORRECT PPID PROMPT_COMMAND PS0 PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_LINE READLINE_POINT READLINE_POINT REPLY SECONDS SHELL SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR TMPDIR UID + syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ARGC BASH_ARGV BASH_CMDS BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_LINENO BASHOPTS BASHPID BASH_REMATCH BASH_SOURCE BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD CDPATH COLUMNS COMP_CWORD COMP_KEY COMP_LINE COMP_POINT COMPREPLY COMP_TYPE COMP_WORDBREAKS COMP_WORDS COPROC COPROC_PID DIRSTACK EMACS ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_NUMERIC LINENO LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT PPID PROMPT_COMMAND PS0 PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_POINT REPLY SECONDS SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR UID syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep head less ls mkdir mv rm rmdir rpm sed sleep sort strip tail syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop syn keyword bashStatement command compgen @@ -540,6 +541,7 @@ if !exists("b:is_posix") endif if exists("b:is_bash") + syn keyword shFunctionKey coproc ShFoldFunctions syn region shFunctionOne matchgroup=shFunction start="^\s*[A-Za-z_0-9:][-a-zA-Z_0-9:]*\s*()\_s*{" end="}" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionTwo matchgroup=shFunction start="\%(do\)\@!\&\<[A-Za-z_0-9:][-a-zA-Z_0-9:]*\>\s*\%(()\)\=\_s*{" end="}" contains=shFunctionKey,@shFunctionList contained skipwhite skipnl nextgroup=shFunctionStart,shQuickComment ShFoldFunctions syn region shFunctionThree matchgroup=shFunction start="^\s*[A-Za-z_0-9:][-a-zA-Z_0-9:]*\s*()\_s*(" end=")" contains=@shFunctionList skipwhite skipnl nextgroup=shFunctionStart,shQuickComment @@ -693,10 +695,10 @@ if exists("b:is_kornshell") || exists("b:is_posix") " Additional bash Keywords: {{{1 " ===================== elseif exists("b:is_bash") - syn keyword shStatement bg builtin disown export false fg getopts jobs let printf sleep true unalias + syn keyword shStatement bg builtin disown export false fg getopts jobs let printf true unalias syn keyword shStatement typeset nextgroup=shSetOption syn keyword shStatement fc hash history source suspend times type - syn keyword shStatement bind builtin caller compopt declare dirs disown enable export help logout local mapfile popd pushd readarray shopt source typeset + syn keyword shStatement bind caller compopt declare dirs enable help logout local mapfile popd pushd readarray shopt typeset else syn keyword shStatement login newgrp endif From 5e9aaedf520e850470fdecebb1ceccba0956178e Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sat, 18 Jan 2025 10:24:25 +0100 Subject: [PATCH 45/93] patch 9.1.1031: Coverity complains about insecure data handling Problem: Coverity complains about insecure data handling (v9.1.1024) Solution: use int consistently to access the blob index (Yegappan Lakshmanan) related: #16468 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/fileio.c | 2 +- src/strings.c | 2 +- src/testdir/test_functions.vim | 3 +++ src/version.c | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index 93e13e331f..a2031e96f7 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4308,7 +4308,7 @@ buf_check_timestamp( */ busy = TRUE; #ifdef FEAT_EVAL - set_vim_var_string(VV_FCS_REASON, (char_u *)reason, reasonlen); + set_vim_var_string(VV_FCS_REASON, (char_u *)reason, (int)reasonlen); set_vim_var_string(VV_FCS_CHOICE, (char_u *)"", 0); #endif ++allbuf_lock; diff --git a/src/strings.c b/src/strings.c index a71ac9192a..53e0171aac 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1265,7 +1265,7 @@ string_from_blob(blob_T *blob, long *start_idx) { garray_T str_ga; long blen; - long idx; + int idx; ga_init2(&str_ga, sizeof(char), 80); diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 5e0fd7da7b..bf3e889165 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -4282,6 +4282,9 @@ func Test_str2blob() call assert_equal(0zABBB0AABBB, str2blob(['«»', '«»'], {'encoding': 'latin1'})) call assert_equal(0zC2ABC2BB, str2blob(['«»'], {'encoding': 'utf8'})) + call assert_equal(0z62, str2blob(["b"], test_null_dict())) + call assert_equal(0z63, str2blob(["c"], {'encoding': test_null_string()})) + call assert_fails("call str2blob(['abc'], [])", 'E1206: Dictionary required for argument 2') call assert_fails("call str2blob(['abc'], {'encoding': []})", 'E730: Using a List as a String') call assert_fails("call str2blob(['abc'], {'encoding': 'ab12xy'})", 'E1515: Unable to convert to ''ab12xy'' encoding') diff --git a/src/version.c b/src/version.c index 43a84e8b9e..d273ce7251 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1031, /**/ 1030, /**/ From b77c5984877c9de816ea6db8865eb3df7bb14b51 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sat, 18 Jan 2025 10:35:57 +0100 Subject: [PATCH 46/93] patch 9.1.1032: link error when FEAT_SPELL not defined Problem: link error when FEAT_SPELL not defined (after v9.1.1016, John Marriott) Solution: adjust ifdefs (Yegappan Lakshmanan) closes: #16468 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/mbyte.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mbyte.c b/src/mbyte.c index 1570182666..a38ab24f32 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -4355,7 +4355,7 @@ utf_find_illegal(void) convert_setup(&vimconv, NULL, NULL); } -#if defined(FEAT_GUI_GTK) || defined(FEAT_SPELL) || defined(PROTO) +#if defined(FEAT_GUI_GTK) || defined(FEAT_SPELL) || defined(FEAT_EVAL) || defined(PROTO) /* * Return TRUE if string "s" is a valid utf-8 string. * When "end" is NULL stop at the first NUL. Otherwise stop at "end". diff --git a/src/version.c b/src/version.c index d273ce7251..4006ffb097 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1032, /**/ 1031, /**/ From 1d2867df0c5dfa3d2444229f9e4b23d6ff935956 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 18 Jan 2025 10:49:08 +0100 Subject: [PATCH 47/93] patch 9.1.1033: tests: shaderslang was removed from test_filetype erroneously Problem: tests: shaderslang was removed from test_filetype erroneously (Christian Clason, after v9.1.1030) Solution: restore the test Signed-off-by: Christian Brabandt --- src/testdir/test_filetype.vim | 1 + src/version.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 8495e98aca..d84b22b79a 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -691,6 +691,7 @@ def s:GetFilenameChecks(): dict> '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile', 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', 'file.mdd', 'file.cygport', '.env', '.envrc', 'devscripts.conf', '.devscripts', 'file.lo', 'file.la', 'file.lai'], + shaderslang: ['file.slang'], sieve: ['file.siv', 'file.sieve'], sil: ['file.sil'], simula: ['file.sim'], diff --git a/src/version.c b/src/version.c index 4006ffb097..6e6b651a1c 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1033, /**/ 1032, /**/ From e06405181a6189aa56e917c1a7e5090a33b07a8a Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 18 Jan 2025 10:52:27 +0100 Subject: [PATCH 48/93] runtime(c): add new constexpr keyword to syntax file (C23) closes: #16471 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/syntax/c.vim | 5 +- .../syntax/testdir/dumps/c_keywords_00.dump | 20 ++++++ .../syntax/testdir/dumps/c_keywords_01.dump | 20 ++++++ .../syntax/testdir/dumps/c_keywords_02.dump | 20 ++++++ .../syntax/testdir/dumps/c_keywords_03.dump | 20 ++++++ runtime/syntax/testdir/input/c_keywords.c | 64 +++++++++++++++++++ 6 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 runtime/syntax/testdir/dumps/c_keywords_00.dump create mode 100644 runtime/syntax/testdir/dumps/c_keywords_01.dump create mode 100644 runtime/syntax/testdir/dumps/c_keywords_02.dump create mode 100644 runtime/syntax/testdir/dumps/c_keywords_03.dump create mode 100644 runtime/syntax/testdir/input/c_keywords.c diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim index eb56239f3d..68b6778c73 100644 --- a/runtime/syntax/c.vim +++ b/runtime/syntax/c.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: C " Maintainer: The Vim Project -" Last Change: 2025 Jan 15 +" Last Change: 2025 Jan 18 " Former Maintainer: Bram Moolenaar " Quit when a (custom) syntax file was already loaded @@ -318,6 +318,9 @@ syn keyword cStorageClass static register auto volatile extern const if !exists("c_no_c99") && !s:in_cpp_family syn keyword cStorageClass inline restrict endif +if (s:ft ==# "c" && !exists("c_no_c23")) || (s:in_cpp_family && !exists("cpp_no_cpp11")) + syn keyword cStorageClass constexpr +endif if !exists("c_no_c11") syn keyword cStorageClass _Alignas alignas syn keyword cOperator _Alignof alignof diff --git a/runtime/syntax/testdir/dumps/c_keywords_00.dump b/runtime/syntax/testdir/dumps/c_keywords_00.dump new file mode 100644 index 0000000000..e6cbe437a8 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_keywords_00.dump @@ -0,0 +1,20 @@ +>/+0#0000e05#ffffff0@1| |C| |k|e|y|w|o|r|d|s| +0#0000000&@61 +@75 +|/+0#0000e05&@1| |S|o|u|r|c|e|:| |h|t@1|p|s|:|/@1|e|n|.|c|p@1|r|e|f|e|r|e|n|c|e|.|c|o|m|/|w|/|c|/|k|e|y|w|o|r|d| +0#0000000&@24 +@75 +|a+0#00e0003&|l|i|g|n|a|s| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58 +|a+0#af5f00255&|l|i|g|n|o|f| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58 +|a+0#00e0003&|u|t|o| +0#0000000&@70 +|b+0#00e0003&|o@1|l| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@61 +|b+0#af5f00255&|r|e|a|k| +0#0000000&@69 +|c+0#af5f00255&|a|s|e| +0#0000000&@70 +|c+0#00e0003&|h|a|r| +0#0000000&@70 +|c+0#00e0003&|o|n|s|t| +0#0000000&@69 +|c+0#00e0003&|o|n|s|t|e|x|p|r| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@56 +|c+0#af5f00255&|o|n|t|i|n|u|e| +0#0000000&@66 +|d+0#af5f00255&|e|f|a|u|l|t| +0#0000000&@67 +|d+0#af5f00255&|o| +0#0000000&@72 +|d+0#00e0003&|o|u|b|l|e| +0#0000000&@68 +|e+0#af5f00255&|l|s|e| +0#0000000&@70 +|e+0#00e0003&|n|u|m| +0#0000000&@70 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/c_keywords_01.dump b/runtime/syntax/testdir/dumps/c_keywords_01.dump new file mode 100644 index 0000000000..b1f015036a --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_keywords_01.dump @@ -0,0 +1,20 @@ +|c+0#af5f00255#ffffff0|o|n|t|i|n|u|e| +0#0000000&@66 +|d+0#af5f00255&|e|f|a|u|l|t| +0#0000000&@67 +|d+0#af5f00255&|o| +0#0000000&@72 +|d+0#00e0003&|o|u|b|l|e| +0#0000000&@68 +|e+0#af5f00255&|l|s|e| +0#0000000&@70 +>e+0#00e0003&|n|u|m| +0#0000000&@70 +|e+0#00e0003&|x|t|e|r|n| +0#0000000&@68 +|f+0#e000002&|a|l|s|e| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@60 +|f+0#00e0003&|l|o|a|t| +0#0000000&@69 +|f+0#af5f00255&|o|r| +0#0000000&@71 +|g+0#af5f00255&|o|t|o| +0#0000000&@70 +|i+0#af5f00255&|f| +0#0000000&@72 +|i+0#00e0003&|n|l|i|n|e| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@59 +|i+0#00e0003&|n|t| +0#0000000&@71 +|l+0#00e0003&|o|n|g| +0#0000000&@70 +|n+0#e000002&|u|l@1|p|t|r| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58 +|r+0#00e0003&|e|g|i|s|t|e|r| +0#0000000&@66 +|r+0#00e0003&|e|s|t|r|i|c|t| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@57 +|r+0#af5f00255&|e|t|u|r|n| +0#0000000&@68 +@57|1|9|,|1| @9|2|8|%| diff --git a/runtime/syntax/testdir/dumps/c_keywords_02.dump b/runtime/syntax/testdir/dumps/c_keywords_02.dump new file mode 100644 index 0000000000..6e6629d949 --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_keywords_02.dump @@ -0,0 +1,20 @@ +|r+0#af5f00255#ffffff0|e|t|u|r|n| +0#0000000&@68 +|s+0#00e0003&|h|o|r|t| +0#0000000&@69 +|s+0#00e0003&|i|g|n|e|d| +0#0000000&@68 +|s+0#af5f00255&|i|z|e|o|f| +0#0000000&@68 +|s+0#00e0003&|t|a|t|i|c| +0#0000000&@68 +>s+0#af5f00255&|t|a|t|i|c|_|a|s@1|e|r|t| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@52 +|s+0#00e0003&|t|r|u|c|t| +0#0000000&@68 +|s+0#af5f00255&|w|i|t|c|h| +0#0000000&@68 +|t+0#00e0003&|h|r|e|a|d|_|l|o|c|a|l| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@53 +|t+0#e000002&|r|u|e| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@61 +|t+0#00e0003&|y|p|e|d|e|f| +0#0000000&@67 +|t+0#af5f00255&|y|p|e|o|f| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@59 +|t+0#af5f00255&|y|p|e|o|f|_|u|n|q|u|a|l| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@52 +|u+0#00e0003&|n|i|o|n| +0#0000000&@69 +|u+0#00e0003&|n|s|i|g|n|e|d| +0#0000000&@66 +|v+0#00e0003&|o|i|d| +0#0000000&@70 +|v+0#00e0003&|o|l|a|t|i|l|e| +0#0000000&@66 +|w+0#af5f00255&|h|i|l|e| +0#0000000&@69 +@75 +@57|3|7|,|1| @9|6|8|%| diff --git a/runtime/syntax/testdir/dumps/c_keywords_03.dump b/runtime/syntax/testdir/dumps/c_keywords_03.dump new file mode 100644 index 0000000000..548393686a --- /dev/null +++ b/runtime/syntax/testdir/dumps/c_keywords_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|_+0#00e0003&|A|l|i|g|n|a|s| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@38 +|_+0#af5f00255&|A|l|i|g|n|o|f| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@38 +|_+0#00e0003&|A|t|o|m|i|c| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)| +0#0000000&@58 +|_+0#00e0003&|B|i|t|I|n|t| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@58 +>_+0#00e0003&|B|o@1|l| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@41 +|_+0#00e0003&|C|o|m|p|l|e|x| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@57 +|_+0#00e0003&|D|e|c|i|m|a|l|1|2|8| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@54 +|_+0#00e0003&|D|e|c|i|m|a|l|3|2| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@55 +|_+0#00e0003&|D|e|c|i|m|a|l|6|4| +0#0000000&|/+0#0000e05&@1| |(|C|2|3|)| +0#0000000&@55 +|_+0#af5f00255&|G|e|n|e|r|i|c| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)| +0#0000000&@57 +|_+0#00e0003&|I|m|a|g|i|n|a|r|y| +0#0000000&|/+0#0000e05&@1| |(|C|9@1|)| +0#0000000&@55 +|_+0#00e0003&|N|o|r|e|t|u|r|n| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@37 +|_+0#af5f00255&|S|t|a|t|i|c|_|a|s@1|e|r|t| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@32 +|_+0#00e0003&|T|h|r|e|a|d|_|l|o|c|a|l| +0#0000000&|/+0#0000e05&@1| |(|C|1@1|)|(|d|e|p|r|e|c|a|t|e|d| |i|n| |C|2|3|)| +0#0000000&@33 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|5@1|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/c_keywords.c b/runtime/syntax/testdir/input/c_keywords.c new file mode 100644 index 0000000000..fc994c299b --- /dev/null +++ b/runtime/syntax/testdir/input/c_keywords.c @@ -0,0 +1,64 @@ +// C keywords + +// Source: https://en.cppreference.com/w/c/keyword + +alignas // (C23) +alignof // (C23) +auto +bool // (C23) +break +case +char +const +constexpr // (C23) +continue +default +do +double +else +enum +extern +false // (C23) +float +for +goto +if +inline // (C99) +int +long +nullptr // (C23) +register +restrict // (C99) +return +short +signed +sizeof +static +static_assert // (C23) +struct +switch +thread_local // (C23) +true // (C23) +typedef +typeof // (C23) +typeof_unqual // (C23) +union +unsigned +void +volatile +while + +_Alignas // (C11)(deprecated in C23) +_Alignof // (C11)(deprecated in C23) +_Atomic // (C11) +_BitInt // (C23) +_Bool // (C99)(deprecated in C23) +_Complex // (C99) +_Decimal128 // (C23) +_Decimal32 // (C23) +_Decimal64 // (C23) +_Generic // (C11) +_Imaginary // (C99) +_Noreturn // (C11)(deprecated in C23) +_Static_assert // (C11)(deprecated in C23) +_Thread_local // (C11)(deprecated in C23) From fef4be0d7ae2340ca13552f3b101ce905dd9b3e5 Mon Sep 17 00:00:00 2001 From: "Philip H." <47042125+pheiduck@users.noreply.github.com> Date: Sat, 18 Jan 2025 17:20:13 +0100 Subject: [PATCH 49/93] CI: bump windows libsodium to 1.0.20 closes: #16475 Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com> Signed-off-by: Christian Brabandt --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d05b75f44..0470389332 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -406,7 +406,7 @@ jobs: # winpty WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip # libsodium - SODIUM_VER: '1.0.19' + SODIUM_VER: '1.0.20' # SODIUM_MSVC_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-msvc.zip SODIUM_MSVC_URL: https://github.com/jedisct1/libsodium/releases/download/%SODIUM_VER%-RELEASE/libsodium-%SODIUM_VER%-msvc.zip SODIUM_MSVC_VER: v143 From 7c92e888946903fa26b377efbc98c8f83e9188b8 Mon Sep 17 00:00:00 2001 From: Ernie Rael Date: Sat, 18 Jan 2025 17:26:39 +0100 Subject: [PATCH 50/93] patch 9.1.1033: Vim9: compiling abstract method fails without return Problem: Vim9: compiling abstract method fails without return (Aliaksei Budavei) Solution: don't require return for an abstract method (Ernie Rael) fixes: #15432 related: ##15441 closes: #16469 Signed-off-by: Ernie Rael Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_vim9_class.vim | 33 +++++++++++++++++++++++++++++++++ src/version.c | 2 ++ src/vim9compile.c | 7 ++++--- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index fc0edeb5ba..cac8b63c7e 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -6458,6 +6458,39 @@ def Test_abstract_method() assert_equal('foo', A.Foo()) END v9.CheckSourceSuccess(lines) + + # Invoke method returning a value through the abstract class. See #15432. + lines =<< trim END + vim9script + + abstract class A + abstract def String(): string + endclass + + class B extends A + def String(): string + return 'B' + enddef + endclass + + def F(o: A) + assert_equal('B', o.String()) + enddef + F(B.new()) + END + v9.CheckSourceSuccess(lines) + + # Invoke abstract method returning a value does not compile + lines =<< trim END + vim9script + + abstract class A + abstract def String(): string + return 'X' + enddef + endclass + END + v9.CheckScriptFailure(lines, "E1318: Not a valid command in a class: return 'X'") enddef " Test for calling a class method from a subclass diff --git a/src/version.c b/src/version.c index 6e6b651a1c..ba41159774 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1034, /**/ 1033, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index fa02871e8b..338415e85f 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -4917,9 +4917,10 @@ compile_def_function( goto erret; ufunc->uf_args_visible = ufunc->uf_args.ga_len; - // Compiling a function in an interface is done to get the function type. - // No code is actually compiled. - if (ufunc->uf_class != NULL && IS_INTERFACE(ufunc->uf_class)) + // Compiling an abstract method or a function in an interface is done to + // get the function type. No code is actually compiled. + if (ufunc->uf_class != NULL && (IS_INTERFACE(ufunc->uf_class) + || IS_ABSTRACT_METHOD(ufunc))) { ufunc->uf_def_status = UF_NOT_COMPILED; ret = OK; From 87f65f3857ae00ecd4548043ee3343c87ac45cdd Mon Sep 17 00:00:00 2001 From: rhysd Date: Sat, 18 Jan 2025 17:32:11 +0100 Subject: [PATCH 51/93] CI: add Linux arm64 CI job This patch adds jobs to run tests on arm64 GitHub Actions hosted runner for tiny and huge features. closes: #16477 Signed-off-by: rhysd Signed-off-by: Christian Brabandt --- .github/workflows/ci.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0470389332..fc0a477501 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ permissions: jobs: linux: - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.architecture == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} env: CC: ${{ matrix.compiler }} @@ -48,6 +48,10 @@ jobs: - features: tiny compiler: gcc extra: [nogui] + - features: tiny + compiler: gcc + extra: [nogui] + architecture: arm64 - features: normal shadow: ./src/shadow compiler: gcc @@ -73,6 +77,11 @@ jobs: compiler: gcc coverage: true extra: [unittests] + - features: huge + compiler: gcc + coverage: true + extra: [unittests] + architecture: arm64 - features: normal compiler: gcc extra: [vimtags] @@ -251,11 +260,19 @@ jobs: "${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit - name: Test + if: matrix.architecture != 'arm64' timeout-minutes: 25 run: | do_test() { echo "$*"; sg audio "sg $(id -gn) '$*'"; } do_test make ${SHADOWOPT} ${TEST} + # `sg audio` does not work on arm64 runner due to permission ('Incorrect password' error). + - name: Test on arm64 + if: matrix.architecture == 'arm64' + timeout-minutes: 25 + run: | + make ${SHADOWOPT} ${TEST} + - if: ${{ !cancelled() }} uses: ./.github/actions/test_artifacts From d402ba81e256b21e73a98ec809bd4a9482613553 Mon Sep 17 00:00:00 2001 From: Luca Saccarola Date: Sat, 18 Jan 2025 17:36:02 +0100 Subject: [PATCH 52/93] runtime(netrw): upstream snapshot of v175 Relevant commits: - release: netrw v175 - fix: prevent netrw to load into the built-in terminal - fix: restore correctly cpo settings - fix(docs): mispelled original authors name - chore: move viml files to new formatting standard fixes: #16463 closes: #16465 Signed-off-by: Luca Saccarola Signed-off-by: Christian Brabandt --- .../pack/dist/opt/netrw/autoload/netrw.vim | 2 +- .../dist/opt/netrw/autoload/netrwSettings.vim | 446 +++++++++--------- .../opt/netrw/autoload/netrw_gitignore.vim | 9 +- runtime/pack/dist/opt/netrw/doc/netrw.txt | 2 +- .../dist/opt/netrw/plugin/netrwPlugin.vim | 344 +++++++------- runtime/pack/dist/opt/netrw/syntax/netrw.vim | 260 +++++----- 6 files changed, 531 insertions(+), 532 deletions(-) diff --git a/runtime/pack/dist/opt/netrw/autoload/netrw.vim b/runtime/pack/dist/opt/netrw/autoload/netrw.vim index 51ac9dd2ac..df157e4dc0 100644 --- a/runtime/pack/dist/opt/netrw/autoload/netrw.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrw.vim @@ -35,7 +35,7 @@ if exists("s:needspatches") endfor endif -let g:loaded_netrw = "v174" +let g:loaded_netrw = "v175" let s:keepcpo= &cpo setl cpo&vim diff --git a/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim b/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim index fd43c16c4e..884d9ce081 100644 --- a/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim @@ -1,7 +1,7 @@ " Maintainer: Luca Saccarola " Former Maintainer: Charles E Campbell " Upstream: -" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1 +" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{ " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, @@ -9,13 +9,13 @@ " warranty of any kind, either expressed or implied. By using " this plugin, you agree that in no event will the copyright " holder be liable for any damages resulting from the use -" of this software. +" of this software. }}} -" Load Once: {{{1 -if exists("g:loaded_netrwSettings") || &cp - finish +if &cp || exists("g:loaded_netrwSettings") + finish endif -let g:loaded_netrwSettings = "v174" + +let g:loaded_netrwSettings = "v175" if v:version < 700 echohl WarningMsg echo "***warning*** this version of netrwSettings needs vim 7.0" @@ -23,220 +23,220 @@ if v:version < 700 finish endif -" --------------------------------------------------------------------- -" NetrwSettings: {{{1 -fun! netrwSettings#NetrwSettings() - " this call is here largely just to insure that netrw has been loaded - call netrw#WinPath("") - if !exists("g:loaded_netrw") - echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None - return - endif - - above wincmd s - enew - setlocal noswapfile bh=wipe - set ft=vim - file Netrw\ Settings - - " these variables have the following default effects when they don't - " exist (ie. have not been set by the user in his/her .vimrc) - if !exists("g:netrw_liststyle") - let g:netrw_liststyle= 0 - let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa" - endif - if !exists("g:netrw_silent") - let g:netrw_silent= 0 - endif - if !exists("g:netrw_use_nt_rcp") - let g:netrw_use_nt_rcp= 0 - endif - if !exists("g:netrw_ftp") - let g:netrw_ftp= 0 - endif - if !exists("g:netrw_ignorenetrc") - let g:netrw_ignorenetrc= 0 - endif - - put ='+ ---------------------------------------------' - put ='+ NetrwSettings: by Charles E. Campbell' - put ='+ Press with cursor atop any line for help' - put ='+ ---------------------------------------------' - let s:netrw_settings_stop= line(".") - - put ='' - put ='+ Netrw Protocol Commands' - put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd - put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd - put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd - put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd - put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd - put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd - put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd - put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd - put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd - let s:netrw_protocol_stop= line(".") - put = '' - - put ='+Netrw Transfer Control' - put = 'let g:netrw_cygwin = '.g:netrw_cygwin - put = 'let g:netrw_ftp = '.g:netrw_ftp - put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode - put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc - put = 'let g:netrw_sshport = '.g:netrw_sshport - put = 'let g:netrw_silent = '.g:netrw_silent - put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp - let s:netrw_xfer_stop= line(".") - put ='' - put ='+ Netrw Messages' - put ='let g:netrw_use_errorwindow = '.g:netrw_use_errorwindow - - put = '' - put ='+ Netrw Browser Control' - if exists("g:netrw_altfile") - put = 'let g:netrw_altfile = '.g:netrw_altfile - else - put = 'let g:netrw_altfile = 0' - endif - put = 'let g:netrw_alto = '.g:netrw_alto - put = 'let g:netrw_altv = '.g:netrw_altv - put = 'let g:netrw_banner = '.g:netrw_banner - if exists("g:netrw_bannerbackslash") - put = 'let g:netrw_bannerbackslash = '.g:netrw_bannerbackslash - else - put = '\" let g:netrw_bannerbackslash = (not defined)' - endif - put = 'let g:netrw_browse_split = '.g:netrw_browse_split - if exists("g:netrw_browsex_viewer") - put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer - else - put = '\" let g:netrw_browsex_viewer = (not defined)' - endif - put = 'let g:netrw_compress = '.g:netrw_compress - if exists("g:Netrw_corehandler") - put = 'let g:Netrw_corehandler = '.g:Netrw_corehandler - else - put = '\" let g:Netrw_corehandler = (not defined)' - endif - put = 'let g:netrw_ctags = '.g:netrw_ctags - put = 'let g:netrw_cursor = '.g:netrw_cursor - let decompressline= line("$") - put = 'let g:netrw_decompress = '.string(g:netrw_decompress) - if exists("g:netrw_dynamic_maxfilenamelen") - put = 'let g:netrw_dynamic_maxfilenamelen='.g:netrw_dynamic_maxfilenamelen - else - put = '\" let g:netrw_dynamic_maxfilenamelen= (not defined)' - endif - put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax - put = 'let g:netrw_errorlvl = '.g:netrw_errorlvl - put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse - let fnameescline= line("$") - put = 'let g:netrw_fname_escape = '.string(g:netrw_fname_escape) - put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject - put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd - put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd - put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd - let globescline= line("$") - put = 'let g:netrw_glob_escape = '.string(g:netrw_glob_escape) - put = 'let g:netrw_hide = '.g:netrw_hide - if exists("g:netrw_home") - put = 'let g:netrw_home = '.g:netrw_home - else - put = '\" let g:netrw_home = (not defined)' - endif - put = 'let g:netrw_keepdir = '.g:netrw_keepdir - put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd - put = 'let g:netrw_list_hide = '.g:netrw_list_hide - put = 'let g:netrw_liststyle = '.g:netrw_liststyle - put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd - put = 'let g:netrw_localcopycmdopt = '.g:netrw_localcopycmdopt - put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir - put = 'let g:netrw_localmkdiropt = '.g:netrw_localmkdiropt - put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd - put = 'let g:netrw_localmovecmdopt = '.g:netrw_localmovecmdopt - put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen - put = 'let g:netrw_menu = '.g:netrw_menu - put = 'let g:netrw_mousemaps = '.g:netrw_mousemaps - put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd - if exists("g:netrw_nobeval") - put = 'let g:netrw_nobeval = '.g:netrw_nobeval - else - put = '\" let g:netrw_nobeval = (not defined)' - endif - put = 'let g:netrw_remote_mkdir = '.g:netrw_remote_mkdir - put = 'let g:netrw_preview = '.g:netrw_preview - put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd - put = 'let g:netrw_retmap = '.g:netrw_retmap - put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd - put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd - put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd - put = 'let g:netrw_sort_by = '.g:netrw_sort_by - put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction - put = 'let g:netrw_sort_options = '.g:netrw_sort_options - put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence - put = 'let g:netrw_servername = '.g:netrw_servername - put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax - put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject - put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd - put = 'let g:netrw_scpport = '.g:netrw_scpport - put = 'let g:netrw_sepchr = '.g:netrw_sepchr - put = 'let g:netrw_sshport = '.g:netrw_sshport - put = 'let g:netrw_timefmt = '.g:netrw_timefmt - let tmpfileescline= line("$") - put ='let g:netrw_tmpfile_escape...' - put = 'let g:netrw_use_noswf = '.g:netrw_use_noswf - put = 'let g:netrw_xstrlen = '.g:netrw_xstrlen - put = 'let g:netrw_winsize = '.g:netrw_winsize - - put ='' - put ='+ For help, place cursor on line and press ' - - 1d - silent %s/^+/"/e - res 99 - silent %s/= \([^0-9].*\)$/= '\1'/e - silent %s/= $/= ''/e - 1 - - call setline(decompressline,"let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1','')) - call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'") - call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'") - call setline(tmpfileescline,"let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'") - - set nomod - - nmap :call NetrwSettingHelp() - nnoremap :call NetrwSettingHelp() - let tmpfile= tempname() - exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod' -endfun - -" --------------------------------------------------------------------- -" NetrwSettingHelp: {{{2 -fun! NetrwSettingHelp() -" call Dfunc("NetrwSettingHelp()") - let curline = getline(".") - if curline =~ '=' - let varhelp = substitute(curline,'^\s*let ','','e') - let varhelp = substitute(varhelp,'\s*=.*$','','e') -" call Decho("trying help ".varhelp) - try - exe "he ".varhelp - catch /^Vim\%((\a\+)\)\=:E149/ - echo "***sorry*** no help available for <".varhelp.">" - endtry - elseif line(".") < s:netrw_settings_stop - he netrw-settings - elseif line(".") < s:netrw_protocol_stop - he netrw-externapp - elseif line(".") < s:netrw_xfer_stop - he netrw-variables - else - he netrw-browse-var - endif -" call Dret("NetrwSettingHelp") -endfun - -" --------------------------------------------------------------------- -" Modelines: {{{1 -" vim:ts=8 fdm=marker +" NetrwSettings: {{{ + +function! netrwSettings#NetrwSettings() + " this call is here largely just to insure that netrw has been loaded + call netrw#WinPath("") + if !exists("g:loaded_netrw") + echohl WarningMsg + echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" + echohl None + return + endif + + above wincmd s + enew + setlocal noswapfile bh=wipe + set ft=vim + file Netrw\ Settings + + " these variables have the following default effects when they don't + " exist (ie. have not been set by the user in his/her .vimrc) + if !exists("g:netrw_liststyle") + let g:netrw_liststyle= 0 + let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa" + endif + if !exists("g:netrw_silent") + let g:netrw_silent= 0 + endif + if !exists("g:netrw_use_nt_rcp") + let g:netrw_use_nt_rcp= 0 + endif + if !exists("g:netrw_ftp") + let g:netrw_ftp= 0 + endif + if !exists("g:netrw_ignorenetrc") + let g:netrw_ignorenetrc= 0 + endif + + put ='+ ---------------------------------------------' + put ='+ NetrwSettings: by Charles E. Campbell' + put ='+ Press with cursor atop any line for help' + put ='+ ---------------------------------------------' + let s:netrw_settings_stop= line(".") + + put ='' + put ='+ Netrw Protocol Commands' + put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd + put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd + put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd + put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd + put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd + put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd + put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd + put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd + put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd + let s:netrw_protocol_stop= line(".") + put = '' + + put ='+Netrw Transfer Control' + put = 'let g:netrw_cygwin = '.g:netrw_cygwin + put = 'let g:netrw_ftp = '.g:netrw_ftp + put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode + put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc + put = 'let g:netrw_sshport = '.g:netrw_sshport + put = 'let g:netrw_silent = '.g:netrw_silent + put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp + let s:netrw_xfer_stop= line(".") + put ='' + put ='+ Netrw Messages' + put ='let g:netrw_use_errorwindow = '.g:netrw_use_errorwindow + + put = '' + put ='+ Netrw Browser Control' + if exists("g:netrw_altfile") + put = 'let g:netrw_altfile = '.g:netrw_altfile + else + put = 'let g:netrw_altfile = 0' + endif + put = 'let g:netrw_alto = '.g:netrw_alto + put = 'let g:netrw_altv = '.g:netrw_altv + put = 'let g:netrw_banner = '.g:netrw_banner + if exists("g:netrw_bannerbackslash") + put = 'let g:netrw_bannerbackslash = '.g:netrw_bannerbackslash + else + put = '\" let g:netrw_bannerbackslash = (not defined)' + endif + put = 'let g:netrw_browse_split = '.g:netrw_browse_split + if exists("g:netrw_browsex_viewer") + put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer + else + put = '\" let g:netrw_browsex_viewer = (not defined)' + endif + put = 'let g:netrw_compress = '.g:netrw_compress + if exists("g:Netrw_corehandler") + put = 'let g:Netrw_corehandler = '.g:Netrw_corehandler + else + put = '\" let g:Netrw_corehandler = (not defined)' + endif + put = 'let g:netrw_ctags = '.g:netrw_ctags + put = 'let g:netrw_cursor = '.g:netrw_cursor + let decompressline= line("$") + put = 'let g:netrw_decompress = '.string(g:netrw_decompress) + if exists("g:netrw_dynamic_maxfilenamelen") + put = 'let g:netrw_dynamic_maxfilenamelen='.g:netrw_dynamic_maxfilenamelen + else + put = '\" let g:netrw_dynamic_maxfilenamelen= (not defined)' + endif + put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax + put = 'let g:netrw_errorlvl = '.g:netrw_errorlvl + put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse + let fnameescline= line("$") + put = 'let g:netrw_fname_escape = '.string(g:netrw_fname_escape) + put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject + put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd + put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd + put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd + let globescline= line("$") + put = 'let g:netrw_glob_escape = '.string(g:netrw_glob_escape) + put = 'let g:netrw_hide = '.g:netrw_hide + if exists("g:netrw_home") + put = 'let g:netrw_home = '.g:netrw_home + else + put = '\" let g:netrw_home = (not defined)' + endif + put = 'let g:netrw_keepdir = '.g:netrw_keepdir + put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd + put = 'let g:netrw_list_hide = '.g:netrw_list_hide + put = 'let g:netrw_liststyle = '.g:netrw_liststyle + put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd + put = 'let g:netrw_localcopycmdopt = '.g:netrw_localcopycmdopt + put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir + put = 'let g:netrw_localmkdiropt = '.g:netrw_localmkdiropt + put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd + put = 'let g:netrw_localmovecmdopt = '.g:netrw_localmovecmdopt + put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen + put = 'let g:netrw_menu = '.g:netrw_menu + put = 'let g:netrw_mousemaps = '.g:netrw_mousemaps + put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd + if exists("g:netrw_nobeval") + put = 'let g:netrw_nobeval = '.g:netrw_nobeval + else + put = '\" let g:netrw_nobeval = (not defined)' + endif + put = 'let g:netrw_remote_mkdir = '.g:netrw_remote_mkdir + put = 'let g:netrw_preview = '.g:netrw_preview + put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd + put = 'let g:netrw_retmap = '.g:netrw_retmap + put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd + put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd + put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd + put = 'let g:netrw_sort_by = '.g:netrw_sort_by + put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction + put = 'let g:netrw_sort_options = '.g:netrw_sort_options + put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence + put = 'let g:netrw_servername = '.g:netrw_servername + put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax + put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject + put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd + put = 'let g:netrw_scpport = '.g:netrw_scpport + put = 'let g:netrw_sepchr = '.g:netrw_sepchr + put = 'let g:netrw_sshport = '.g:netrw_sshport + put = 'let g:netrw_timefmt = '.g:netrw_timefmt + let tmpfileescline= line("$") + put ='let g:netrw_tmpfile_escape...' + put = 'let g:netrw_use_noswf = '.g:netrw_use_noswf + put = 'let g:netrw_xstrlen = '.g:netrw_xstrlen + put = 'let g:netrw_winsize = '.g:netrw_winsize + + put ='' + put ='+ For help, place cursor on line and press ' + + 1d + silent %s/^+/"/e + res 99 + silent %s/= \([^0-9].*\)$/= '\1'/e + silent %s/= $/= ''/e + 1 + + call setline(decompressline, "let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1','')) + call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'") + call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'") + call setline(tmpfileescline, "let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'") + + set nomod + + nmap :call NetrwSettingHelp() + nnoremap :call NetrwSettingHelp() + let tmpfile= tempname() + exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod' +endfunction + +" }}} +" NetrwSettingHelp: {{{ + +function! NetrwSettingHelp() + let curline = getline(".") + if curline =~ '=' + let varhelp = substitute(curline,'^\s*let ','','e') + let varhelp = substitute(varhelp,'\s*=.*$','','e') + try + exe "he ".varhelp + catch /^Vim\%((\a\+)\)\=:E149/ + echo "***sorry*** no help available for <".varhelp.">" + endtry + elseif line(".") < s:netrw_settings_stop + he netrw-settings + elseif line(".") < s:netrw_protocol_stop + he netrw-externapp + elseif line(".") < s:netrw_xfer_stop + he netrw-variables + else + he netrw-browse-var + endif +endfunction + +" }}} + +" vim:ts=8 sts=4 sw=4 et fdm=marker diff --git a/runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim b/runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim index 6c1d8582b8..c76d28db04 100644 --- a/runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim @@ -12,7 +12,7 @@ " let g:netrw_list_hide = netrw_gitignore#Hide() " let g:netrw_list_hide = netrw_gitignore#Hide() . 'more,hide,patterns' " -" Copyright: Copyright (C) 2013 Bruno Sutic {{{1 +" Copyright: Copyright (C) 2013 Bruno Sutic {{{ " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, @@ -20,7 +20,10 @@ " warranty of any kind, either expressed or implied. By using " this plugin, you agree that in no event will the copyright " holder be liable for any damages resulting from the use -" of this software. +" of this software. }}} + function! netrw_gitignore#Hide(...) - return substitute(substitute(system('git ls-files --other --ignored --exclude-standard --directory'), '\n', ',', 'g'), ',$', '', '') + return substitute(substitute(system('git ls-files --other --ignored --exclude-standard --directory'), '\n', ',', 'g'), ',$', '', '') endfunction + +" vim:ts=8 sts=4 sw=4 et fdm=marker diff --git a/runtime/pack/dist/opt/netrw/doc/netrw.txt b/runtime/pack/dist/opt/netrw/doc/netrw.txt index 9d277ea45a..cd5777ec9d 100644 --- a/runtime/pack/dist/opt/netrw/doc/netrw.txt +++ b/runtime/pack/dist/opt/netrw/doc/netrw.txt @@ -1,7 +1,7 @@ *netrw.txt* ------------------------------------------------ - NETRW REFERENCE MANUAL by Charles E.Cambell + NETRW REFERENCE MANUAL by Charles E. Campbell ------------------------------------------------ Original Author: Charles E. Campbell diff --git a/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim b/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim index ddf4234aa2..8d10c00153 100644 --- a/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim +++ b/runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim @@ -1,7 +1,7 @@ " Maintainer: Luca Saccarola " Former Maintainer: Charles E Campbell " Upstream: -" Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{1 +" Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{ " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, @@ -9,214 +9,206 @@ " *as is* and comes with no warranty of any kind, either " expressed or implied. By using this plugin, you agree that " in no event will the copyright holder be liable for any damages -" resulting from the use of this software. +" resulting from the use of this software. }}} -" Load Once: {{{1 if &cp || exists("g:loaded_netrwPlugin") - finish + finish endif -let g:loaded_netrwPlugin = "v174" + +let g:loaded_netrwPlugin = "v175" + let s:keepcpo = &cpo set cpo&vim -"DechoRemOn -" --------------------------------------------------------------------- -" Public Interface: {{{1 +" Commands Launch/URL: {{{ + +command -complete=shellcmd -nargs=1 Launch call netrw#Launch(trim()) +command -complete=file -nargs=1 Open call netrw#Open(trim()) + +" }}} +" Local Browsing Autocmds: {{{ -" Commands Launch/URL {{{2 -command -complete=shellcmd -nargs=1 Launch call netrw#Launch(trim()) -command -complete=file -nargs=1 Open call netrw#Open(trim()) -" " }}} -" Local Browsing Autocmds: {{{2 augroup FileExplorer - au! - au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif - au BufEnter * sil call s:LocalBrowse(expand("")) - au VimEnter * sil call s:VimEnter(expand("")) - if has("win32") - au BufEnter .* sil call s:LocalBrowse(expand("")) - endif + au! + au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif + au BufEnter * sil call s:LocalBrowse(expand("")) + au VimEnter * sil call s:VimEnter(expand("")) + if has("win32") + au BufEnter .* sil call s:LocalBrowse(expand("")) + endif augroup END -" Network Browsing Reading Writing: {{{2 +" }}} +" Network Browsing Reading Writing: {{{ + augroup Network - au! - au BufReadCmd file://* call netrw#FileUrlEdit(expand("")) - au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand(""))|call netrw#Nread(2,expand(""))|exe "sil doau BufReadPost ".fnameescape(expand("")) - au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand(""))|call netrw#Nread(1,expand(""))|exe "sil doau FileReadPost ".fnameescape(expand("")) - au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand(""))|exe 'Nwrite '.fnameescape(expand(""))|exe "sil doau BufWritePost ".fnameescape(expand("")) - au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand(""))|exe "'[,']".'Nwrite '.fnameescape(expand(""))|exe "sil doau FileWritePost ".fnameescape(expand("")) - try - au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) - catch /^Vim\%((\a\+)\)\=:E216/ - au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) - endtry + au! + au BufReadCmd file://* call netrw#FileUrlEdit(expand("")) + au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand(""))|call netrw#Nread(2,expand(""))|exe "sil doau BufReadPost ".fnameescape(expand("")) + au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand(""))|call netrw#Nread(1,expand(""))|exe "sil doau FileReadPost ".fnameescape(expand("")) + au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand(""))|exe 'Nwrite '.fnameescape(expand(""))|exe "sil doau BufWritePost ".fnameescape(expand("")) + au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand(""))|exe "'[,']".'Nwrite '.fnameescape(expand(""))|exe "sil doau FileWritePost ".fnameescape(expand("")) + try + au SourceCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) + catch /^Vim\%((\a\+)\)\=:E216/ + au SourcePre ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) + endtry augroup END -" Commands: :Nread, :Nwrite, :NetUserPass {{{2 -com! -count=1 -nargs=* Nread let s:svpos= winsaveview()call netrw#NetRead(,)call winrestview(s:svpos) -com! -range=% -nargs=* Nwrite let s:svpos= winsaveview(),call netrw#NetWrite()call winrestview(s:svpos) -com! -nargs=* NetUserPass call NetUserPass() -com! -nargs=* Nsource let s:svpos= winsaveview()call netrw#NetSource()call winrestview(s:svpos) -com! -nargs=? Ntree call netrw#SetTreetop(1,) - -" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2 -com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(,0,0+0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(,1,0+0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(,1,2+0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(,1,4+0,) -com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(,0,6 ,) -com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,) -com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,) -com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(,0,) - -" Commands: NetrwSettings {{{2 -com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings() -com! -bang NetrwClean call netrw#Clean(0) - -" Maps: +" }}} +" Commands: :Nread, :Nwrite, :NetUserPass {{{ + +command! -count=1 -nargs=* Nread let s:svpos= winsaveview()call netrw#NetRead(,)call winrestview(s:svpos) +command! -range=% -nargs=* Nwrite let s:svpos= winsaveview(),call netrw#NetWrite()call winrestview(s:svpos) +command! -nargs=* NetUserPass call NetUserPass() +command! -nargs=* Nsource let s:svpos= winsaveview()call netrw#NetSource()call winrestview(s:svpos) +command! -nargs=? Ntree call netrw#SetTreetop(1,) + +" }}} +" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{ + +command! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(, 0, 0+0, ) +command! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(, 1, 0+0, ) +command! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(, 1, 2+0, ) +command! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(, 1, 4+0, ) +command! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(, 0, 6, ) +command! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(, 0, ) +command! -nargs=* -bar -bang Nexplore call netrw#Explore(-1, 0, 0, ) +command! -nargs=* -bar -bang Pexplore call netrw#Explore(-2, 0, 0, ) + +" }}} +" Commands: NetrwSettings {{{ + +command! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings() +command! -bang NetrwClean call netrw#Clean(0) + +" }}} +" Maps: {{{ + if !exists("g:netrw_nogx") - if maparg('gx','n') == "" - if !hasmapto('NetrwBrowseX') - nmap gx NetrwBrowseX + if maparg('gx','n') == "" + if !hasmapto('NetrwBrowseX') + nmap gx NetrwBrowseX + endif + nno NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX())) endif - nno NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX())) - endif - if maparg('gx','x') == "" - if !hasmapto('NetrwBrowseXVis') - xmap gx NetrwBrowseXVis + if maparg('gx','x') == "" + if !hasmapto('NetrwBrowseXVis') + xmap gx NetrwBrowseXVis + endif + xno NetrwBrowseXVis :call netrw#BrowseXVis() endif - xno NetrwBrowseXVis :call netrw#BrowseXVis() - endif endif + if exists("g:netrw_usetab") && g:netrw_usetab - if maparg('','n') == "" - nmap NetrwShrink - endif - nno NetrwShrink :call netrw#Shrink() + if maparg('','n') == "" + nmap NetrwShrink + endif + nno NetrwShrink :call netrw#Shrink() endif -" --------------------------------------------------------------------- -" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2 -fun! s:LocalBrowse(dirname) - " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. - " Otherwise, the BufEnter event gets triggered when attempts to write to - " the DBG buffer are made. - - if !exists("s:vimentered") - " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, - " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. - " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)") - " call Dret("s:LocalBrowse") - return - endif - - " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")") - - if has("amiga") - " The check against '' is made for the Amiga, where the empty - " string is the current directory and not checking would break - " things such as the help command. - " call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)") - if a:dirname != '' && isdirectory(a:dirname) - sil! call netrw#LocalBrowseCheck(a:dirname) - if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt - exe w:netrw_bannercnt - endif - endif +" }}} +" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{ - elseif isdirectory(a:dirname) - " call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)") - " call Dredir("LocalBrowse ft last set: ","verbose set ft") - " Jul 13, 2021: for whatever reason, preceding the following call with - " a sil! causes an unbalanced if-endif vim error - call netrw#LocalBrowseCheck(a:dirname) - if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt - exe w:netrw_bannercnt +function! s:LocalBrowse(dirname) + " do not trigger in the terminal + " https://github.com/vim/vim/issues/16463 + if &buftype ==# 'terminal' + return endif - else - " not a directory, ignore it - " call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...") - endif + if !exists("s:vimentered") + " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, + " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. + return + endif - " call Dret("s:LocalBrowse") -endfun + if has("amiga") + " The check against '' is made for the Amiga, where the empty + " string is the current directory and not checking would break + " things such as the help command. + if a:dirname != '' && isdirectory(a:dirname) + sil! call netrw#LocalBrowseCheck(a:dirname) + if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt + exe w:netrw_bannercnt + endif + endif + elseif isdirectory(a:dirname) + " Jul 13, 2021: for whatever reason, preceding the following call with + " a sil! causes an unbalanced if-endif vim error + call netrw#LocalBrowseCheck(a:dirname) + if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt + exe w:netrw_bannercnt + endif + endif +endfunction -" --------------------------------------------------------------------- -" s:VimEnter: after all vim startup stuff is done, this function is called. {{{2 +" }}} +" s:VimEnter: after all vim startup stuff is done, this function is called. {{{ " Its purpose: to look over all windows and run s:LocalBrowse() on " them, which checks if they're directories and will create a directory " listing when appropriate. " It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter() " has already been called. -fun! s:VimEnter(dirname) - " call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">") - if has('nvim') || v:version < 802 - " Johann Höchtl: reported that the call range... line causes an E488: Trailing characters - " error with neovim. I suspect its because neovim hasn't updated with recent - " vim patches. As is, this code will have problems with popup terminals - " instantiated before the VimEnter event runs. - " Ingo Karkat : E488 also in Vim 8.1.1602 - let curwin = winnr() - let s:vimentered = 1 - windo call s:LocalBrowse(expand("%:p")) - exe curwin."wincmd w" - else - " the following complicated expression comes courtesy of lacygoill; largely does the same thing as the windo and - " wincmd which are commented out, but avoids some side effects. Allows popup terminal before VimEnter. - let s:vimentered = 1 - call range(1, winnr('$'))->map({_, v -> win_execute(win_getid(v), 'call expand("%:p")->s:LocalBrowse()')}) - endif - " call Dret("s:VimEnter") -endfun - -" --------------------------------------------------------------------- -" NetrwStatusLine: {{{1 -fun! NetrwStatusLine() - " let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".") - if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") - let &stl= s:netrw_explore_stl - if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif - if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif - return "" - else - return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen - endif -endfun - -" ------------------------------------------------------------------------ -" NetUserPass: set username and password for subsequent ftp transfer {{{1 +function! s:VimEnter(dirname) + if has('nvim') || v:version < 802 + " Johann Höchtl: reported that the call range... line causes an E488: Trailing characters + " error with neovim. I suspect its because neovim hasn't updated with recent + " vim patches. As is, this code will have problems with popup terminals + " instantiated before the VimEnter event runs. + " Ingo Karkat : E488 also in Vim 8.1.1602 + let curwin = winnr() + let s:vimentered = 1 + windo call s:LocalBrowse(expand("%:p")) + exe curwin."wincmd w" + else + " the following complicated expression comes courtesy of lacygoill; largely does the same thing as the windo and + " wincmd which are commented out, but avoids some side effects. Allows popup terminal before VimEnter. + let s:vimentered = 1 + call range(1, winnr('$'))->map({_, v -> win_execute(win_getid(v), 'call expand("%:p")->s:LocalBrowse()')}) + endif +endfunction + +" }}} +" NetrwStatusLine: {{{ + +function! NetrwStatusLine() + if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") + let &stl= s:netrw_explore_stl + unlet! w:netrw_explore_bufnr w:netrw_explore_line + return "" + else + return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen + endif +endfunction + +" }}} +" NetUserPass: set username and password for subsequent ftp transfer {{{ " Usage: :call NetUserPass() -- will prompt for userid and password " :call NetUserPass("uid") -- will prompt for password " :call NetUserPass("uid","password") -- sets global userid and password -fun! NetUserPass(...) - - " get/set userid - if a:0 == 0 - " call Dfunc("NetUserPass(a:0<".a:0.">)") - if !exists("g:netrw_uid") || g:netrw_uid == "" - " via prompt - let g:netrw_uid= input('Enter username: ') +function! NetUserPass(...) + " get/set userid + if a:0 == 0 + if !exists("g:netrw_uid") || g:netrw_uid == "" + " via prompt + let g:netrw_uid= input('Enter username: ') + endif + else " from command line + let g:netrw_uid= a:1 + endif + + " get password + if a:0 <= 1 " via prompt + let g:netrw_passwd= inputsecret("Enter Password: ") + else " from command line + let g:netrw_passwd=a:2 endif - else " from command line - " call Dfunc("NetUserPass(a:1<".a:1.">) {") - let g:netrw_uid= a:1 - endif - - " get password - if a:0 <= 1 " via prompt - " call Decho("a:0=".a:0." case <=1:") - let g:netrw_passwd= inputsecret("Enter Password: ") - else " from command line - " call Decho("a:0=".a:0." case >1: a:2<".a:2.">") - let g:netrw_passwd=a:2 - endif - " call Dret("NetUserPass") -endfun - -" ------------------------------------------------------------------------ -" Modelines And Restoration: {{{1 +endfunction + +" }}} + let &cpo= s:keepcpo unlet s:keepcpo -" vim:ts=8 sts=2 sw=2 et fdm=marker + +" vim:ts=8 sts=4 sw=4 et fdm=marker diff --git a/runtime/pack/dist/opt/netrw/syntax/netrw.vim b/runtime/pack/dist/opt/netrw/syntax/netrw.vim index a94af0c27a..8042854a12 100644 --- a/runtime/pack/dist/opt/netrw/syntax/netrw.vim +++ b/runtime/pack/dist/opt/netrw/syntax/netrw.vim @@ -4,142 +4,146 @@ " Language: Netrw Listing Syntax if exists("b:current_syntax") - finish + finish endif -" Directory List Syntax Highlighting: {{{1 -syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt -syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe - -syn match netrwPlain "\(\S\+ \)*\S\+" contains=netrwLink,@NoSpell -syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell -syn match netrwDir "\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime -syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell -syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell +let b:current_syntax = "netrwlist" + +" Directory List Syntax Highlighting: {{{ + +syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt +syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe + +syn match netrwPlain "\(\S\+ \)*\S\+" contains=netrwLink,@NoSpell +syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell +syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell +syn match netrwDir "\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell +syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime +syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell +syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4') -syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup + syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup else -syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup + syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup endif -syn match netrwTreeBarSpace " " contained - -syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained -syn match netrwDateSep "/" contained -syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep -syn match netrwTimeSep ":" - -syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup,@NoSpell -syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite contains=@NoSpell nextgroup=netrwHidePat -syn match netrwSlash "/" contained -syn match netrwHidePat "[^,]\+" contained skipwhite contains=@NoSpell nextgroup=netrwHideSep -syn match netrwHideSep "," contained skipwhite nextgroup=netrwHidePat -syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList -syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList -syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList -syn match netrwList ".*$" contained contains=netrwComma,@NoSpell -syn match netrwComma "," contained -syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd,netrwQHTopic,@NoSpell keepend contained -syn match netrwHelpCmd "\S\+\ze:" contained skipwhite contains=@NoSpell nextgroup=netrwCmdSep -syn match netrwQHTopic "([a-zA-Z &]\+)" contained skipwhite -syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote -syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell -syn match netrwVersion "(netrw.*)" contained contains=@NoSpell -syn match netrwLink "-->" contained skipwhite - -" ----------------------------- -" Special filetype highlighting {{{1 -" ----------------------------- +syn match netrwTreeBarSpace " " contained + +syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained +syn match netrwDateSep "/" contained +syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep +syn match netrwTimeSep ":" + +syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup,@NoSpell +syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite contains=@NoSpell nextgroup=netrwHidePat +syn match netrwSlash "/" contained +syn match netrwHidePat "[^,]\+" contained skipwhite contains=@NoSpell nextgroup=netrwHideSep +syn match netrwHideSep "," contained skipwhite nextgroup=netrwHidePat +syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList +syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList +syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList +syn match netrwList ".*$" contained contains=netrwComma,@NoSpell +syn match netrwComma "," contained +syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd,netrwQHTopic,@NoSpell keepend contained +syn match netrwHelpCmd "\S\+\ze:" contained skipwhite contains=@NoSpell nextgroup=netrwCmdSep +syn match netrwQHTopic "([a-zA-Z &]\+)" contained skipwhite +syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote +syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell +syn match netrwVersion "(netrw.*)" contained contains=@NoSpell +syn match netrwLink "-->" contained skipwhite + +" }}} +" Special filetype highlighting {{{ + if exists("g:netrw_special_syntax") && g:netrw_special_syntax - if exists("+suffixes") && &suffixes != "" - let suflist= join(split(&suffixes,',')) - let suflist= escape(substitute(suflist," ",'\\|','g'),'.~') - exe "syn match netrwSpecFile '\\(\\S\\+ \\)*\\S*\\(".suflist."\\)\\>' contains=netrwTreeBar,@NoSpell" - endif - syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar,@NoSpell - syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar,@NoSpell - if has("unix") - syn match netrwCoreDump "\" contains=netrwTreeBar,@NoSpell - endif - syn match netrwLex "\(\S\+ \)*\S\+\.\%(l\|lex\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwYacc "\(\S\+ \)*\S\+\.y\>" contains=netrwTreeBar,@NoSpell - syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar,@NoSpell - syn match netrwDoc "\(\S\+ \)*\S\+\.\%(doc\|txt\|pdf\|ps\|docx\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwHdr "\(\S\+ \)*\S\+\.\%(h\|hpp\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar,@NoSpell - syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwPix "\c\(\S\+ \)*\S*\.\%(bmp\|fits\=\|gif\|je\=pg\|pcx\|ppc\|pgm\|png\|ppm\|psd\|rgb\|tif\|xbm\|xcf\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar,@NoSpell - syn match netrwTags "\" contains=netrwTreeBar,@NoSpell - syn match netrwTilde "\(\S\+ \)*\S\+\~\*\=\>" contains=netrwTreeBar,@NoSpell - syn match netrwTmp "\\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell + if exists("+suffixes") && &suffixes != "" + let suflist= join(split(&suffixes,',')) + let suflist= escape(substitute(suflist," ",'\\|','g'),'.~') + exe "syn match netrwSpecFile '\\(\\S\\+ \\)*\\S*\\(".suflist."\\)\\>' contains=netrwTreeBar,@NoSpell" + endif + syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar,@NoSpell + syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar,@NoSpell + if has("unix") + syn match netrwCoreDump "\" contains=netrwTreeBar,@NoSpell + endif + syn match netrwLex "\(\S\+ \)*\S\+\.\%(l\|lex\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwYacc "\(\S\+ \)*\S\+\.y\>" contains=netrwTreeBar,@NoSpell + syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar,@NoSpell + syn match netrwDoc "\(\S\+ \)*\S\+\.\%(doc\|txt\|pdf\|ps\|docx\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwHdr "\(\S\+ \)*\S\+\.\%(h\|hpp\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar,@NoSpell + syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwPix "\c\(\S\+ \)*\S*\.\%(bmp\|fits\=\|gif\|je\=pg\|pcx\|ppc\|pgm\|png\|ppm\|psd\|rgb\|tif\|xbm\|xcf\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar,@NoSpell + syn match netrwTags "\" contains=netrwTreeBar,@NoSpell + syn match netrwTilde "\(\S\+ \)*\S\+\~\*\=\>" contains=netrwTreeBar,@NoSpell + syn match netrwTmp "\\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell endif -" --------------------------------------------------------------------- -" Highlighting Links: {{{1 +" }}} +" Highlighting Links: {{{ + if !exists("did_drchip_netrwlist_syntax") - let did_drchip_netrwlist_syntax= 1 - hi default link netrwClassify Function - hi default link netrwCmdSep Delimiter - hi default link netrwComment Comment - hi default link netrwDir Directory - hi default link netrwHelpCmd Function - hi default link netrwQHTopic Number - hi default link netrwHidePat Statement - hi default link netrwHideSep netrwComment - hi default link netrwList Statement - hi default link netrwVersion Identifier - hi default link netrwSymLink Question - hi default link netrwExe PreProc - hi default link netrwDateSep Delimiter - - hi default link netrwTreeBar Special - hi default link netrwTimeSep netrwDateSep - hi default link netrwComma netrwComment - hi default link netrwHide netrwComment - hi default link netrwMarkFile TabLineSel - hi default link netrwLink Special - - " special syntax highlighting (see :he g:netrw_special_syntax) - hi default link netrwCoreDump WarningMsg - hi default link netrwData Folded - hi default link netrwHdr netrwPlain - hi default link netrwLex netrwPlain - hi default link netrwLib DiffChange - hi default link netrwMakefile DiffChange - hi default link netrwYacc netrwPlain - hi default link netrwPix Special - - hi default link netrwBak netrwGray - hi default link netrwCompress netrwGray - hi default link netrwSpecFile netrwGray - hi default link netrwObj netrwGray - hi default link netrwTags netrwGray - hi default link netrwTilde netrwGray - hi default link netrwTmp netrwGray + let did_drchip_netrwlist_syntax= 1 + hi default link netrwClassify Function + hi default link netrwCmdSep Delimiter + hi default link netrwComment Comment + hi default link netrwDir Directory + hi default link netrwHelpCmd Function + hi default link netrwQHTopic Number + hi default link netrwHidePat Statement + hi default link netrwHideSep netrwComment + hi default link netrwList Statement + hi default link netrwVersion Identifier + hi default link netrwSymLink Question + hi default link netrwExe PreProc + hi default link netrwDateSep Delimiter + + hi default link netrwTreeBar Special + hi default link netrwTimeSep netrwDateSep + hi default link netrwComma netrwComment + hi default link netrwHide netrwComment + hi default link netrwMarkFile TabLineSel + hi default link netrwLink Special + + " special syntax highlighting (see :he g:netrw_special_syntax) + hi default link netrwCoreDump WarningMsg + hi default link netrwData Folded + hi default link netrwHdr netrwPlain + hi default link netrwLex netrwPlain + hi default link netrwLib DiffChange + hi default link netrwMakefile DiffChange + hi default link netrwYacc netrwPlain + hi default link netrwPix Special + + hi default link netrwBak netrwGray + hi default link netrwCompress netrwGray + hi default link netrwSpecFile netrwGray + hi default link netrwObj netrwGray + hi default link netrwTags netrwGray + hi default link netrwTilde netrwGray + hi default link netrwTmp netrwGray endif - " set up netrwGray to be understated (but not Ignore'd or Conceal'd, as those - " can be hard/impossible to read). Users may override this in a colorscheme by - " specifying netrwGray highlighting. - redir => s:netrwgray - sil hi netrwGray - redir END - if s:netrwgray !~ 'guifg' - if has("gui") && has("gui_running") - if &bg == "dark" - exe "hi netrwGray gui=NONE guifg=gray30" - else - exe "hi netrwGray gui=NONE guifg=gray70" - endif - else - hi link netrwGray Folded - endif - endif - -" Current Syntax: {{{1 -let b:current_syntax = "netrwlist" -" --------------------------------------------------------------------- -" vim: ts=8 fdm=marker +" set up netrwGray to be understated (but not Ignore'd or Conceal'd, as those +" can be hard/impossible to read). Users may override this in a colorscheme by +" specifying netrwGray highlighting. +redir => s:netrwgray +sil hi netrwGray +redir END + +if s:netrwgray !~ 'guifg' + if has("gui") && has("gui_running") + if &bg == "dark" + exe "hi netrwGray gui=NONE guifg=gray30" + else + exe "hi netrwGray gui=NONE guifg=gray70" + endif + else + hi link netrwGray Folded + endif +endif + +" }}} + +" vim:ts=8 sts=4 sw=4 et fdm=marker From c65bb2ea8e5cffcbd5dff05572989af4d8936531 Mon Sep 17 00:00:00 2001 From: "Philip H." <47042125+pheiduck@users.noreply.github.com> Date: Sat, 18 Jan 2025 17:38:12 +0100 Subject: [PATCH 53/93] CI: bump windows python to 3.12 closes: #16473 Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com> Signed-off-by: Christian Brabandt --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc0a477501..f611f2c803 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -417,8 +417,8 @@ jobs: PYTHON_VER_DOT: '2.7' PYTHON_DIR: 'C:\Python27' # Python 3 - PYTHON3_VER: 311 - PYTHON3_VER_DOT: '3.11' + PYTHON3_VER: 312 + PYTHON3_VER_DOT: '3.12' # Other dependencies # winpty WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip From 2cb8246eb969594a6969b03dcf8ea89aa7deda6e Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 18 Jan 2025 18:09:38 +0100 Subject: [PATCH 54/93] runtime(tex): add texEmphStyle to texMatchGroup in syntax script fixes: #16228 Co-authored-by: Github User JordL Signed-off-by: Christian Brabandt --- runtime/syntax/testdir/dumps/tex_01_00.dump | 20 ++++++++++++++++++++ runtime/syntax/testdir/input/tex_01.tex | 14 ++++++++++++++ runtime/syntax/tex.vim | 7 ++++--- 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 runtime/syntax/testdir/dumps/tex_01_00.dump create mode 100644 runtime/syntax/testdir/input/tex_01.tex diff --git a/runtime/syntax/testdir/dumps/tex_01_00.dump b/runtime/syntax/testdir/dumps/tex_01_00.dump new file mode 100644 index 0000000000..ef84de4660 --- /dev/null +++ b/runtime/syntax/testdir/dumps/tex_01_00.dump @@ -0,0 +1,20 @@ +>\+0#af5f00255#ffffff0|d|o|c|u|m|e|n|t|c|l|a|s@1|{+0#e000e06&|a|r|t|i|c|l|e|}| +0#0000000&@51 +|\+0#e000e06&|b|e|g|i|n|{|d|o|c|u|m|e|n|t|}| +0#0000000&@58 +|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&@61 +|(|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&|)+0#0000000&| @59 +|(| @1|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&@2|)| @54 +|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&|)+0#0000000&| @60 +|(@1|b|l|a|h|b|l|a|h|)|\+0#e000e06&@1| +0#0000000&@61 +|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&@61 +|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&@61 +|)| @73 +|(|l|o|r|e|m| |i|p|s|u|m|)| @61 +|\+0#00e0003&|t|e|x|t@2|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&@61 +|(| |\+0#00e0003&|t|e|x|t|i|t|{|t+0#0000000&|e|s|t|}+0#00e0003&| +0#0000000&|\+0#00e0003&|t|e|x|t|b|f|{|t+2#0000000&|e|s|t|}+0#00e0003&|)+0#0000000&| @44 +|\+0#e000e06&|e|n|d|{|d|o|c|u|m|e|n|t|}| +0#0000000&@60 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/input/tex_01.tex b/runtime/syntax/testdir/input/tex_01.tex new file mode 100644 index 0000000000..7153d0f1a9 --- /dev/null +++ b/runtime/syntax/testdir/input/tex_01.tex @@ -0,0 +1,14 @@ +\documentclass{article} +\begin{document} +\texttt{test} +(\texttt{test}) +( \texttt{test} ) +\texttt{test}) +((blahblah)\\ +\texttt{test} +\texttt{test} +) +(lorem ipsum) +\texttt{test} +( \textit{test} \textbf{test}) +\end{document} diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index 77a40e11d3..4f35bba939 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -3,7 +3,8 @@ " Maintainer: This runtime file is looking for a new maintainer. " Former Maintainer: Charles E. Campbell " Last Change: Apr 22, 2022 -" 2024 Feb 19 by Vim Project (announce adoption) +" 2024 Feb 19 by Vim Project: announce adoption +" 2025 Jan 18 by Vim Project: add texEmphStyle to texMatchGroup, #16228 " Version: 121 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " @@ -176,11 +177,11 @@ if !s:tex_excludematcher endif if !s:tex_nospell if !s:tex_no_error - syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell + syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texEmphStyle,texZone,texInputFile,texOption,@Spell syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texError,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher,@Spell else - syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell + syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texEmphStyle,texZone,texInputFile,texOption,@Spell syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher,@Spell endif From 90b397586decc3751f92fd2f84271a6b431b56bc Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sun, 19 Jan 2025 09:37:07 +0100 Subject: [PATCH 55/93] patch 9.1.1035: Vim9: memory leak with blob2str() Problem: Vim9: memory leak with blob2str() Solution: free converted_str (Yegappan Lakshmanan) closes: #16481 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/strings.c | 5 +++-- src/testdir/test_functions.vim | 4 ++++ src/version.c | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/strings.c b/src/strings.c index 53e0171aac..120d393552 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1366,9 +1366,10 @@ f_blob2str(typval_T *argvars, typval_T *rettv) } } - if (list_append_string(rettv->vval.v_list, converted_str, -1) == FAIL) - break; + int ret = list_append_string(rettv->vval.v_list, converted_str, -1); vim_free(converted_str); + if (ret == FAIL) + break; } done: diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index bf3e889165..e31e2ed733 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -4311,6 +4311,10 @@ func Test_blob2str() call assert_equal(["🁰🁳"], blob2str(0zF09F81B0.F09F81B3)) call assert_equal(['«»'], blob2str(0zABBB, {'encoding': 'latin1'})) call assert_equal(['«»'], blob2str(0zC2ABC2BB, {'encoding': 'utf8'})) + call assert_equal(['«»'], blob2str(0zC2ABC2BB, {'encoding': 'utf-8'})) + + call assert_equal(['a'], blob2str(0z61, test_null_dict())) + call assert_equal(['a'], blob2str(0z61, {'encoding': test_null_string()})) #" Invalid encoding call assert_fails("call blob2str(0z80)", "E1515: Unable to convert from 'utf-8' encoding") diff --git a/src/version.c b/src/version.c index ba41159774..260f9b53d6 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1035, /**/ 1034, /**/ From 5abc44e3c1d51b9a14be2a9cb679b294f4758287 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 19 Jan 2025 10:00:40 +0100 Subject: [PATCH 56/93] patch 9.1.1036: make install fails when using shadowdir Problem: make install fails when using shadowdir (after v9.1.1029) Solution: also link in README.txt and LICENSE file Signed-off-by: Christian Brabandt --- src/Makefile | 2 ++ src/version.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Makefile b/src/Makefile index 84496b3014..19d1dca9b1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3002,6 +3002,8 @@ shadowupdate: # Link needed for doing "make install" in a shadow directory. runtime: -ln -s ../runtime . + -ln -s ../README.txt . + -ln -s ../LICENSE . # Link needed for doing "make" using GTK in a shadow directory. pixmaps: diff --git a/src/version.c b/src/version.c index 260f9b53d6..9542bcb941 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1036, /**/ 1035, /**/ From bce60c4742a125c070c3c4214332842cb861061c Mon Sep 17 00:00:00 2001 From: Ernie Rael Date: Sun, 19 Jan 2025 10:03:00 +0100 Subject: [PATCH 57/93] patch 9.1.1037: Vim9: confusing error when using abstract method via super Problem: Vim9: confusing error when using abstract method via super Solution: Display an error when an abstract method is invoked using super (Ernie Rael) fixes: #15514 closes: #16478 Signed-off-by: Ernie Rael Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/errors.h | 4 +- src/testdir/test_vim9_class.vim | 261 +++++++++++++++++++++++++------- src/version.c | 2 + src/vim9expr.c | 10 ++ 4 files changed, 223 insertions(+), 54 deletions(-) diff --git a/src/errors.h b/src/errors.h index 6bab826508..4d2818a817 100644 --- a/src/errors.h +++ b/src/errors.h @@ -3619,8 +3619,10 @@ EXTERN char e_class_can_only_be_used_in_script[] INIT(= N_("E1429: Class can only be used in a script")); EXTERN char e_uninitialized_object_var_reference[] INIT(= N_("E1430: Uninitialized object variable '%s' referenced")); +EXTERN char e_abstract_method_str_direct[] + INIT(= N_("E1431: Abstract method \"%s\" in class \"%s\" cannot be accessed directly")); #endif -// E1431 - E1499 unused (reserved for Vim9 class support) +// E1432 - E1499 unused (reserved for Vim9 class support) EXTERN char e_cannot_mix_positional_and_non_positional_str[] INIT(= N_("E1500: Cannot mix positional and non-positional arguments: %s")); EXTERN char e_fmt_arg_nr_unused_str[] diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index cac8b63c7e..3b3ea2015f 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -3268,21 +3268,22 @@ def Test_using_base_class() v9.CheckSourceSuccess(lines) enddef +" Test for using a method from the super class def Test_super_dispatch() # See #15448 and #15463 var lines =<< trim END vim9script class A - def String(): string - return 'A' - enddef + def String(): string + return 'A' + enddef endclass class B extends A - def String(): string - return super.String() - enddef + def String(): string + return super.String() + enddef endclass class C extends B @@ -3296,30 +3297,30 @@ def Test_super_dispatch() vim9script class A - def F(): string - return 'AA' - enddef + def F(): string + return 'AA' + enddef endclass class B extends A - def F(): string - return 'BB' - enddef - def S(): string - return super.F() - enddef - def S0(): string - return this.S() - enddef + def F(): string + return 'BB' + enddef + def S(): string + return super.F() + enddef + def S0(): string + return this.S() + enddef endclass class C extends B - def F(): string - return 'CC' - enddef - def ToB(): string - return super.F() - enddef + def F(): string + return 'CC' + enddef + def ToB(): string + return super.F() + enddef endclass assert_equal('AA', B.new().S()) @@ -3341,51 +3342,51 @@ def Test_super_dispatch() var call_chain: list abstract class A - abstract def _G(): string + abstract def _G(): string - def F(): string - call_chain->add('A.F()') - return this._G() - enddef - def _H(): string - call_chain->add('A._H()') - return this.F() - enddef + def F(): string + call_chain->add('A.F()') + return this._G() + enddef + def _H(): string + call_chain->add('A._H()') + return this.F() + enddef endclass class B extends A - def _G(): string - call_chain->add('B.G()') - return 'BBB' - enddef - def SF(): string - call_chain->add('B.SF()') - return super._H() - enddef + def _G(): string + call_chain->add('B.G()') + return 'BBB' + enddef + def SF(): string + call_chain->add('B.SF()') + return super._H() + enddef endclass class C extends B endclass class D extends C - def SF(): string - call_chain->add('D.SF()') - return super.SF() - enddef + def SF(): string + call_chain->add('D.SF()') + return super.SF() + enddef endclass class E extends D - def SF(): string - call_chain->add('E.SF()') - return super.SF() - enddef + def SF(): string + call_chain->add('E.SF()') + return super.SF() + enddef endclass class F extends E - def _G(): string - call_chain->add('F._G()') - return 'FFF' - enddef + def _G(): string + call_chain->add('F._G()') + return 'FFF' + enddef endclass # E.new() -> A.F() -> B._G() @@ -3401,6 +3402,160 @@ def Test_super_dispatch() assert_equal(['E.SF()', 'D.SF()', 'B.SF()', 'A._H()', 'A.F()', 'F._G()'], call_chain) END v9.CheckSourceSuccess(lines) + + # problems with method dispatch: super -> abstract + # https://github.com/vim/vim/issues/15514 + lines =<< trim END + vim9script + abstract class B + abstract def ToString(): string + endclass + + class C extends B + def ToString(): string + return super.ToString() + enddef + endclass + + try + defcompile C.ToString + call assert_false(1, 'command should have failed') + catch + call assert_exception('E1431: Abstract method "ToString" in class "B" cannot be accessed directly') + endtry + END + v9.CheckSourceSuccess(lines) + + # problems with method dispatch: super -> abstract -> concrete + lines =<< trim END + vim9script + + class A + def ToString() + echo 'A' + enddef + endclass + + abstract class B extends A + abstract def ToString() + endclass + + class C extends B + def ToString() + super.ToString() + enddef + endclass + + try + defcompile C.ToString + call assert_false(1, 'command should have failed') + catch + call assert_exception('E1431: Abstract method "ToString" in class "B" cannot be accessed directly') + endtry + END + v9.CheckSourceSuccess(lines) + + # Invoking a super method and an interface method which have the same name. + lines =<< trim END + vim9script + + interface I + def ToString(): string + endinterface + + # Note that A does not implement I. + class A + def ToString(): string + return 'A' + enddef + endclass + + class B extends A implements I + def ToString(): string + return super.ToString() + enddef + endclass + + def TestI(i: I): string + return i.ToString() + enddef + + assert_equal('A', B.new().ToString()) + assert_equal('A', TestI(B.new())) + END + v9.CheckSourceSuccess(lines) + + # super and an abstract class with no abstract methods + lines =<< trim END + vim9script + + class A + def ToString(): string + return 'A' + enddef + endclass + + # An abstract class with no abstract methods. + abstract class B extends A + endclass + + class C extends B + def ToString(): string + return super.ToString() + enddef + endclass + + def TestA(a: A): string + return a.ToString() + enddef + + def TestB(b: B): string + return b.ToString() + enddef + + assert_equal('A', C.new().ToString()) + assert_equal('A', TestA(A.new())) + assert_equal('A', TestA(C.new())) + assert_equal('A', TestB(C.new())) + END + v9.CheckSourceSuccess(lines) + + # super and an abstract class with no abstract methods and the initial + # implements clause + lines =<< trim END + vim9script + + interface I + def ToString(): string + endinterface + + # Note that A does not implement I. + class A + def ToString(): string + return 'A' + enddef + endclass + + # An abstract class with no abstract methods. + abstract class B extends A implements I + endclass + + class C extends B implements I + def ToString(): string + return super.ToString() + enddef + endclass + + # Note that A.ToString() is different from I.ToString(). + def TestA(a: A): string + return a.ToString() + enddef + + assert_equal('A', C.new().ToString()) + assert_equal('A', TestA(A.new())) + assert_equal('A', TestA(C.new())) + END + v9.CheckSourceSuccess(lines) enddef def Test_class_import() diff --git a/src/version.c b/src/version.c index 9542bcb941..9bd759932a 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1037, /**/ 1036, /**/ diff --git a/src/vim9expr.c b/src/vim9expr.c index 9a96034543..7b8c96adbd 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -373,6 +373,7 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) break; } } + ocmember_T *ocm = NULL; if (ufunc == NULL) { @@ -405,6 +406,15 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) } } + if (is_super && IS_ABSTRACT_METHOD(ufunc)) + { + // Trying to invoke an abstract method in a super class is not + // allowed. + semsg(_(e_abstract_method_str_direct), ufunc->uf_name, + ufunc->uf_defclass->class_name); + return FAIL; + } + // A private object method can be used only inside the class where it // is defined or in one of the child classes. // A private class method can be used only in the class where it is From 8dec6c2e6c2b5157334398e2e6ab7daa91999d80 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 19 Jan 2025 14:02:06 +0100 Subject: [PATCH 58/93] runtime(vim): Update base-syntax, fix is/isnot operator matching - Match is? and isnot? operators. - Limit other comparison operators to one match modifier rather than two. closes: #16482 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/syntax/generator/vim.vim.base | 26 ++++++------ runtime/syntax/testdir/dumps/vim_expr_01.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_02.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_03.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_04.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_05.dump | 24 +++++------ runtime/syntax/testdir/dumps/vim_expr_06.dump | 20 ++++++++++ runtime/syntax/testdir/dumps/vim_expr_07.dump | 20 ++++++++++ runtime/syntax/testdir/input/vim_expr.vim | 40 +++++++++++++++++++ runtime/syntax/vim.vim | 38 +++++++++--------- 10 files changed, 130 insertions(+), 46 deletions(-) create mode 100644 runtime/syntax/testdir/dumps/vim_expr_06.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_07.dump diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index b3bc5ca6f7..23e34235a1 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2025 Jan 09 +" Last Change: 2025 Jan 19 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -192,13 +192,13 @@ Vim9 syn keyword vim9Boolean true false " Numbers {{{2 " ======= syn case ignore -syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment syn case match " All vimCommands are contained by vimIsCommand. {{{2 @@ -281,10 +281,12 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan " Operators: {{{2 " ========= syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar,vimBoolean,vimNull -syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile -syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50 @75 +|"+0#0000e05&| |O|p|e|r|a|t|o|r|s| +0#0000000&@63 @75 -|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 -|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 -@75 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|8|6|,|1| @9|B|o|t| +|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |u|s|i|n|g| |'|i|g|n|o|r|c|a|s|e|'| +0#0000000&@42 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&| +0#0000000&@5|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&| +0#0000000&@5|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@57|8|6|,|1| @9|7|1|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_06.dump b/runtime/syntax/testdir/dumps/vim_expr_06.dump new file mode 100644 index 0000000000..9c58105cbc --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_06.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t| +0#0000000&@1|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@75 +|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |m|a|t|c|h| |c|a|s|e| +0#0000000&@49 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +>e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|#| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|#| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t|#| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@75 +|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |i|g|n|o|r|e| |c|a|s|e| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|?| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@57|1|0|4|,|1| @8|8|7|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_07.dump b/runtime/syntax/testdir/dumps/vim_expr_07.dump new file mode 100644 index 0000000000..c32edfd84d --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_07.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|?| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|?| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +>e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t|?| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@75 +|"+0#0000e05&| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|i|n|c|o|r@1|e|c|t|l|y| |m|a|t|c|h|e|s| |a|s| |"+0#e000002&|e|c|h|o| |v|i|m|N|u|m|b|e|r| |*|v|i|m|C|o|m@1|a|n|d|*| |v|i|m +|N|u|m|b|e|r|"|)+0#0000e05&| +0#0000000&@66 +|e+0#af5f00255&|c|h|o| +0#0000000&|4+0#e000002&|2| +0#0000000&|i+0#af5f00255&|s| +0#0000000&|4+0#e000002&|2| +0#0000000&@61 +@75 +|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 +|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|2@1|,|1| @8|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim index 316f462cae..903db92dbb 100644 --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -85,6 +85,46 @@ echo 0zFF00ED015DAF echo 0zFF00.ED01.5DAF echo 0zFF.00.ED.01.5D.AF +" Operators + +" Comparison - using 'ignorcase' +echo expr == expr +echo expr != expr +echo expr > expr +echo expr >= expr +echo expr < expr +echo expr <= expr +echo expr =~ expr +echo expr !~ expr +echo expr is expr +echo expr isnot expr + +" Comparison - match case +echo expr ==# expr +echo expr !=# expr +echo expr ># expr +echo expr >=# expr +echo expr <# expr +echo expr <=# expr +echo expr =~# expr +echo expr !~# expr +echo expr is# expr +echo expr isnot# expr + +" Comparison - ignore case +echo expr ==? expr +echo expr !=? expr +echo expr >? expr +echo expr >=? expr +echo expr exists() diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 04fc8c1fad..fc69a43572 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2025 Jan 09 +" Last Change: 2025 Jan 19 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -95,21 +95,21 @@ syn keyword vimGroup contained Comment Constant String Character Number Boolean " Default highlighting groups {{{2 " GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR='' -syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel ComplMatchIns Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow +syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow syn match vimHLGroup contained "\" syn case match " Function Names {{{2 " GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR='' -syn keyword vimFuncName contained abs acos add and append appendbufline argc argidx arglistid argv asin assert_beeps assert_equal assert_equalfile assert_exception assert_fails assert_false assert_inrange assert_match assert_nobeep assert_notequal assert_notmatch assert_report assert_true atan atan2 autocmd_add autocmd_delete autocmd_get balloon_gettext balloon_show balloon_split base64_decode base64_encode bindtextdomain blob2list browse browsedir bufadd bufexists buflisted bufload bufloaded bufname bufnr bufwinid bufwinnr byte2line byteidx byteidxcomp call ceil ch_canread ch_close ch_close_in ch_evalexpr ch_evalraw ch_getbufnr ch_getjob ch_info ch_log ch_logfile ch_open ch_read ch_readblob ch_readraw ch_sendexpr ch_sendraw ch_setoptions ch_status changenr char2nr -syn keyword vimFuncName contained charclass charcol charidx chdir cindent clearmatches col complete complete_add complete_check complete_info confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect get getbufinfo getbufline getbufoneline +syn keyword vimFuncName contained abs acos add and append appendbufline argc argidx arglistid argv asin assert_beeps assert_equal assert_equalfile assert_exception assert_fails assert_false assert_inrange assert_match assert_nobeep assert_notequal assert_notmatch assert_report assert_true atan atan2 autocmd_add autocmd_delete autocmd_get balloon_gettext balloon_show balloon_split base64_decode base64_encode bindtextdomain blob2list blob2str browse browsedir bufadd bufexists buflisted bufload bufloaded bufname bufnr bufwinid bufwinnr byte2line byteidx byteidxcomp call ceil ch_canread ch_close ch_close_in ch_evalexpr ch_evalraw ch_getbufnr ch_getjob ch_info ch_log ch_logfile ch_open ch_read ch_readblob ch_readraw ch_sendexpr ch_sendraw ch_setoptions ch_status changenr +syn keyword vimFuncName contained char2nr charclass charcol charidx chdir cindent clearmatches col complete complete_add complete_check complete_info confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect get getbufinfo getbufline getbufoneline syn keyword vimFuncName contained getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo getstacktrace gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto histadd histdel histget histnr hlID hlexists hlget hlset hostname syn keyword vimFuncName contained iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode mzeval nextnonblank nr2char or pathshorten perleval popup_atcursor popup_beval syn keyword vimFuncName contained popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile reduce reg_executing reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground remote_peek syn keyword vimFuncName contained remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist simplify sin sinh slice sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword spellsuggest -syn keyword vimFuncName contained split sqrt srand state str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait terminalprops test_alloc_fail -syn keyword vimFuncName contained test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove winbufnr wincol -syn keyword vimFuncName contained windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor +syn keyword vimFuncName contained split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait terminalprops +syn keyword vimFuncName contained test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove +syn keyword vimFuncName contained winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor "--- syntax here and above generated by mkvimvim --- " Special Vim Highlighting (not automatic) {{{1 @@ -230,13 +230,13 @@ Vim9 syn keyword vim9Boolean true false " Numbers {{{2 " ======= syn case ignore -syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment -syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment +syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment syn case match " All vimCommands are contained by vimIsCommand. {{{2 @@ -319,10 +319,12 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan " Operators: {{{2 " ========= syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar,vimBoolean,vimNull -syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile -syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\ Date: Sun, 19 Jan 2025 14:50:31 +0100 Subject: [PATCH 59/93] patch 9.1.1038: tests: test_channel.py fails with IPv6 Problem: tests: test_channel.py fails with IPv6 (eds-collabora) Solution: Use 127.0.0.1 instead of localhost fixes: #16398 Signed-off-by: Christian Brabandt --- src/testdir/test_channel.py | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_channel.py b/src/testdir/test_channel.py index 35c34fc266..e02f7dbcb4 100644 --- a/src/testdir/test_channel.py +++ b/src/testdir/test_channel.py @@ -285,4 +285,4 @@ def main(host, port, server_class=ThreadedTCPServer): server.shutdown() if __name__ == "__main__": - main("localhost", 0) + main("127.0.0.1", 0) diff --git a/src/version.c b/src/version.c index 9bd759932a..fa82462819 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1038, /**/ 1037, /**/ From a81cf8b99ede7b07152695469e24568a86c91537 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sun, 19 Jan 2025 22:20:34 +0100 Subject: [PATCH 60/93] patch 9.1.1039: Vim9: comments are outdated Problem: Vim9: comments are outdated Solution: Update comments, and include an enum example in the help (Yegappan Lakshmanan) closes: #16485 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- runtime/doc/vim9.txt | 7 ++++--- src/eval.c | 7 ++++--- src/version.c | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 05b451cac3..694ec7c795 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 14 +*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1938,9 +1938,10 @@ Exporting an item can be written as: > export def MyFunc() ... export class MyClass ... export interface MyClass ... + export enum MyEnum ... < *E1043* *E1044* -As this suggests, only constants, variables, `:def` functions and classes can -be exported. +As this suggests, only constants, variables, `:def` functions, classes, +interfaces and enums can be exported. *E1042* `:export` can only be used in Vim9 script, at the script level. diff --git a/src/eval.c b/src/eval.c index 306cfe7f42..387f61d876 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3994,7 +3994,7 @@ eval_shift_number(typval_T *tv1, typval_T *tv2, int shift_type) } /* - * Handle the bitwise left/right shift operator expression: + * Handle fourth level expression (bitwise left/right shift operators): * var1 << var2 * var1 >> var2 * @@ -4512,7 +4512,8 @@ eval7( } /* - * Handle a type cast before a base level expression. + * Handle seventh level expression: + * a type cast before a base level expression. * "arg" must point to the first non-white of the expression. * "arg" is advanced to just after the recognized expression. * Return OK or FAIL. @@ -4883,7 +4884,7 @@ eval9_var_func_name( } /* - * Handle sixth level expression: + * Handle eighth level expression: * number number constant * 0zFFFFFFFF Blob constant * "string" string constant diff --git a/src/version.c b/src/version.c index fa82462819..3a3ee56949 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1039, /**/ 1038, /**/ From 041fc932ba1a19a80f7987fbcf65b6578e096548 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Sun, 19 Jan 2025 16:03:03 -0800 Subject: [PATCH 61/93] ci: Don't use guioptions-k in Vim tests, clean up defaults for gui tests This keeps it consistent with other Vim GUIs and prevent unintentional breakages, since we have enabled guioptions-k as default now in MacVim which isn't the case for other platforms. Also, since MacVim tests are run before Vim GUI tests, there's a possibility that there are stale auto-saved states leftover that interferes with them. Usually they should not matter, but we clean them up anyway to make sure we have a consistent state to run tests from. --- .github/workflows/ci-macvim.yaml | 1 + src/testdir/runtest.vim | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci-macvim.yaml b/.github/workflows/ci-macvim.yaml index 4e2c103632..422a824851 100644 --- a/.github/workflows/ci-macvim.yaml +++ b/.github/workflows/ci-macvim.yaml @@ -380,6 +380,7 @@ jobs: - name: Test Vim (GUI) timeout-minutes: 25 run: | + defaults delete org.vim.MacVim # Clean up stale states left from MacVim tests make ${MAKE_BUILD_ARGS} -C src/testdir clean make ${MAKE_BUILD_ARGS} -C src testgui diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index 0a2c792137..fdc97658a1 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -58,6 +58,9 @@ if has('gui_running') if has('gui_gtk') " to keep screendump size unchanged set guifont=Monospace\ 10 + elseif has('gui_macvim') + " keep defaults consistent with other GUIs + set guioptions-=k endif set columns=80 lines=25 endif From 71028a32db3dc30e835bcc21bef0060cf2967582 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Mon, 20 Jan 2025 20:19:18 +0100 Subject: [PATCH 62/93] runtime(doc): rename last t_BG reference to t_RB This was missed in 37c64c78fd87e086b5a945ad7032787c274e2dcb. closes: #16491 Signed-off-by: Jon Parise Signed-off-by: Christian Brabandt --- runtime/doc/options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 018f10d08d..d689fe11b9 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Jan 14 +*options.txt* For Vim version 9.1. Last change: 2025 Jan 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1033,7 +1033,7 @@ A jump table for the options with a short description can be found at |Q_op|. When the |t_RB| option is set, Vim will use it to request the background color from the terminal. If the returned RGB value is dark/light and 'background' is not dark/light, 'background' will be set and the - screen is redrawn. This may have side effects, make t_BG empty in + screen is redrawn. This may have side effects, make |t_RB| empty in your .vimrc if you suspect this problem. The response to |t_RB| can be found in |v:termrbgresp|. From 4335fcfed1b0a29c07b10f97d1f309dd8f964de6 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 20 Jan 2025 21:01:41 +0100 Subject: [PATCH 63/93] runtime(kconfig): updated ftplugin and syntax script Signed-off-by: Christian Brabandt --- runtime/doc/syntax.txt | 12 +- runtime/ftplugin/kconfig.vim | 3 +- runtime/syntax/kconfig.vim | 1392 +++++++++++++++++----------------- 3 files changed, 709 insertions(+), 698 deletions(-) diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 9b204780a7..38f764f7a1 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 9.1. Last change: 2025 Jan 11 +*syntax.txt* For Vim version 9.1. Last change: 2025 Jan 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2218,6 +2218,16 @@ To disable numbers having their own color add the following to your vimrc: > If you want quotes to have different highlighting than strings > let g:jq_quote_highlight = 1 +KCONFIG *ft-kconfig-syntax* + +Kconfig syntax highlighting language. For syntax syncing, you can configure +the following variable (default: 50): > + + let kconfig_minlines = 50 + +To configure a bit more (heavier) highlighting, set the following variable: > + + let kconfig_syntax_heavy = 1 LACE *lace.vim* *ft-lace-syntax* diff --git a/runtime/ftplugin/kconfig.vim b/runtime/ftplugin/kconfig.vim index 767490701b..1c2857ec50 100644 --- a/runtime/ftplugin/kconfig.vim +++ b/runtime/ftplugin/kconfig.vim @@ -2,7 +2,7 @@ " Vim syntax file " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2024-04-12 +" Latest Revision: 2025 Jan 20 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-kconfig @@ -19,4 +19,5 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql " For matchit.vim if exists("loaded_matchit") let b:match_words = '^\:\,^\:\,^\:\' + let b:undo_ftplugin .= "| unlet! b:match_words" endif diff --git a/runtime/syntax/kconfig.vim b/runtime/syntax/kconfig.vim index 0aecc00060..64a47a5995 100644 --- a/runtime/syntax/kconfig.vim +++ b/runtime/syntax/kconfig.vim @@ -1,7 +1,7 @@ " Vim syntax file " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2024-07-19 +" Latest Revision: 2025 Jan 20 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-kconfig @@ -12,722 +12,722 @@ endif let s:cpo_save = &cpo set cpo&vim +exe "syn sync minlines=" . get(g:, 'kconfig_minlines', 50) + if exists("g:kconfig_syntax_heavy") -syn match kconfigBegin '^' nextgroup=kconfigKeyword - \ skipwhite - -syn keyword kconfigTodo contained TODO FIXME XXX NOTE - -syn match kconfigComment display '#.*$' contains=kconfigTodo - -syn keyword kconfigKeyword config nextgroup=kconfigSymbol - \ skipwhite - -syn keyword kconfigKeyword menuconfig nextgroup=kconfigSymbol - \ skipwhite - -syn keyword kconfigKeyword comment menu mainmenu - \ nextgroup=kconfigKeywordPrompt - \ skipwhite - -syn keyword kconfigKeyword choice - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigKeyword endmenu endchoice - -syn keyword kconfigPreProc source - \ nextgroup=kconfigPath - \ skipwhite - -" TODO: This is a hack. The who .*Expr stuff should really be generated so -" that we can reuse it for various nextgroups. -syn keyword kconfigConditional if endif - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigKeywordPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigPath '"[^"\\]*\%(\\.[^"\\]*\)*"\|\S\+' - \ contained - -syn match kconfigSymbol '\<\k\+\>' - \ contained - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -" FIXME: There is – probably – no reason to cluster these instead of just -" defining them in the same group. -syn cluster kconfigConfigOptions contains=kconfigTypeDefinition, - \ kconfigInputPrompt, - \ kconfigDefaultValue, - \ kconfigDependencies, - \ kconfigReverseDependencies, - \ kconfigNumericalRanges, - \ kconfigHelpText, - \ kconfigDefBool, - \ kconfigOptional - -syn keyword kconfigTypeDefinition bool boolean tristate string hex int - \ contained - \ nextgroup=kconfigTypeDefPrompt, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigTypeDefPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigTypeDefPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigInputPrompt prompt - \ contained - \ nextgroup=kconfigPromptPrompt - \ skipwhite - -syn match kconfigPromptPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigPromptPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigDefaultValue default - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigDependencies 'depends on\|requires' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn keyword kconfigReverseDependencies select - \ contained - \ nextgroup=@kconfigRevDepSymbol - \ skipwhite - -syn cluster kconfigRevDepSymbol contains=kconfigRevDepCSymbol, - \ kconfigRevDepNCSymbol - -syn match kconfigRevDepCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigRevDepCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigRevDepNCSymbol '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigNumericalRanges range - \ contained - \ nextgroup=@kconfigRangeSymbol - \ skipwhite - -syn cluster kconfigRangeSymbol contains=kconfigRangeCSymbol, - \ kconfigRangeNCSymbol - -syn match kconfigRangeCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigRangeSymbol2 - \ skipwhite skipnl - -syn match kconfigRangeCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigRangeSymbol2 - \ skipwhite skipnl - -syn match kconfigRangeNCSymbol '\<\k\+\>' - \ contained - \ nextgroup=@kconfigRangeSymbol2 - \ skipwhite skipnl - -syn cluster kconfigRangeSymbol2 contains=kconfigRangeCSymbol2, - \ kconfigRangeNCSymbol2 - -syn match kconfigRangeCSymbol2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigRangeNCSymbol2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn region kconfigHelpText contained - \ matchgroup=kconfigConfigOption - \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' - \ skip='^$' - \ end='^\z1\@!' - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -" XXX: Undocumented -syn keyword kconfigDefBool def_bool - \ contained - \ nextgroup=@kconfigDefBoolSymbol - \ skipwhite - -syn cluster kconfigDefBoolSymbol contains=kconfigDefBoolCSymbol, - \ kconfigDefBoolNCSymbol - -syn match kconfigDefBoolCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigDefBoolCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigDefBoolNCSymbol '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ @kconfigConfigOptions - \ skipwhite skipnl - -" XXX: This is actually only a valid option for “choice”, but treating it -" specially would require a lot of extra groups. -syn keyword kconfigOptional optional - \ contained - \ nextgroup=@kconfigConfigOptions - \ skipwhite skipnl - -syn keyword kconfigConfigOptionIf if - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn cluster kconfigConfigOptionIfExpr contains=@kconfigConfOptIfExprSym, - \ kconfigConfOptIfExprNeg, - \ kconfigConfOptIfExprGroup - -syn cluster kconfigConfOptIfExprSym contains=kconfigConfOptIfExprCSym, - \ kconfigConfOptIfExprNCSym - -syn match kconfigConfOptIfExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr, - \ kconfigConfOptIfExprEq, - \ kconfigConfOptIfExprNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr, - \ kconfigConfOptIfExprEq, - \ kconfigConfOptIfExprNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfExprNCSym '\<\k\+\>' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr, - \ kconfigConfOptIfExprEq, - \ kconfigConfOptIfExprNEq - \ skipwhite skipnl - -syn cluster kconfigConfOptIfExprSym2 contains=kconfigConfOptIfExprCSym2, - \ kconfigConfOptIfExprNCSym2 - -syn match kconfigConfOptIfExprEq '=' - \ contained - \ nextgroup=@kconfigConfOptIfExprSym2 - \ skipwhite - -syn match kconfigConfOptIfExprNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptIfExprSym2 - \ skipwhite - -syn match kconfigConfOptIfExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr - \ skipwhite skipnl - -syn match kconfigConfOptIfExprNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr - \ skipwhite skipnl - -syn match kconfigConfOptIfExprNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigConfOptIfExprAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigConfOptIfExprOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionIfExpr - \ skipwhite - -syn match kconfigConfOptIfExprGroup '(' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -" TODO: hm, this kind of recursion doesn't work right. We need another set of -" expressions that have kconfigConfigOPtionIfGExp as nextgroup and a matcher -" for '(' that sets it all off. -syn cluster kconfigConfigOptionIfGExp contains=@kconfigConfOptIfGExpSym, - \ kconfigConfOptIfGExpNeg, - \ kconfigConfOptIfExprGroup - -syn cluster kconfigConfOptIfGExpSym contains=kconfigConfOptIfGExpCSym, - \ kconfigConfOptIfGExpNCSym - -syn match kconfigConfOptIfGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=@kconfigConfigIf, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr, - \ kconfigConfOptIfGExpEq, - \ kconfigConfOptIfGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=@kconfigConfigIf, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr, - \ kconfigConfOptIfGExpEq, - \ kconfigConfOptIfGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpNCSym '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr, - \ kconfigConfOptIfGExpEq, - \ kconfigConfOptIfGExpNEq - \ skipwhite skipnl - -syn cluster kconfigConfOptIfGExpSym2 contains=kconfigConfOptIfGExpCSym2, - \ kconfigConfOptIfGExpNCSym2 - -syn match kconfigConfOptIfGExpEq '=' - \ contained - \ nextgroup=@kconfigConfOptIfGExpSym2 - \ skipwhite - -syn match kconfigConfOptIfGExpNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptIfGExpSym2 - \ skipwhite - -syn match kconfigConfOptIfGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptIfExprGrpE, - \ kconfigConfOptIfGExpAnd, - \ kconfigConfOptIfGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptIfGExpNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -syn match kconfigConfOptIfGExpAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -syn match kconfigConfOptIfGExpOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionIfGExp - \ skipwhite - -syn match kconfigConfOptIfExprGrpE ')' - \ contained - \ nextgroup=@kconfigConfigOptions, - \ kconfigConfOptIfExprAnd, - \ kconfigConfOptIfExprOr - \ skipwhite skipnl - - -syn cluster kconfigConfigOptionExpr contains=@kconfigConfOptExprSym, - \ kconfigConfOptExprNeg, - \ kconfigConfOptExprGroup - -syn cluster kconfigConfOptExprSym contains=kconfigConfOptExprCSym, - \ kconfigConfOptExprNCSym - -syn match kconfigConfOptExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ kconfigConfOptExprEq, - \ kconfigConfOptExprNEq, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ kconfigConfOptExprEq, - \ kconfigConfOptExprNEq, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprNCSym '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ kconfigConfOptExprEq, - \ kconfigConfOptExprNEq, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn cluster kconfigConfOptExprSym2 contains=kconfigConfOptExprCSym2, - \ kconfigConfOptExprNCSym2 - -syn match kconfigConfOptExprEq '=' - \ contained - \ nextgroup=@kconfigConfOptExprSym2 - \ skipwhite - -syn match kconfigConfOptExprNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptExprSym2 - \ skipwhite - -syn match kconfigConfOptExprCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr, - \ @kconfigConfigOptions - \ skipwhite skipnl - -syn match kconfigConfOptExprNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigConfOptExprAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigConfOptExprOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionExpr - \ skipwhite - -syn match kconfigConfOptExprGroup '(' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn cluster kconfigConfigOptionGExp contains=@kconfigConfOptGExpSym, - \ kconfigConfOptGExpNeg, - \ kconfigConfOptGExpGroup - -syn cluster kconfigConfOptGExpSym contains=kconfigConfOptGExpCSym, - \ kconfigConfOptGExpNCSym - -syn match kconfigConfOptGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr, - \ kconfigConfOptGExpEq, - \ kconfigConfOptGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr, - \ kconfigConfOptGExpEq, - \ kconfigConfOptGExpNEq - \ skipwhite skipnl - -syn match kconfigConfOptGExpNCSym '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr, - \ kconfigConfOptGExpEq, - \ kconfigConfOptGExpNEq - \ skipwhite skipnl - -syn cluster kconfigConfOptGExpSym2 contains=kconfigConfOptGExpCSym2, - \ kconfigConfOptGExpNCSym2 - -syn match kconfigConfOptGExpEq '=' - \ contained - \ nextgroup=@kconfigConfOptGExpSym2 - \ skipwhite - -syn match kconfigConfOptGExpNEq '!=' - \ contained - \ nextgroup=@kconfigConfOptGExpSym2 - \ skipwhite - -syn match kconfigConfOptGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptGExpNCSym2 '\<\k\+\>' - \ contained - \ nextgroup=kconfigConfOptExprGrpE, - \ kconfigConfOptGExpAnd, - \ kconfigConfOptGExpOr - \ skipwhite skipnl - -syn match kconfigConfOptGExpNeg '!' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn match kconfigConfOptGExpAnd '&&' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn match kconfigConfOptGExpOr '||' - \ contained - \ nextgroup=@kconfigConfigOptionGExp - \ skipwhite - -syn match kconfigConfOptExprGrpE ')' - \ contained - \ nextgroup=kconfigConfigOptionIf, - \ kconfigConfOptExprAnd, - \ kconfigConfOptExprOr - \ skipwhite skipnl - -syn sync minlines=50 - -hi def link kconfigTodo Todo -hi def link kconfigComment Comment -hi def link kconfigKeyword Keyword -hi def link kconfigPreProc PreProc -hi def link kconfigConditional Conditional -hi def link kconfigPrompt String -hi def link kconfigKeywordPrompt kconfigPrompt -hi def link kconfigPath String -hi def link kconfigSymbol String -hi def link kconfigConstantSymbol Constant -hi def link kconfigConfigOption Type -hi def link kconfigTypeDefinition kconfigConfigOption -hi def link kconfigTypeDefPrompt kconfigPrompt -hi def link kconfigInputPrompt kconfigConfigOption -hi def link kconfigPromptPrompt kconfigPrompt -hi def link kconfigDefaultValue kconfigConfigOption -hi def link kconfigDependencies kconfigConfigOption -hi def link kconfigReverseDependencies kconfigConfigOption -hi def link kconfigRevDepCSymbol kconfigConstantSymbol -hi def link kconfigRevDepNCSymbol kconfigSymbol -hi def link kconfigNumericalRanges kconfigConfigOption -hi def link kconfigRangeCSymbol kconfigConstantSymbol -hi def link kconfigRangeNCSymbol kconfigSymbol -hi def link kconfigRangeCSymbol2 kconfigConstantSymbol -hi def link kconfigRangeNCSymbol2 kconfigSymbol -hi def link kconfigHelpText Normal -hi def link kconfigDefBool kconfigConfigOption -hi def link kconfigDefBoolCSymbol kconfigConstantSymbol -hi def link kconfigDefBoolNCSymbol kconfigSymbol -hi def link kconfigOptional kconfigConfigOption -hi def link kconfigConfigOptionIf Conditional -hi def link kconfigConfOptIfExprCSym kconfigConstantSymbol -hi def link kconfigConfOptIfExprNCSym kconfigSymbol -hi def link kconfigOperator Operator -hi def link kconfigConfOptIfExprEq kconfigOperator -hi def link kconfigConfOptIfExprNEq kconfigOperator -hi def link kconfigConfOptIfExprCSym2 kconfigConstantSymbol -hi def link kconfigConfOptIfExprNCSym2 kconfigSymbol -hi def link kconfigConfOptIfExprNeg kconfigOperator -hi def link kconfigConfOptIfExprAnd kconfigOperator -hi def link kconfigConfOptIfExprOr kconfigOperator -hi def link kconfigDelimiter Delimiter -hi def link kconfigConfOptIfExprGroup kconfigDelimiter -hi def link kconfigConfOptIfGExpCSym kconfigConstantSymbol -hi def link kconfigConfOptIfGExpNCSym kconfigSymbol -hi def link kconfigConfOptIfGExpEq kconfigOperator -hi def link kconfigConfOptIfGExpNEq kconfigOperator -hi def link kconfigConfOptIfGExpCSym2 kconfigConstantSymbol -hi def link kconfigConfOptIfGExpNCSym2 kconfigSymbol -hi def link kconfigConfOptIfGExpNeg kconfigOperator -hi def link kconfigConfOptIfGExpAnd kconfigOperator -hi def link kconfigConfOptIfGExpOr kconfigOperator -hi def link kconfigConfOptIfExprGrpE kconfigDelimiter -hi def link kconfigConfOptExprCSym kconfigConstantSymbol -hi def link kconfigConfOptExprNCSym kconfigSymbol -hi def link kconfigConfOptExprEq kconfigOperator -hi def link kconfigConfOptExprNEq kconfigOperator -hi def link kconfigConfOptExprCSym2 kconfigConstantSymbol -hi def link kconfigConfOptExprNCSym2 kconfigSymbol -hi def link kconfigConfOptExprNeg kconfigOperator -hi def link kconfigConfOptExprAnd kconfigOperator -hi def link kconfigConfOptExprOr kconfigOperator -hi def link kconfigConfOptExprGroup kconfigDelimiter -hi def link kconfigConfOptGExpCSym kconfigConstantSymbol -hi def link kconfigConfOptGExpNCSym kconfigSymbol -hi def link kconfigConfOptGExpEq kconfigOperator -hi def link kconfigConfOptGExpNEq kconfigOperator -hi def link kconfigConfOptGExpCSym2 kconfigConstantSymbol -hi def link kconfigConfOptGExpNCSym2 kconfigSymbol -hi def link kconfigConfOptGExpNeg kconfigOperator -hi def link kconfigConfOptGExpAnd kconfigOperator -hi def link kconfigConfOptGExpOr kconfigOperator -hi def link kconfigConfOptExprGrpE kconfigConfOptIfExprGroup + syn match kconfigBegin '^' nextgroup=kconfigKeyword + \ skipwhite + + syn keyword kconfigTodo contained TODO FIXME XXX NOTE + + syn match kconfigComment display '#.*$' contains=kconfigTodo + + syn keyword kconfigKeyword config nextgroup=kconfigSymbol + \ skipwhite + + syn keyword kconfigKeyword menuconfig nextgroup=kconfigSymbol + \ skipwhite + + syn keyword kconfigKeyword comment menu mainmenu + \ nextgroup=kconfigKeywordPrompt + \ skipwhite + + syn keyword kconfigKeyword choice + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigKeyword endmenu endchoice + + syn keyword kconfigPreProc source + \ nextgroup=kconfigPath + \ skipwhite + + " TODO: This is a hack. The who .*Expr stuff should really be generated so + " that we can reuse it for various nextgroups. + syn keyword kconfigConditional if endif + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigKeywordPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigPath '"[^"\\]*\%(\\.[^"\\]*\)*"\|\S\+' + \ contained + + syn match kconfigSymbol '\<\k\+\>' + \ contained + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + " FIXME: There is – probably – no reason to cluster these instead of just + " defining them in the same group. + syn cluster kconfigConfigOptions contains=kconfigTypeDefinition, + \ kconfigInputPrompt, + \ kconfigDefaultValue, + \ kconfigDependencies, + \ kconfigReverseDependencies, + \ kconfigNumericalRanges, + \ kconfigHelpText, + \ kconfigDefBool, + \ kconfigOptional + + syn keyword kconfigTypeDefinition bool boolean tristate string hex int + \ contained + \ nextgroup=kconfigTypeDefPrompt, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigTypeDefPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigTypeDefPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigInputPrompt prompt + \ contained + \ nextgroup=kconfigPromptPrompt + \ skipwhite + + syn match kconfigPromptPrompt '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigPromptPrompt "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigDefaultValue default + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigDependencies 'depends on\|requires' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn keyword kconfigReverseDependencies select + \ contained + \ nextgroup=@kconfigRevDepSymbol + \ skipwhite + + syn cluster kconfigRevDepSymbol contains=kconfigRevDepCSymbol, + \ kconfigRevDepNCSymbol + + syn match kconfigRevDepCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigRevDepCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigRevDepNCSymbol '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigNumericalRanges range + \ contained + \ nextgroup=@kconfigRangeSymbol + \ skipwhite + + syn cluster kconfigRangeSymbol contains=kconfigRangeCSymbol, + \ kconfigRangeNCSymbol + + syn match kconfigRangeCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigRangeSymbol2 + \ skipwhite skipnl + + syn match kconfigRangeCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigRangeSymbol2 + \ skipwhite skipnl + + syn match kconfigRangeNCSymbol '\<\k\+\>' + \ contained + \ nextgroup=@kconfigRangeSymbol2 + \ skipwhite skipnl + + syn cluster kconfigRangeSymbol2 contains=kconfigRangeCSymbol2, + \ kconfigRangeNCSymbol2 + + syn match kconfigRangeCSymbol2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigRangeNCSymbol2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn region kconfigHelpText contained + \ matchgroup=kconfigConfigOption + \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' + \ skip='^$' + \ end='^\z1\@!' + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + " XXX: Undocumented + syn keyword kconfigDefBool def_bool + \ contained + \ nextgroup=@kconfigDefBoolSymbol + \ skipwhite + + syn cluster kconfigDefBoolSymbol contains=kconfigDefBoolCSymbol, + \ kconfigDefBoolNCSymbol + + syn match kconfigDefBoolCSymbol '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigDefBoolCSymbol "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigDefBoolNCSymbol '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ @kconfigConfigOptions + \ skipwhite skipnl + + " XXX: This is actually only a valid option for “choice”, but treating it + " specially would require a lot of extra groups. + syn keyword kconfigOptional optional + \ contained + \ nextgroup=@kconfigConfigOptions + \ skipwhite skipnl + + syn keyword kconfigConfigOptionIf if + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn cluster kconfigConfigOptionIfExpr contains=@kconfigConfOptIfExprSym, + \ kconfigConfOptIfExprNeg, + \ kconfigConfOptIfExprGroup + + syn cluster kconfigConfOptIfExprSym contains=kconfigConfOptIfExprCSym, + \ kconfigConfOptIfExprNCSym + + syn match kconfigConfOptIfExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr, + \ kconfigConfOptIfExprEq, + \ kconfigConfOptIfExprNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr, + \ kconfigConfOptIfExprEq, + \ kconfigConfOptIfExprNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfExprNCSym '\<\k\+\>' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr, + \ kconfigConfOptIfExprEq, + \ kconfigConfOptIfExprNEq + \ skipwhite skipnl + + syn cluster kconfigConfOptIfExprSym2 contains=kconfigConfOptIfExprCSym2, + \ kconfigConfOptIfExprNCSym2 + + syn match kconfigConfOptIfExprEq '=' + \ contained + \ nextgroup=@kconfigConfOptIfExprSym2 + \ skipwhite + + syn match kconfigConfOptIfExprNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptIfExprSym2 + \ skipwhite + + syn match kconfigConfOptIfExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr + \ skipwhite skipnl + + syn match kconfigConfOptIfExprNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr + \ skipwhite skipnl + + syn match kconfigConfOptIfExprNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigConfOptIfExprAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigConfOptIfExprOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionIfExpr + \ skipwhite + + syn match kconfigConfOptIfExprGroup '(' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + " TODO: hm, this kind of recursion doesn't work right. We need another set of + " expressions that have kconfigConfigOPtionIfGExp as nextgroup and a matcher + " for '(' that sets it all off. + syn cluster kconfigConfigOptionIfGExp contains=@kconfigConfOptIfGExpSym, + \ kconfigConfOptIfGExpNeg, + \ kconfigConfOptIfExprGroup + + syn cluster kconfigConfOptIfGExpSym contains=kconfigConfOptIfGExpCSym, + \ kconfigConfOptIfGExpNCSym + + syn match kconfigConfOptIfGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=@kconfigConfigIf, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr, + \ kconfigConfOptIfGExpEq, + \ kconfigConfOptIfGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=@kconfigConfigIf, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr, + \ kconfigConfOptIfGExpEq, + \ kconfigConfOptIfGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpNCSym '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr, + \ kconfigConfOptIfGExpEq, + \ kconfigConfOptIfGExpNEq + \ skipwhite skipnl + + syn cluster kconfigConfOptIfGExpSym2 contains=kconfigConfOptIfGExpCSym2, + \ kconfigConfOptIfGExpNCSym2 + + syn match kconfigConfOptIfGExpEq '=' + \ contained + \ nextgroup=@kconfigConfOptIfGExpSym2 + \ skipwhite + + syn match kconfigConfOptIfGExpNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptIfGExpSym2 + \ skipwhite + + syn match kconfigConfOptIfGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptIfExprGrpE, + \ kconfigConfOptIfGExpAnd, + \ kconfigConfOptIfGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptIfGExpNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + syn match kconfigConfOptIfGExpAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + syn match kconfigConfOptIfGExpOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionIfGExp + \ skipwhite + + syn match kconfigConfOptIfExprGrpE ')' + \ contained + \ nextgroup=@kconfigConfigOptions, + \ kconfigConfOptIfExprAnd, + \ kconfigConfOptIfExprOr + \ skipwhite skipnl + + + syn cluster kconfigConfigOptionExpr contains=@kconfigConfOptExprSym, + \ kconfigConfOptExprNeg, + \ kconfigConfOptExprGroup + + syn cluster kconfigConfOptExprSym contains=kconfigConfOptExprCSym, + \ kconfigConfOptExprNCSym + + syn match kconfigConfOptExprCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ kconfigConfOptExprEq, + \ kconfigConfOptExprNEq, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ kconfigConfOptExprEq, + \ kconfigConfOptExprNEq, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprNCSym '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ kconfigConfOptExprEq, + \ kconfigConfOptExprNEq, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn cluster kconfigConfOptExprSym2 contains=kconfigConfOptExprCSym2, + \ kconfigConfOptExprNCSym2 + + syn match kconfigConfOptExprEq '=' + \ contained + \ nextgroup=@kconfigConfOptExprSym2 + \ skipwhite + + syn match kconfigConfOptExprNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptExprSym2 + \ skipwhite + + syn match kconfigConfOptExprCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr, + \ @kconfigConfigOptions + \ skipwhite skipnl + + syn match kconfigConfOptExprNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigConfOptExprAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigConfOptExprOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionExpr + \ skipwhite + + syn match kconfigConfOptExprGroup '(' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn cluster kconfigConfigOptionGExp contains=@kconfigConfOptGExpSym, + \ kconfigConfOptGExpNeg, + \ kconfigConfOptGExpGroup + + syn cluster kconfigConfOptGExpSym contains=kconfigConfOptGExpCSym, + \ kconfigConfOptGExpNCSym + + syn match kconfigConfOptGExpCSym '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr, + \ kconfigConfOptGExpEq, + \ kconfigConfOptGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptGExpCSym "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr, + \ kconfigConfOptGExpEq, + \ kconfigConfOptGExpNEq + \ skipwhite skipnl + + syn match kconfigConfOptGExpNCSym '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr, + \ kconfigConfOptGExpEq, + \ kconfigConfOptGExpNEq + \ skipwhite skipnl + + syn cluster kconfigConfOptGExpSym2 contains=kconfigConfOptGExpCSym2, + \ kconfigConfOptGExpNCSym2 + + syn match kconfigConfOptGExpEq '=' + \ contained + \ nextgroup=@kconfigConfOptGExpSym2 + \ skipwhite + + syn match kconfigConfOptGExpNEq '!=' + \ contained + \ nextgroup=@kconfigConfOptGExpSym2 + \ skipwhite + + syn match kconfigConfOptGExpCSym2 '"[^"\\]*\%(\\.[^"\\]*\)*"' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptGExpCSym2 "'[^'\\]*\%(\\.[^'\\]*\)*'" + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptGExpNCSym2 '\<\k\+\>' + \ contained + \ nextgroup=kconfigConfOptExprGrpE, + \ kconfigConfOptGExpAnd, + \ kconfigConfOptGExpOr + \ skipwhite skipnl + + syn match kconfigConfOptGExpNeg '!' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn match kconfigConfOptGExpAnd '&&' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn match kconfigConfOptGExpOr '||' + \ contained + \ nextgroup=@kconfigConfigOptionGExp + \ skipwhite + + syn match kconfigConfOptExprGrpE ')' + \ contained + \ nextgroup=kconfigConfigOptionIf, + \ kconfigConfOptExprAnd, + \ kconfigConfOptExprOr + \ skipwhite skipnl + + hi def link kconfigTodo Todo + hi def link kconfigComment Comment + hi def link kconfigKeyword Keyword + hi def link kconfigPreProc PreProc + hi def link kconfigConditional Conditional + hi def link kconfigPrompt String + hi def link kconfigKeywordPrompt kconfigPrompt + hi def link kconfigPath String + hi def link kconfigSymbol String + hi def link kconfigConstantSymbol Constant + hi def link kconfigConfigOption Type + hi def link kconfigTypeDefinition kconfigConfigOption + hi def link kconfigTypeDefPrompt kconfigPrompt + hi def link kconfigInputPrompt kconfigConfigOption + hi def link kconfigPromptPrompt kconfigPrompt + hi def link kconfigDefaultValue kconfigConfigOption + hi def link kconfigDependencies kconfigConfigOption + hi def link kconfigReverseDependencies kconfigConfigOption + hi def link kconfigRevDepCSymbol kconfigConstantSymbol + hi def link kconfigRevDepNCSymbol kconfigSymbol + hi def link kconfigNumericalRanges kconfigConfigOption + hi def link kconfigRangeCSymbol kconfigConstantSymbol + hi def link kconfigRangeNCSymbol kconfigSymbol + hi def link kconfigRangeCSymbol2 kconfigConstantSymbol + hi def link kconfigRangeNCSymbol2 kconfigSymbol + hi def link kconfigHelpText Normal + hi def link kconfigDefBool kconfigConfigOption + hi def link kconfigDefBoolCSymbol kconfigConstantSymbol + hi def link kconfigDefBoolNCSymbol kconfigSymbol + hi def link kconfigOptional kconfigConfigOption + hi def link kconfigConfigOptionIf Conditional + hi def link kconfigConfOptIfExprCSym kconfigConstantSymbol + hi def link kconfigConfOptIfExprNCSym kconfigSymbol + hi def link kconfigOperator Operator + hi def link kconfigConfOptIfExprEq kconfigOperator + hi def link kconfigConfOptIfExprNEq kconfigOperator + hi def link kconfigConfOptIfExprCSym2 kconfigConstantSymbol + hi def link kconfigConfOptIfExprNCSym2 kconfigSymbol + hi def link kconfigConfOptIfExprNeg kconfigOperator + hi def link kconfigConfOptIfExprAnd kconfigOperator + hi def link kconfigConfOptIfExprOr kconfigOperator + hi def link kconfigDelimiter Delimiter + hi def link kconfigConfOptIfExprGroup kconfigDelimiter + hi def link kconfigConfOptIfGExpCSym kconfigConstantSymbol + hi def link kconfigConfOptIfGExpNCSym kconfigSymbol + hi def link kconfigConfOptIfGExpEq kconfigOperator + hi def link kconfigConfOptIfGExpNEq kconfigOperator + hi def link kconfigConfOptIfGExpCSym2 kconfigConstantSymbol + hi def link kconfigConfOptIfGExpNCSym2 kconfigSymbol + hi def link kconfigConfOptIfGExpNeg kconfigOperator + hi def link kconfigConfOptIfGExpAnd kconfigOperator + hi def link kconfigConfOptIfGExpOr kconfigOperator + hi def link kconfigConfOptIfExprGrpE kconfigDelimiter + hi def link kconfigConfOptExprCSym kconfigConstantSymbol + hi def link kconfigConfOptExprNCSym kconfigSymbol + hi def link kconfigConfOptExprEq kconfigOperator + hi def link kconfigConfOptExprNEq kconfigOperator + hi def link kconfigConfOptExprCSym2 kconfigConstantSymbol + hi def link kconfigConfOptExprNCSym2 kconfigSymbol + hi def link kconfigConfOptExprNeg kconfigOperator + hi def link kconfigConfOptExprAnd kconfigOperator + hi def link kconfigConfOptExprOr kconfigOperator + hi def link kconfigConfOptExprGroup kconfigDelimiter + hi def link kconfigConfOptGExpCSym kconfigConstantSymbol + hi def link kconfigConfOptGExpNCSym kconfigSymbol + hi def link kconfigConfOptGExpEq kconfigOperator + hi def link kconfigConfOptGExpNEq kconfigOperator + hi def link kconfigConfOptGExpCSym2 kconfigConstantSymbol + hi def link kconfigConfOptGExpNCSym2 kconfigSymbol + hi def link kconfigConfOptGExpNeg kconfigOperator + hi def link kconfigConfOptGExpAnd kconfigOperator + hi def link kconfigConfOptGExpOr kconfigOperator + hi def link kconfigConfOptExprGrpE kconfigConfOptIfExprGroup else -syn keyword kconfigTodo contained TODO FIXME XXX NOTE + syn keyword kconfigTodo contained TODO FIXME XXX NOTE -syn match kconfigComment display '#.*$' contains=kconfigTodo + syn match kconfigComment display '#.*$' contains=kconfigTodo -syn keyword kconfigKeyword config menuconfig comment mainmenu + syn keyword kconfigKeyword config menuconfig comment mainmenu -syn keyword kconfigConditional menu endmenu choice endchoice if endif + syn keyword kconfigConditional menu endmenu choice endchoice if endif -syn keyword kconfigPreProc source - \ nextgroup=kconfigPath - \ skipwhite + syn keyword kconfigPreProc source + \ nextgroup=kconfigPath + \ skipwhite -syn keyword kconfigTriState y m n + syn keyword kconfigTriState y m n -syn match kconfigSpecialChar contained '\\.' -syn match kconfigSpecialChar '\\$' + syn match kconfigSpecialChar contained '\\.' + syn match kconfigSpecialChar '\\$' -syn region kconfigPath matchgroup=kconfigPath - \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ - \ contains=kconfigSpecialChar + syn region kconfigPath matchgroup=kconfigPath + \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ + \ contains=kconfigSpecialChar -syn region kconfigPath matchgroup=kconfigPath - \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ - \ contains=kconfigSpecialChar + syn region kconfigPath matchgroup=kconfigPath + \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ + \ contains=kconfigSpecialChar -syn match kconfigPath '\S\+' - \ contained + syn match kconfigPath '\S\+' + \ contained -syn region kconfigString matchgroup=kconfigString - \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ - \ contains=kconfigSpecialChar + syn region kconfigString matchgroup=kconfigString + \ start=+"+ skip=+\\\\\|\\\"+ end=+"+ + \ contains=kconfigSpecialChar -syn region kconfigString matchgroup=kconfigString - \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ - \ contains=kconfigSpecialChar + syn region kconfigString matchgroup=kconfigString + \ start=+'+ skip=+\\\\\|\\\'+ end=+'+ + \ contains=kconfigSpecialChar -syn keyword kconfigType bool boolean tristate string hex int + syn keyword kconfigType bool boolean tristate string hex int -syn keyword kconfigOption prompt default requires select range - \ optional -syn match kconfigOption 'depends\%( on\)\=' + syn keyword kconfigOption prompt default requires select range + \ optional + syn match kconfigOption 'depends\%( on\)\=' -syn keyword kconfigMacro def_bool def_tristate + syn keyword kconfigMacro def_bool def_tristate -syn region kconfigHelpText - \ matchgroup=kconfigOption - \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' - \ skip='^$' - \ end='^\z1\@!' + syn region kconfigHelpText + \ matchgroup=kconfigOption + \ start='\%(help\|---help---\)\ze\s*\n\z(\s\+\)' + \ skip='^$' + \ end='^\z1\@!' -hi def link kconfigTodo Todo -hi def link kconfigComment Comment -hi def link kconfigKeyword Keyword -hi def link kconfigConditional Conditional -hi def link kconfigPreProc PreProc -hi def link kconfigTriState Boolean -hi def link kconfigSpecialChar SpecialChar -hi def link kconfigPath String -hi def link kconfigString String -hi def link kconfigType Type -hi def link kconfigOption Identifier -hi def link kconfigHelpText Normal -hi def link kconfigmacro Macro + hi def link kconfigTodo Todo + hi def link kconfigComment Comment + hi def link kconfigKeyword Keyword + hi def link kconfigConditional Conditional + hi def link kconfigPreProc PreProc + hi def link kconfigTriState Boolean + hi def link kconfigSpecialChar SpecialChar + hi def link kconfigPath String + hi def link kconfigString String + hi def link kconfigType Type + hi def link kconfigOption Identifier + hi def link kconfigHelpText Normal + hi def link kconfigmacro Macro endif From d79ea47079a70def4f458f59b65c181488633bf6 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Mon, 20 Jan 2025 21:09:13 +0100 Subject: [PATCH 64/93] patch 9.1.1040: Vim9: imported type cannot be used as func return type Problem: Vim9: imported type cannot be used as func return type (Dayvid Albuquerque) Solution: temporarily reset the is_export flag (Yegappan Lakshmanan) fixes: #16489 closes: #16492 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_vim9_import.vim | 33 ++++++++++++++++++++++++++++++++ src/userfunc.c | 10 ++++++++++ src/version.c | 4 +++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_vim9_import.vim b/src/testdir/test_vim9_import.vim index 4a3e239143..ff81f4a53d 100644 --- a/src/testdir/test_vim9_import.vim +++ b/src/testdir/test_vim9_import.vim @@ -3387,4 +3387,37 @@ def Test_import_locked_var() v9.CheckScriptFailure(lines, 'E741: Value is locked: Foo', 3) enddef +" Test for using an autoload imported class as the function return type +def Test_imported_class_as_def_func_rettype() + var lines =<< trim END + vim9script + + export class Foo + var name: string = "foo" + endclass + END + writefile(lines, 'Ximportclassrettype1.vim', 'D') + + lines =<< trim END + vim9script + + import autoload "./Ximportclassrettype1.vim" as A + + export def CreateFoo(): A.Foo + return A.Foo.new() + enddef + END + writefile(lines, 'Ximportclassrettype2.vim', 'D') + + lines =<< trim END + vim9script + + import './Ximportclassrettype2.vim' as B + + var foo = B.CreateFoo() + assert_equal('foo', foo.name) + END + v9.CheckScriptSuccess(lines) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/userfunc.c b/src/userfunc.c index 06be445af7..91c971e8fa 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -5472,11 +5472,19 @@ define_function( // The function may use script variables from the context. function_using_block_scopes(fp, cstack); + // The argument types and the return type may use an imported type. + // In that case, the imported file will be sourced. To avoid treating + // everything in the imported file as exported, temporarily reset + // is_export. + int save_is_export = is_export; + is_export = FALSE; + if (parse_argument_types(fp, &argtypes, varargs, &arg_objm, obj_members, obj_member_count) == FAIL) { SOURCING_LNUM = lnum_save; free_fp = fp_allocated; + is_export = save_is_export; goto erret; } varargs = FALSE; @@ -5486,8 +5494,10 @@ define_function( { SOURCING_LNUM = lnum_save; free_fp = fp_allocated; + is_export = save_is_export; goto erret; } + is_export = save_is_export; SOURCING_LNUM = lnum_save; } else diff --git a/src/version.c b/src/version.c index 3a3ee56949..8e53159579 100644 --- a/src/version.c +++ b/src/version.c @@ -13,7 +13,7 @@ * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred) * It has been changed beyond recognition since then. * - * Differences between version 8.2 and 9.0 can be found with ":help version9". + * Differences between version 8.2 and 9.1 can be found with ":help version9". * Differences between version 7.4 and 8.x can be found with ":help version8". * Differences between version 6.4 and 7.x can be found with ":help version7". * Differences between version 5.8 and 6.x can be found with ":help version6". @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1040, /**/ 1039, /**/ From cb848b687f9b6ec7b1c3d903d3ff84fc1f52d8e3 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Mon, 20 Jan 2025 21:38:09 +0100 Subject: [PATCH 65/93] patch 9.1.1041: Vim9: out-of-bound access when echoing an enum Problem: Vim9: out-of-bound access when echoing an enum Solution: Add NUL to growarray, check that ufunc is non-null before accessing it to make Coverity happy (Yegappan Lakshmanan) closes: #16488 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_vim9_enum.vim | 15 +++++++++++++++ src/version.c | 2 ++ src/vim9class.c | 1 + src/vim9expr.c | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_vim9_enum.vim b/src/testdir/test_vim9_enum.vim index 74eb468805..de26259d49 100644 --- a/src/testdir/test_vim9_enum.vim +++ b/src/testdir/test_vim9_enum.vim @@ -1586,4 +1586,19 @@ def Test_lambda_block_in_enum() v9.CheckScriptSuccess(lines) enddef +" Echo an enum +def Test_enum_echo() + var lines =<< trim END + vim9script + enum Demo + one('tahi'), + two('rua'), + three('toru') + var alias: string + endenum + assert_equal('enum Demo.one {name: one, ordinal: 0, alias: tahi}', execute('echo Demo.one')->split("\n")[0]) + END + v9.CheckScriptSuccess(lines) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/version.c b/src/version.c index 8e53159579..5b3683ddd8 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1041, /**/ 1040, /**/ diff --git a/src/vim9class.c b/src/vim9class.c index c3ccf0250a..e847bf0864 100644 --- a/src/vim9class.c +++ b/src/vim9class.c @@ -4054,6 +4054,7 @@ object2string( vim_free(ga.ga_data); return NULL; } + ga_append(&ga, NUL); return (char_u *)ga.ga_data; } diff --git a/src/vim9expr.c b/src/vim9expr.c index 7b8c96adbd..b76544869c 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -406,7 +406,7 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) } } - if (is_super && IS_ABSTRACT_METHOD(ufunc)) + if (is_super && ufunc != NULL && IS_ABSTRACT_METHOD(ufunc)) { // Trying to invoke an abstract method in a super class is not // allowed. From c273f1ac770e86767206c8193bab659b25d3b41b Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 20 Jan 2025 21:53:01 +0100 Subject: [PATCH 66/93] runtime(vim): Update base-syntax, match ternary and falsy operators fixes: #14423 fixes: #16227 closes: #16484 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/syntax/generator/vim.vim.base | 20 +++-- .../testdir/dumps/vim9_ex_commands_00.dump | 2 +- .../testdir/dumps/vim9_ex_commands_01.dump | 2 +- .../syntax/testdir/dumps/vim9_expr_00.dump | 24 ++--- .../syntax/testdir/dumps/vim9_expr_01.dump | 38 ++++---- .../syntax/testdir/dumps/vim9_expr_02.dump | 20 +++++ .../syntax/testdir/dumps/vim9_expr_03.dump | 20 +++++ .../syntax/testdir/dumps/vim9_expr_04.dump | 20 +++++ .../syntax/testdir/dumps/vim9_expr_05.dump | 20 +++++ .../syntax/testdir/dumps/vim9_expr_06.dump | 20 +++++ .../testdir/dumps/vim_ex_commands_00.dump | 2 +- .../testdir/dumps/vim_ex_commands_01.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_01.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_02.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_03.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_04.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_05.dump | 22 ++--- runtime/syntax/testdir/dumps/vim_expr_06.dump | 36 ++++---- runtime/syntax/testdir/dumps/vim_expr_07.dump | 34 ++++---- runtime/syntax/testdir/dumps/vim_expr_08.dump | 20 +++++ runtime/syntax/testdir/dumps/vim_expr_09.dump | 20 +++++ runtime/syntax/testdir/dumps/vim_expr_10.dump | 20 +++++ runtime/syntax/testdir/dumps/vim_expr_11.dump | 20 +++++ .../syntax/testdir/input/vim9_ex_commands.vim | 2 +- runtime/syntax/testdir/input/vim9_expr.vim | 87 +++++++++++++++++++ .../syntax/testdir/input/vim_ex_commands.vim | 2 +- runtime/syntax/testdir/input/vim_expr.vim | 68 +++++++++++++++ runtime/syntax/vim.vim | 20 +++-- 28 files changed, 450 insertions(+), 99 deletions(-) create mode 100644 runtime/syntax/testdir/dumps/vim9_expr_02.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_expr_03.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_expr_04.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_expr_05.dump create mode 100644 runtime/syntax/testdir/dumps/vim9_expr_06.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_08.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_09.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_10.dump create mode 100644 runtime/syntax/testdir/dumps/vim_expr_11.dump diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index 23e34235a1..8029073586 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2025 Jan 19 +" Last Change: 2025 Jan 20 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -283,6 +283,10 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar,vimBoolean,vimNull syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\" skipwhite nextgroup=vimString,vimSpecFile @@ -298,9 +302,9 @@ endif syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncSID,Tag syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncSID,Tag -syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold -syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert,vimConst,vimLet -syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For +syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold +syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert,vimConst,vimLet,vimSearch +syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9Search syn region vimFuncPattern contained matchgroup=vimOper start="/" end="$" contains=@vimSubstList syn match vimFunction "\" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey @@ -1017,8 +1021,10 @@ syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained " Searches And Globals: {{{2 " ==================== -syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim +VimL syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained +Vim9 syn match vim9Search '^\s*:[/?].*' contains=vim9SearchDelim +syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep syn region vimGlobal matchgroup=Statement start='\e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&@58 +@8|"+0#e000002&|t|o|p|"| +0#0000000&|:+0#af5f00255&| +0#0000000&@59 +@8|l|n|u|m| |=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&|?+0#af5f00255&| +0#0000000&@52 +@16|"+0#e000002&|l|a|s|t|"| +0#0000000&|:+0#af5f00255&| +0#0000000&@50 +@16|l|n|u|m| @54 @75 -|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@59 -@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@61 ->e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 -@75 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|1|9|,|1| @9|B|o|t| +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&|?+0#af5f00255&| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&|:+0#af5f00255&| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@50 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&|1+0#e000002&| +0#0000000&|:+0#af5f00255&| +0#0000000&|0+0#e000002&| +0#0000000&@60 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|"+0#e000002&|b|a|r|"| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@54 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|g+0#00e0e07&|:|b|a|r| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|$+0#e000e06&|B|A|R| +0#0000000&@51 +|e+0#af5f00255&|c|h|o| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|:+0#af5f00255&| +0#0000000&|F|a|l|s|e|(+0#e000e06&|)| +0#0000000&@44 +|e+0#af5f00255&|c|h|o| +0#0000000&|@+0#e000e06&|a| +0#0000000&|?+0#af5f00255&| +0#0000000&|@+0#e000e06&|a| +0#0000000&|:+0#af5f00255&| +0#0000000&|@+0#e000e06&|b| +0#0000000&@57 +@57|1|9|,|1| @9|1|4|%| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_02.dump b/runtime/syntax/testdir/dumps/vim9_expr_02.dump new file mode 100644 index 0000000000..f8df58e7b4 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_expr_02.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|@+0#e000e06&|a| +0#0000000&|?+0#af5f00255&| +0#0000000&|@+0#e000e06&|a| +0#0000000&|:+0#af5f00255&| +0#0000000&|@+0#e000e06&|b| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&|)+0#e000e06&| +0#0000000&@54 +@75 +|#+0#0000e05&| |F|a|l|s|y| +0#0000000&@67 +@75 +>e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@57 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@43 +|e+0#af5f00255&|c|h|o| +0#0000000&|G|e|t|N|a|m|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|u|n|k|n|o|w|n|'| +0#0000000&@47 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&|?+0#af5f00255&@1| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@51 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@59 +@57|3|7|,|1| @9|3|5|%| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_03.dump b/runtime/syntax/testdir/dumps/vim9_expr_03.dump new file mode 100644 index 0000000000..6f824f2a95 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_expr_03.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@59 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|@+0#e000e06&|a| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|@+0#e000e06&|a| +0#0000000&@61 +>e+0#af5f00255&|c|h|o| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&@59 +@75 +@75 +|#+0#0000e05&| |C|o|m@1|a|n|d| |{|e|x|p|r|}| |a|r|g|u|m|e|n|t|s| +0#0000000&@48 +@75 +|i+0#af5f00255&|f| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@67 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@63 +|e+0#af5f00255&|l|s|e|i|f| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@62 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@62 +|e+0#af5f00255&|n|d|i|f| +0#0000000&@69 +@75 +|w+0#af5f00255&|h|i|l|e| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@64 +@2|b+0#af5f00255&|r|e|a|k| +0#0000000&@67 +|e+0#af5f00255&|n|d|w|h|i|l|e| +0#0000000&@66 +@57|5@1|,|1| @9|5@1|%| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_04.dump b/runtime/syntax/testdir/dumps/vim9_expr_04.dump new file mode 100644 index 0000000000..32a423bd44 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_expr_04.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|n|d|w|h|i|l|e| +0#0000000&@66 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@59 +@2|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|t+0#e000002&|r|u|e| +0#0000000&@61 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +> @74 +@75 +|#+0#0000e05&| |I|s@1|u|e| |#|1|4@1|2|3| |(|v|i|m|.|v|i|m|:| |O|p|t| |o|u|t| |o|f| |v|i|m|S|e|a|r|c|h|*|)| +0#0000000&@27 +@75 +|:|?+0#e000e06&|t+0#e000002&|r|u|t|h|y| +0#0000000&@66 +|c+0#af5f00255&|o|n|s|t| +0#0000000&|t+0#00e0e07&|r|u|t|h|y|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@46 +@4|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&| +0#0000000&@66 +@4|)+0#e000e06&| +0#0000000&@69 +@4|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&| +0#0000000&@66 +@4|)+0#e000e06&| +0#0000000&@69 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&@63 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65 +| +0#e000002&@1|:+0#0000000&|?+0#e000e06&|t+0#e000002&|r|u|t|h|y| +0#0000000&@64 +@57|7|3|,|0|-|1| @7|7|6|%| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_05.dump b/runtime/syntax/testdir/dumps/vim9_expr_05.dump new file mode 100644 index 0000000000..925ce68812 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_expr_05.dump @@ -0,0 +1,20 @@ +| +0#e000002#ffffff0@1|:+0#0000000&|?+0#e000e06&|t+0#e000002&|r|u|t|h|y| +0#0000000&@64 +@2|c+0#af5f00255&|o|n|s|t| +0#0000000&|t+0#00e0e07&|r|u|t|h|y|:+0#0000000&| |n+0#00e0003&|u|m|b|e|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|f+0#e000002&|a|l|s|e| +0#0000000&@44 +@6|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&| +0#0000000&@64 +@6|)+0#e000e06&| +0#0000000&@67 +@6|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&| +0#0000000&@64 +@6>)+0#e000e06&| +0#0000000&@67 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&@61 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 +@75 +|#+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|7| |(|V|i|m|s|c|r|i|p|t| |t|e|r|n|a|r|y| |e|x|p|r|e|s@1|i|o|n| |h|i|g|h|l|i|g|h|t|i|n|g|)| +0#0000000&@16 +@75 +|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|'+0#e000002&|f|o@1|'| +0#0000000&@24|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@25 +|v+0#af5f00255&|a|r| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|f|o@1| |=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|f|o@1|'| +0#0000000&|?+0#af5f00255&| +0#0000000&|'+0#e000002&|b|a|r|'| +0#0000000&|:+0#af5f00255&| +0#0000000&|'+0#e000002&|b|a|z|'| +0#0000000&@36 +|v+0#af5f00255&|a|r| +0#0000000&|b+0#00e0e07&|a|z| +0#0000000&|=+0#af5f00255&| +0#0000000&|f|o@1| |=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|f|o@1|'| +0#0000000&@52 +@12|\+0#e000e06&| +0#0000000&|?+0#af5f00255&| +0#0000000&|'+0#e000002&|b|a|z|'| +0#0000000&@53 +@12|\+0#e000e06&| +0#0000000&|:+0#af5f00255&| +0#0000000&|'+0#e000002&|b|a|r|'| +0#0000000&@53 +|v+0#af5f00255&|a|r| +0#0000000&|q+0#00e0e07&|u|x| +0#0000000&|=+0#af5f00255&| +0#0000000&|f|o@1| |=+0#af5f00255&@1| +0#0000000&|'+0#e000002&|f|o@1|'| +0#0000000&@52 +@12|?+0#af5f00255&| +0#0000000&|'+0#e000002&|q|u|x|'| +0#0000000&@20|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@25 +@57|9|1|,|7| @9|9|6|%| diff --git a/runtime/syntax/testdir/dumps/vim9_expr_06.dump b/runtime/syntax/testdir/dumps/vim9_expr_06.dump new file mode 100644 index 0000000000..befcab3737 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim9_expr_06.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@11|?+0#af5f00255&| +0#0000000&|'+0#e000002&|q|u|x|'| +0#0000000&@20|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@25 +@12|:+0#af5f00255&| +0#0000000&|'+0#e000002&|q|u|x|'| +0#0000000&@20|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@25 +|e+0#af5f00255&|c|h|o| +0#0000000&|q+0#00e0e07&|u|x| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|q|u@1|x|'| +0#0000000&@56 +> @74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|0|7|,|0|-|1| @6|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_ex_commands_00.dump b/runtime/syntax/testdir/dumps/vim_ex_commands_00.dump index 863ae382c9..8c545015a5 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_commands_00.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_commands_00.dump @@ -11,7 +11,7 @@ |:|h+0#af5f00255&|e|l|p| +0#0000000&@69 @1|:|h+0#af5f00255&|e|l|p| +0#0000000&@68 |:| |h+0#af5f00255&|e|l|p| +0#0000000&@68 -@1|:| |h+0#af5f00255&|e|l|p| +0#0000000&@67 +@1|:+0#af5f00255&| +0#0000000&|h+0#00e0e07&|e|l|p| +0#0000000&|#| |F|I|X|M|E| @59 @75 |:|2+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 |:|3+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 diff --git a/runtime/syntax/testdir/dumps/vim_ex_commands_01.dump b/runtime/syntax/testdir/dumps/vim_ex_commands_01.dump index 23936b85c1..1f3f6778e2 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_commands_01.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_commands_01.dump @@ -1,4 +1,4 @@ -| +0&#ffffff0|:| |h+0#af5f00255&|e|l|p| +0#0000000&@67 +| +0&#ffffff0|:+0#af5f00255&| +0#0000000&|h+0#00e0e07&|e|l|p| +0#0000000&|#| |F|I|X|M|E| @59 @75 |:|2+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 |:|3+0#af5f00255&|m|a|t|c|h| +0#0000000&@67 diff --git a/runtime/syntax/testdir/dumps/vim_expr_01.dump b/runtime/syntax/testdir/dumps/vim_expr_01.dump index ca2875d093..8dc7041814 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_01.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_01.dump @@ -17,4 +17,4 @@ |e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|f|o@1|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@62 |e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@59 @75 -@57|1|5|,|1| @10|9|%| +@57|1|5|,|1| @10|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_02.dump b/runtime/syntax/testdir/dumps/vim_expr_02.dump index da1a0d9204..901b5ffeed 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_02.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_02.dump @@ -17,4 +17,4 @@ |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|'+0#e000e06&@1|f+0#e000002&|o@1|'| +0#0000000&@61 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@61 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@58 -@57|3|2|,|0|-|1| @7|2|3|%| +@57|3|2|,|0|-|1| @7|1|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_03.dump b/runtime/syntax/testdir/dumps/vim_expr_03.dump index 74655c8e7a..bcffddf49b 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_03.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_03.dump @@ -17,4 +17,4 @@ |e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|o|3|7@1| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|O|3|7@1| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|3|7@1| +0#0000000&@64 -@57|5|0|,|1| @9|3|9|%| +@57|5|0|,|1| @9|2|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_04.dump b/runtime/syntax/testdir/dumps/vim_expr_04.dump index c76061303c..08c2f98106 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_04.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_04.dump @@ -17,4 +17,4 @@ |e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|0|E|-|6| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@58 @75 -@57|6|8|,|1| @9|5@1|%| +@57|6|8|,|1| @9|3|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_05.dump b/runtime/syntax/testdir/dumps/vim_expr_05.dump index 53f62dc5ea..c927b11f82 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_05.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_05.dump @@ -7,14 +7,14 @@ @75 |"+0#0000e05&| |O|p|e|r|a|t|o|r|s| +0#0000000&@63 @75 -|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |u|s|i|n|g| |'|i|g|n|o|r|c|a|s|e|'| +0#0000000&@42 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&| +0#0000000&@5|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&| +0#0000000&@5|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -@57|8|6|,|1| @9|7|1|%| +|"+0#0000e05&| |T|e|r|n|a|r|y| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|?+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|:+0#af5f00255&| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@51 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&@45 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|l|a|s|t|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&@21 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&@60 +@6|\+0#e000e06&| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&@52 +@6|\+0#e000e06&| +0#0000000&@8|?+0#af5f00255&| +0#0000000&|"+0#e000002&|l|a|s|t|"| +0#0000000&@50 +@57|8|6|,|1| @9|4@1|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_06.dump b/runtime/syntax/testdir/dumps/vim_expr_06.dump index 9c58105cbc..b1b7e4b260 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_06.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_06.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t| +0#0000000&@1|e+0#00e0e07&|x|p|r| +0#0000000&@53 +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&@8|?+0#af5f00255&| +0#0000000&|"+0#e000002&|l|a|s|t|"| +0#0000000&@50 +@6|\+0#e000e06&| +0#0000000&@8|:+0#af5f00255&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&@52 +|e+0#af5f00255&|c|h|o| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&@58 +@6|\+0#e000e06&| +0#0000000&|"+0#e000002&|t|o|p|"| +0#0000000&|:+0#af5f00255&| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|l+0#00e0e07&|n|u|m| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|1+0#e000002&|0@2| +0#0000000&|?+0#af5f00255&| +0#0000000&@52 +@6>\+0#e000e06&| +0#0000000&@8|"+0#e000002&|l|a|s|t|"| +0#0000000&|:+0#af5f00255&| +0#0000000&@50 +@6|\+0#e000e06&| +0#0000000&@8|l+0#00e0e07&|n|u|m| +0#0000000&@54 @75 -|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |m|a|t|c|h| |c|a|s|e| +0#0000000&@49 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 ->e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|#| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|#| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t|#| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&| +0#0000000&|1+0#e000002&| +0#0000000&|:+0#af5f00255&| +0#0000000&|0+0#e000002&| +0#0000000&@60 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|?+0#af5f00255&| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|:+0#af5f00255&| +0#0000000&|"+0#e000002&|b|a|r|"| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&@54 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|g+0#00e0e07&|:|b|a|r| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|?+0#af5f00255&| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|:+0#af5f00255&| +0#0000000&|$+0#e000e06&|B|A|R| +0#0000000&@51 +|e+0#af5f00255&|c|h|o| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|:+0#af5f00255&| +0#0000000&|F|a|l|s|e|(+0#e000e06&|)| +0#0000000&@44 +|e+0#af5f00255&|c|h|o| +0#0000000&|@+0#e000e06&|a| +0#0000000&|?+0#af5f00255&| +0#0000000&|@+0#e000e06&|a| +0#0000000&|:+0#af5f00255&| +0#0000000&|@+0#e000e06&|b| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&|)+0#e000e06&| +0#0000000&@54 @75 -|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |i|g|n|o|r|e| |c|a|s|e| +0#0000000&@48 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|?| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -@57|1|0|4|,|1| @8|8|7|%| +|"+0#0000e05&| |F|a|l|s|y| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@57 +@57|1|0|4|,|7| @8|5|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_07.dump b/runtime/syntax/testdir/dumps/vim_expr_07.dump index c32edfd84d..d0aafdd372 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_07.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_07.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|?| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|?| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 ->e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t|?| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@57 @75 -|"+0#0000e05&| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|i|n|c|o|r@1|e|c|t|l|y| |m|a|t|c|h|e|s| |a|s| |"+0#e000002&|e|c|h|o| |v|i|m|N|u|m|b|e|r| |*|v|i|m|C|o|m@1|a|n|d|*| |v|i|m -|N|u|m|b|e|r|"|)+0#0000e05&| +0#0000000&@66 -|e+0#af5f00255&|c|h|o| +0#0000000&|4+0#e000002&|2| +0#0000000&|i+0#af5f00255&|s| +0#0000000&|4+0#e000002&|2| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@43 +|e+0#af5f00255&|c|h|o| +0#0000000&|G|e|t|N|a|m|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|u|n|k|n|o|w|n|'| +0#0000000&@47 @75 -|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 -|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 +>e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&@62 +@6|\+0#e000e06&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|h|e|L|i|s|t| +0#0000000&|?+0#af5f00255&@1| +0#0000000&@59 +@6|\+0#e000e06&| +0#0000000&|'+0#e000002&|l|i|s|t| |i|s| |e|m|p|t|y|'| +0#0000000&@51 @75 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|1|2@1|,|1| @8|B|o|t| +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|1+0#e000002&| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&@59 +|e+0#af5f00255&|c|h|o| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|g+0#00e0e07&|:|f|o@1| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|$+0#e000e06&|F|O@1| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|T|r|u|e|(+0#e000e06&|)| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|@+0#e000e06&|a| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|@+0#e000e06&|a| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&|?+0#af5f00255&@1| +0#0000000&|(+0#e000e06&|1+0#e000002&|)+0#e000e06&| +0#0000000&@59 +@75 +@57|1|2@1|,|1| @8|6|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_08.dump b/runtime/syntax/testdir/dumps/vim_expr_08.dump new file mode 100644 index 0000000000..8670b55373 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_08.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |u|s|i|n|g| |'|i|g|n|o|r|c|a|s|e|'| +0#0000000&@42 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&| +0#0000000&@5|e+0#00e0e07&|x|p|r| +0#0000000&@53 +>e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&| +0#0000000&@5|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t| +0#0000000&@1|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@75 +|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |m|a|t|c|h| |c|a|s|e| +0#0000000&@49 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|#| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|#| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@57|1|4|0|,|1| @8|7|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_09.dump b/runtime/syntax/testdir/dumps/vim_expr_09.dump new file mode 100644 index 0000000000..106ba757af --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_09.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|#| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|#| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +>e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t|#| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@75 +|"+0#0000e05&| |C|o|m|p|a|r|i|s|o|n| |-| |i|g|n|o|r|e| |c|a|s|e| +0#0000000&@48 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&@1|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|?| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|>+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|?| +0#0000000&@4|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|<+0#af5f00255&|=|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|=+0#af5f00255&|~|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|!+0#af5f00255&|~|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|?| +0#0000000&@3|e+0#00e0e07&|x|p|r| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&|i+0#af5f00255&|s|n|o|t|?| +0#0000000&|e+0#00e0e07&|x|p|r| +0#0000000&@53 +@75 +@57|1|5|8|,|1| @8|8|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_10.dump b/runtime/syntax/testdir/dumps/vim_expr_10.dump new file mode 100644 index 0000000000..35de7699d0 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_10.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|"+0#0000e05&| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|i|n|c|o|r@1|e|c|t|l|y| |m|a|t|c|h|e|s| |a|s| |"+0#e000002&|e|c|h|o| |v|i|m|N|u|m|b|e|r| |*|v|i|m|C|o|m@1|a|n|d|*| |v|i|m +|N|u|m|b|e|r|"|)+0#0000e05&| +0#0000000&@66 +|e+0#af5f00255&|c|h|o| +0#0000000&|4+0#e000002&|2| +0#0000000&|i+0#af5f00255&|s| +0#0000000&|4+0#e000002&|2| +0#0000000&@61 +@75 +> @74 +|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 +|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 +@75 +@75 +|"+0#0000e05&| |I|s@1|u|e| |#|1|4@1|2|3| |(|v|i|m|.|v|i|m|:| |O|p|t| |o|u|t| |o|f| |v|i|m|S|e|a|r|c|h|*|)| +0#0000000&@27 +@75 +|?+0#e000e06&|t+0#e000002&|r|u|t|h|y| +0#0000000&@67 +|l+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&|=+0#af5f00255&| +0#0000000&|0+0#e000002&| +0#0000000&@60 +|\+0#e000e06&| +0#0000000&@2|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&| +0#0000000&@66 +|\+0#e000e06&| +0#0000000&@2|)+0#e000e06&| +0#0000000&@69 +|\+0#e000e06&| +0#0000000&@2|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&| +0#0000000&@66 +|\+0#e000e06&| +0#0000000&@2|)+0#e000e06&| +0#0000000&@69 +|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&@63 +@57|1|7|5|,|0|-|1| @6|9|3|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_11.dump b/runtime/syntax/testdir/dumps/vim_expr_11.dump new file mode 100644 index 0000000000..50d577333a --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_11.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&@63 +@75 +|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60 +| +0#e000002&@1|?+0#e000e06&|t+0#e000002&|r|u|t|h|y| +0#0000000&@65 +@2|l+0#af5f00255&|e|t| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&|=+0#af5f00255&| +0#0000000&|0+0#e000002&| +0#0000000&@58 +@2>\+0#e000e06&| +0#0000000&@2|?+0#af5f00255&| +0#0000000&|(+0#e000e06&|0+0#e000002&| +0#0000000&@64 +@2|\+0#e000e06&| +0#0000000&@2|)+0#e000e06&| +0#0000000&@67 +@2|\+0#e000e06&| +0#0000000&@2|:+0#af5f00255&| +0#0000000&|(+0#e000e06&|1+0#e000002&| +0#0000000&@64 +@2|\+0#e000e06&| +0#0000000&@2|)+0#e000e06&| +0#0000000&@67 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|t+0#00e0e07&|r|u|t|h|y| +0#0000000&@61 +|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|1|9|3|,|3| @8|B|o|t| diff --git a/runtime/syntax/testdir/input/vim9_ex_commands.vim b/runtime/syntax/testdir/input/vim9_ex_commands.vim index c0eb97de83..e08cec31da 100644 --- a/runtime/syntax/testdir/input/vim9_ex_commands.vim +++ b/runtime/syntax/testdir/input/vim9_ex_commands.vim @@ -12,7 +12,7 @@ vim9script :help :help : help - : help + : help # FIXME :2match :3match diff --git a/runtime/syntax/testdir/input/vim9_expr.vim b/runtime/syntax/testdir/input/vim9_expr.vim index 784d8610ad..7faaa5fbf8 100644 --- a/runtime/syntax/testdir/input/vim9_expr.vim +++ b/runtime/syntax/testdir/input/vim9_expr.vim @@ -2,6 +2,59 @@ vim9script # Vim9-script expressions +# Operators + +# Ternary + +echo expr ? expr : expr + +echo lnum == 1 ? "top" : lnum +echo lnum == 1 ? "top" : lnum == 1000 ? "last" : lnum + +echo lnum == 1 + ? "top" + : lnum == 1000 + ? "last" + : lnum +echo lnum == 1 ? + "top" : + lnum == 1000 ? + "last" : + lnum + +echo true ? true : false +echo 1 ? 1 : 0 +echo "foo" ? "foo" : "bar" +echo foo ? foo : bar +echo g:foo ? g:foo : g:bar +echo $FOO ? $FOO : $BAR +echo True() ? True() : False() +echo @a ? @a : @b +echo (1) ? (1) : (0) + +# Falsy + +echo expr ?? expr + +echo theList ?? 'list is empty' +echo GetName() ?? 'unknown' + +echo theList + \ ?? 'list is empty' +echo theList ?? + \ 'list is empty' + +echo true ?? true +echo 1 ?? 1 +echo "foo" ?? "foo" +echo foo ?? foo +echo g:foo ?? g:foo +echo $FOO ?? $FOO +echo True() ?? True() +echo @a ?? @a +echo (1) ?? (1) + + # Command {expr} arguments if true @@ -18,3 +71,37 @@ def Foo(): bool return true enddef + +# Issue #14423 (vim.vim: Opt out of vimSearch*) + +:?truthy +const truthy: number = false + ? (0 + ) + : (1 + ) +echo truthy + +def Foo() + :?truthy + const truthy: number = false + ? (0 + ) + : (1 + ) + echo truthy +enddef + + +# Issue #16227 (Vimscript ternary expression highlighting) + +var foo = 'foo' # comment +var bar = foo == 'foo' ? 'bar' : 'baz' +var baz = foo == 'foo' + \ ? 'baz' + \ : 'bar' +var qux = foo == 'foo' + ? 'qux' # comment + : 'qux' # comment +echo qux ?? 'quux' + diff --git a/runtime/syntax/testdir/input/vim_ex_commands.vim b/runtime/syntax/testdir/input/vim_ex_commands.vim index 98f32d76bb..7a583651d3 100644 --- a/runtime/syntax/testdir/input/vim_ex_commands.vim +++ b/runtime/syntax/testdir/input/vim_ex_commands.vim @@ -11,7 +11,7 @@ :help :help : help - : help + : help # FIXME :2match :3match diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim index 903db92dbb..569d4ceecc 100644 --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -87,6 +87,52 @@ echo 0zFF.00.ED.01.5D.AF " Operators +" Ternary +echo expr ? expr : expr + +echo lnum == 1 ? "top" : lnum +echo lnum == 1 ? "top" : lnum == 1000 ? "last" : lnum + +echo lnum == 1 + \ ? "top" + \ : lnum == 1000 + \ ? "last" + \ : lnum +echo lnum == 1 ? + \ "top" : + \ lnum == 1000 ? + \ "last" : + \ lnum + +echo 1 ? 1 : 0 +echo "foo" ? "foo" : "bar" +echo foo ? foo : bar +echo g:foo ? g:foo : g:bar +echo $FOO ? $FOO : $BAR +echo True() ? True() : False() +echo @a ? @a : @b +echo (1) ? (1) : (0) + +" Falsy +echo expr ?? expr + +echo theList ?? 'list is empty' +echo GetName() ?? 'unknown' + +echo theList + \ ?? 'list is empty' +echo theList ?? + \ 'list is empty' + +echo 1 ?? 1 +echo "foo" ?? "foo" +echo foo ?? foo +echo g:foo ?? g:foo +echo $FOO ?? $FOO +echo True() ?? True() +echo @a ?? @a +echo (1) ?? (1) + " Comparison - using 'ignorcase' echo expr == expr echo expr != expr @@ -126,6 +172,28 @@ echo expr isnot? expr " Unreported issue (incorrectly matches as "echo vimNumber *vimCommand* vimNumber") echo 42 is 42 + " Issue #16221 (vimString becomes vimVar when preceded by !) let bar = !'g:bar'->exists() + +" Issue #14423 (vim.vim: Opt out of vimSearch*) + +?truthy +let truthy = 0 +\ ? (0 +\ ) +\ : (1 +\ ) +echo truthy + +function Foo() + ?truthy + let truthy = 0 + \ ? (0 + \ ) + \ : (1 + \ ) + echo truthy +endfunction + diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index fc69a43572..b19a435229 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2025 Jan 19 +" Last Change: 2025 Jan 20 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -321,6 +321,10 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar,vimBoolean,vimNull syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\" skipwhite nextgroup=vimString,vimSpecFile @@ -336,9 +340,9 @@ endif syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncSID,Tag syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncSID,Tag -syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold -syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert,vimConst,vimLet -syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For +syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold +syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert,vimConst,vimLet,vimSearch +syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9Search syn region vimFuncPattern contained matchgroup=vimOper start="/" end="$" contains=@vimSubstList syn match vimFunction "\" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey @@ -1063,8 +1067,10 @@ syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained " Searches And Globals: {{{2 " ==================== -syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim +VimL syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained +Vim9 syn match vim9Search '^\s*:[/?].*' contains=vim9SearchDelim +syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep syn region vimGlobal matchgroup=Statement start='\ Date: Mon, 20 Jan 2025 21:56:41 +0100 Subject: [PATCH 67/93] patch 9.1.1042: filetype: just files are not recognized Problem: filetype: just files are not recognized Solution: adjust filetype detection pattern, detect just shebang line, include just ftplugin, indent and syntax plugin (Peter Benjamin) closes: #16466 Signed-off-by: Peter Benjamin Signed-off-by: Christian Brabandt --- .github/MAINTAINERS | 3 + runtime/autoload/dist/script.vim | 5 +- runtime/filetype.vim | 4 +- runtime/ftplugin/just.vim | 17 ++ runtime/indent/just.vim | 51 ++++ runtime/syntax/just.vim | 406 +++++++++++++++++++++++++++++++ src/testdir/test_filetype.vim | 1 + src/version.c | 2 + 8 files changed, 486 insertions(+), 3 deletions(-) create mode 100644 runtime/ftplugin/just.vim create mode 100644 runtime/indent/just.vim create mode 100644 runtime/syntax/just.vim diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index 6052197de5..9874dc7ac2 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -208,6 +208,7 @@ runtime/ftplugin/json.vim @dbarnett runtime/ftplugin/json5.vim @dkearns runtime/ftplugin/jsonc.vim @izhakjakov runtime/ftplugin/julia.vim @carlobaldassi +runtime/ftplugin/just.vim @pbnj runtime/ftplugin/jq.vim @vito-c runtime/ftplugin/kconfig.vim @chrisbra runtime/ftplugin/kdl.vim @imsnif @jiangyinzuo @@ -354,6 +355,7 @@ runtime/indent/javascript.vim @bounceme runtime/indent/json.vim @elzr runtime/indent/jsonc.vim @izhakjakov runtime/indent/julia.vim @carlobaldassi +runtime/indent/just.vim @pbnj runtime/indent/kdl.vim @imsnif @jiangyinzuo runtime/indent/kotlin.vim @udalov runtime/indent/krl.vim @KnoP-01 @@ -512,6 +514,7 @@ runtime/syntax/jjdescription.vim @gpanders runtime/syntax/json.vim @vito-c runtime/syntax/jsonc.vim @izhakjakov runtime/syntax/julia.vim @carlobaldassi +runtime/syntax/just.vim @pbnj runtime/syntax/jq.vim @vito-c runtime/syntax/karel.vim @kirillmorozov runtime/syntax/kconfig.vim @chrisbra diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim index 33ed7fd2fc..859126f0f6 100644 --- a/runtime/autoload/dist/script.vim +++ b/runtime/autoload/dist/script.vim @@ -4,7 +4,7 @@ vim9script # Invoked from "scripts.vim" in 'runtimepath' # # Maintainer: The Vim Project -# Last Change: 2023 Aug 10 +# Last Change: 2025 Jan 20 # Former Maintainer: Bram Moolenaar export def DetectFiletype() @@ -133,6 +133,9 @@ export def Exe2filetype(name: string, line1: string): string elseif name =~ 'node\(js\)\=\>\|js\>' || name =~ 'rhino\>' return 'javascript' + elseif name =~# 'just' + return 'just' + # BC calculator elseif name =~ '^bc\>' return 'bc' diff --git a/runtime/filetype.vim b/runtime/filetype.vim index f9d189f631..6b323bd823 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: The Vim Project -" Last Change: 2025 Jan 15 +" Last Change: 2025 Jan 20 " Former Maintainer: Bram Moolenaar " Listen very carefully, I will say this only once @@ -1292,7 +1292,7 @@ au BufNewFile,BufRead *.jsonnet,*.libsonnet setf jsonnet au BufNewFile,BufRead *.jl setf julia " Just -au BufNewFile,BufRead [jJ]ustfile,.justfile,*.just setf just +au BufNewFile,BufRead \c{,*.}justfile,\c*.just setf just " KAREL au BufNewFile,BufRead *.kl setf karel diff --git a/runtime/ftplugin/just.vim b/runtime/ftplugin/just.vim new file mode 100644 index 0000000000..6f2acddf96 --- /dev/null +++ b/runtime/ftplugin/just.vim @@ -0,0 +1,17 @@ +" Vim ftplugin file +" Language: Justfile +" Maintainer: Peter Benjamin <@pbnj> +" Last Change: 2025 Jan 19 +" Credits: The original author, Noah Bogart + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal iskeyword+=- +setlocal comments=n:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setlocal iskeyword< comments< commentstring<" diff --git a/runtime/indent/just.vim b/runtime/indent/just.vim new file mode 100644 index 0000000000..d7f82b118f --- /dev/null +++ b/runtime/indent/just.vim @@ -0,0 +1,51 @@ +" Vim indent file +" Language: Justfile +" Maintainer: Peter Benjamin <@pbnj> +" Last Change: 2025 Jan 19 +" Credits: The original author, Noah Bogart + +" Only load this indent file when no other was loaded yet. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal indentexpr=GetJustfileIndent() +setlocal indentkeys=0},0),!^F,o,O,0=''',0=\"\"\" + +let b:undo_indent = "setlocal indentexpr< indentkeys<" + +if exists("*GetJustfileIndent") + finish +endif + +function GetJustfileIndent() + if v:lnum < 2 + return 0 + endif + + let prev_line = getline(v:lnum - 1) + let last_indent = indent(v:lnum - 1) + + if getline(v:lnum) =~ "\\v^\\s+%([})]|'''$|\"\"\"$)" + return last_indent - shiftwidth() + elseif prev_line =~ '\V#' + return last_indent + elseif prev_line =~ "\\v%([:{(]|^.*\\S.*%([^']'''|[^\"]\"\"\"))\\s*$" + return last_indent + shiftwidth() + elseif prev_line =~ '\\$' + if v:lnum == 2 || getline(v:lnum - 2) !~ '\\$' + if prev_line =~ '\v:\=@!' + return last_indent + shiftwidth() + shiftwidth() + else + return last_indent + shiftwidth() + endif + endif + elseif v:lnum > 2 && getline(v:lnum - 2) =~ '\\$' + return last_indent - shiftwidth() + elseif prev_line =~ '\v:\s*%(\h|\()' && prev_line !~ '\V:=' + return last_indent + shiftwidth() + endif + + return last_indent +endfunction diff --git a/runtime/syntax/just.vim b/runtime/syntax/just.vim new file mode 100644 index 0000000000..77423a3c91 --- /dev/null +++ b/runtime/syntax/just.vim @@ -0,0 +1,406 @@ +" Vim syntax file +" Language: Justfile +" Maintainer: Peter Benjamin <@pbnj> +" Last Change: 2025 Jan 19 +" Credits: The original author, Noah Bogart + +if exists('b:current_syntax') + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +let b:current_syntax = 'just' + +" syncing fromstart prevents mismatched highlighting when jumping around in a justfile +" linebreaks= keeps multi-line constructs highlighted correctly while typing +syn sync fromstart linebreaks=10 + +" a-zA-Z0-9_- +syn iskeyword @,48-57,_,- + +syn match justComment "#.*$" contains=@Spell,justCommentTodo +syn match justCommentInBody '#.*$' contained contains=justCommentTodo,justInterpolation,@justOtherCurlyBraces +syn keyword justCommentTodo TODO FIXME XXX contained +syn match justShebang "^\s*#!.*$" contains=justInterpolation,@justOtherCurlyBraces +syn match justName "\h\k*" contained +syn match justFunction "\h\k*" contained + +syn match justPreBodyComment "\v%(\s|\\\n)*%([^\\]\n)@3%(%(\s|\\\n)*\=)@!" contained + +syn region justRecipeParenDefault + \ matchgroup=justRecipeDepParamsParen start='\v%(\=%(\s|\\\n)*)@<=\(' end='\V)' + \ contained + \ contains=@justExpr +syn match justRecipeSubsequentDeps '\V&&' contained + +syn match justRecipeNoDeps '\v:%(\s|\\\n)*\n|:#@=|:%(\s|\\\n)+#@=' + \ transparent contained + \ contains=justRecipeColon + \ nextgroup=justPreBodyComment,@justBodies +syn region justRecipeDeps start="\v:%(\s|\\\n)*%([a-zA-Z_(]|\&\&)" skip='\\\n' end="\v#@=|\\@1>> expect: [['#!/path/expect']], execline: [['#!/sbin/execlineb -S0'], ['#!/usr/bin/execlineb']], gnuplot: [['#!/path/gnuplot']], + just: [['#!/path/just']], make: [['#!/path/make']], nix: [['#!/path/nix-shell']], pike: [['#!/path/pike'], diff --git a/src/version.c b/src/version.c index 5b3683ddd8..286cbec8cd 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1042, /**/ 1041, /**/ From 4cbc54a7431968371c432dc661002cd49741c2ca Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 20 Jan 2025 22:52:54 +0100 Subject: [PATCH 68/93] runtime(doc): update helptags Signed-off-by: Christian Brabandt --- runtime/doc/tags | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/doc/tags b/runtime/doc/tags index 0e4c14c626..6491350a3f 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -7361,6 +7361,7 @@ ft-javascript-omni insert.txt /*ft-javascript-omni* ft-jq-syntax syntax.txt /*ft-jq-syntax* ft-json-plugin filetype.txt /*ft-json-plugin* ft-json-syntax syntax.txt /*ft-json-syntax* +ft-kconfig-syntax syntax.txt /*ft-kconfig-syntax* ft-ksh-syntax syntax.txt /*ft-ksh-syntax* ft-lace-syntax syntax.txt /*ft-lace-syntax* ft-lex-syntax syntax.txt /*ft-lex-syntax* From 9d1bed5eccdbb46a26b8a484f5e9163c40e63919 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 20 Jan 2025 22:55:57 +0100 Subject: [PATCH 69/93] patch 9.1.1043: [security]: segfault in win_line() Problem: [security]: segfault in win_line() (fizz-is-on-the-way) Solution: Check that ScreenLines is not NULL Github Advisory: https://github.com/vim/vim/security/advisories/GHSA-j3g9-wg22-v955 Signed-off-by: Christian Brabandt --- src/gui.c | 6 ++++-- src/testdir/crash/ex_redraw_crash | 1 + src/testdir/test_crash.vim | 6 ++++++ src/version.c | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 src/testdir/crash/ex_redraw_crash diff --git a/src/gui.c b/src/gui.c index 8e7b079a5a..86c40de632 100644 --- a/src/gui.c +++ b/src/gui.c @@ -4478,13 +4478,15 @@ gui_do_scroll(void) /* * Don't call updateWindow() when nothing has changed (it will overwrite * the status line!). + * + * Check for ScreenLines, because in ex-mode, we don't have a valid display. */ - if (old_topline != wp->w_topline + if (ScreenLines != NULL && (old_topline != wp->w_topline || wp->w_redr_type != 0 #ifdef FEAT_DIFF || old_topfill != wp->w_topfill #endif - ) + )) { int type = UPD_VALID; diff --git a/src/testdir/crash/ex_redraw_crash b/src/testdir/crash/ex_redraw_crash new file mode 100644 index 0000000000..eda294cae1 --- /dev/null +++ b/src/testdir/crash/ex_redraw_crash @@ -0,0 +1 @@ +vdivvi|gIv|÷�X��\��,X��X��\��# X��\��<��\��,X��X diff --git a/src/testdir/test_crash.vim b/src/testdir/test_crash.vim index bfd04ff10f..c83ddf29ea 100644 --- a/src/testdir/test_crash.vim +++ b/src/testdir/test_crash.vim @@ -234,6 +234,12 @@ func Test_crash1_3() call term_sendkeys(buf, args) call TermWait(buf, 50) + let file = 'crash/ex_redraw_crash' + let cmn_args = "%s -u NONE -i NONE -n -m -X -Z -e -s -S %s -c ':qa!'" + let args = printf(cmn_args, vim, file) + call term_sendkeys(buf, args) + call TermWait(buf, 150) + " clean up exe buf .. "bw!" bw! diff --git a/src/version.c b/src/version.c index 286cbec8cd..7a2e5a8030 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1043, /**/ 1042, /**/ From 9601b1435af427382682d923c57731f344e69dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Pe=C5=A1i=C4=87?= <27575106+eevan78@users.noreply.github.com> Date: Tue, 21 Jan 2025 21:42:48 +0100 Subject: [PATCH 70/93] translation(sr): Update Serbian messages translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes: #16500 Signed-off-by: Ivan Pešić <27575106+eevan78@users.noreply.github.com> Signed-off-by: Christian Brabandt --- src/po/sr.po | 70 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 19 deletions(-) diff --git a/src/po/sr.po b/src/po/sr.po index 3b76e3c483..847c3145e5 100644 --- a/src/po/sr.po +++ b/src/po/sr.po @@ -2,7 +2,7 @@ # # Do ":help uganda" in Vim to read copying and usage conditions. # Do ":help credits" in Vim to see a list of people who contributed. -# Copyright (C) 2024 +# Copyright (C) 2025 # This file is distributed under the same license as the Vim package. # FIRST AUTHOR Ivan Pešić , 2017. # @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: Vim(Serbian)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-19 10:23+0400\n" -"PO-Revision-Date: 2024-07-19 10:39+0400\n" +"POT-Creation-Date: 2025-01-21 15:11+0400\n" +"PO-Revision-Date: 2025-01-21 15:26+0400\n" "Last-Translator: Ivan Pešić \n" "Language-Team: Serbian\n" "Language: sr\n" @@ -161,8 +161,8 @@ msgid "Top" msgstr "Врх" #, c-format -msgid "%d%%" -msgstr "%d%%" +msgid "%s%d%%" +msgstr "%s%d%%" #, c-format msgid " (%d of %d)" @@ -785,11 +785,11 @@ msgid "[unix format]" msgstr "[unix формат]" #, c-format -msgid "%ld line, " -msgid_plural "%ld lines, " -msgstr[0] "%ld линија, " -msgstr[1] "%ld линије, " -msgstr[2] "%ld линија, " +msgid "%s%ld line, " +msgid_plural "%s%ld lines, " +msgstr[0] "%s%ld линија, " +msgstr[1] "%s%ld линије, " +msgstr[2] "%s%ld линија, " #, c-format msgid "%lld byte" @@ -1262,6 +1262,15 @@ msgstr "linenr је ван опсега" msgid "not allowed in the Vim sandbox" msgstr "није дозвољено унутар Vim sandbox" +#, c-format +msgid "E370: Could not load library %s" +msgstr "E370: Библиотека %s није могла да се учита" + +msgid "Sorry, this command is disabled: the Perl library could not be loaded." +msgstr "" +"Жао нам је, ова команда је онемогућена: Perl библиотека није могла да се " +"учита." + msgid "invalid buffer number" msgstr "неисправан број бафера" @@ -2290,6 +2299,12 @@ msgstr "-- Још --" msgid " SPACE/d/j: screen/page/line down, b/u/k: up, q: quit " msgstr " РАЗМАКНИЦА/d/j: екран/страна/линија наниже, b/u/k: навише, q: излаз " +msgid "W23: Clipboard register not available, using register 0" +msgstr "W23: Клипборд регистар није доступан, користи се регистар 0" + +msgid "W24: Clipboard register not available. See :h W24" +msgstr "W24: Клипборд регистар није доступан. Погледајте :h W24" + msgid "Question" msgstr "Питање" @@ -3877,15 +3892,6 @@ msgstr "Уписивање viminfo фајла „%s”" msgid "Already only one window" msgstr "Већ постоји само један прозор" -#, c-format -msgid "E370: Could not load library %s" -msgstr "E370: Библиотека %s није могла да се учита" - -msgid "Sorry, this command is disabled: the Perl library could not be loaded." -msgstr "" -"Жао нам је, ова команда је онемогућена: Perl библиотека није могла да се " -"учита." - msgid "Edit with Vim using &tabpages" msgstr "Уређуј програмом Vim у новој &картици" @@ -7443,6 +7449,9 @@ msgstr "E1043: Неважећа команда након :export" msgid "E1044: Export with invalid argument" msgstr "E1044: Export са неважећим аргументом" +msgid "E1045: Import nesting too deep" +msgstr "E1045: Import угњеждавање је сувише дубоко" + #, c-format msgid "E1047: Syntax error in import: %s" msgstr "E1047: Синтаксна грешка у import: %s" @@ -8798,6 +8807,16 @@ msgstr "E1428: Дуплирана вредност набрајања: %s" msgid "E1429: Class can only be used in a script" msgstr "E1429: Class може да се употреби само у скрипти" +#, c-format +msgid "E1430: Uninitialized object variable '%s' referenced" +msgstr "E1430: Указује се на неиницијализовану објекат променљиву ’%s’" + +#, c-format +msgid "" +"E1431: Abstract method \"%s\" in class \"%s\" cannot be accessed directly" +msgstr "" +"E1431: Апстрактној методи „%s” у класи „%s” не може директно да се приступи" + #, c-format msgid "E1500: Cannot mix positional and non-positional arguments: %s" msgstr "E1500: Не могу да се мешају позициони и непозициони аргументи: %s" @@ -8855,6 +8874,13 @@ msgstr "E1512: Погрешна ширина карактера за поље msgid "E1513: Cannot switch buffer. 'winfixbuf' is enabled" msgstr "E1513: Не може да пређе на други бафер. Укључена је опција 'winfixbuf'" +msgid "E1514: 'findfunc' did not return a List type" +msgstr "E1514: 'findfunc' није вратила тип Листа" + +#, c-format +msgid "E1515: Unable to convert %s '%s' encoding" +msgstr "E1515: Кодирање %s ’%s’ не може да се конвертује" + msgid "--No lines in buffer--" msgstr "--У баферу нема линија--" @@ -9889,6 +9915,9 @@ msgstr "" msgid "list of flags to make messages shorter" msgstr "листа заставица за скраћивање порука" +msgid "options for outputting messages" +msgstr "опције за исписивање порука" + msgid "show (partial) command keys in location given by 'showcmdloc'" msgstr "" "приказује (делимичне) тастере команде на месту наведеном у 'showcmdloc'" @@ -10009,6 +10038,9 @@ msgstr "наводи како ради довршавање у режиму Ум msgid "whether to use a popup menu for Insert mode completion" msgstr "да ли се за довршавање у режиму Уметање користи искачући мени" +msgid "popup menu item align order" +msgstr "редослед поравнања ставки искачућег менија" + msgid "options for the Insert mode completion info popup" msgstr "опције за искачући мени за довршавање у режиму Уметање" From e2a0471851dda26bd1b1011cb85a466ea3062e49 Mon Sep 17 00:00:00 2001 From: ichizok Date: Tue, 21 Jan 2025 21:48:58 +0100 Subject: [PATCH 71/93] Update .gitignore for v9.1.1036 Ignore the src/{LICENSE,README.txt} which are created from shadow directories. closes: #16499 Signed-off-by: ichizok Signed-off-by: Christian Brabandt --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 048ced9db6..0d38d901de 100644 --- a/.gitignore +++ b/.gitignore @@ -111,6 +111,8 @@ src/shadow src/shadow-* src/runtime src/pixmaps +src/LICENSE +src/README.txt # other files possibly created by tools src/cscope.out From d9a1f267bab01f08257ae8bbee898be9b0fb8624 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 21 Jan 2025 22:17:50 +0100 Subject: [PATCH 72/93] patch 9.1.1044: Vim9: Patch 9.1.1014 causes regressions Problem: Vim9: Patch 9.1.1014 causes regressions Solution: revert it for now This reverts commit 57f0119358ed7f060d5020309b9043463121435f since this causes some regressions: https://github.com/vim/vim/pull/16440#issuecomment-2600235629 So revert "patch 9.1.1014: Vim9: variable not found in transitive import" for now. Signed-off-by: Christian Brabandt --- runtime/doc/options.txt | 3 +- runtime/doc/tags | 1 - runtime/doc/vim9.txt | 17 ++++----- src/errors.h | 3 +- src/testdir/test_vim9_class.vim | 68 +-------------------------------- src/version.c | 2 + src/vim9compile.c | 14 ------- 7 files changed, 13 insertions(+), 95 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index d689fe11b9..50ef430b68 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Jan 20 +*options.txt* For Vim version 9.1. Last change: 2025 Jan 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -5582,7 +5582,6 @@ A jump table for the options with a short description can be found at |Q_op|. command recursion, see |E169|. See also |:function|. Also used for maximum depth of callback functions. - Also used for maximum depth of import. See |:import-cycle|. *'maxmapdepth'* *'mmd'* *E223* 'maxmapdepth' 'mmd' number (default 1000) diff --git a/runtime/doc/tags b/runtime/doc/tags index 6491350a3f..0b9253203b 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4148,7 +4148,6 @@ E1041 vim9.txt /*E1041* E1042 vim9.txt /*E1042* E1043 vim9.txt /*E1043* E1044 vim9.txt /*E1044* -E1045 vim9.txt /*E1045* E1047 vim9.txt /*E1047* E1048 vim9.txt /*E1048* E1049 vim9.txt /*E1049* diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 694ec7c795..5ea4ebe58e 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 19 +*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2052,14 +2052,13 @@ prefixing the function with || you should use||. For example: > noremap ,a :call s:that.OtherFunc() < - *:import-cycle* *E1045* -The `import` commands are executed when encountered. It can be nested up to -'maxfuncdepth' levels deep. If script A imports script B, and B (directly or -indirectly) imports A, this will be skipped over. At this point items in A -after "import B" will not have been processed and defined yet. Therefore -cyclic imports can exist and not result in an error directly, but may result -in an error for items in A after "import B" not being defined. This does not -apply to autoload imports, see the next section. + *:import-cycle* +The `import` commands are executed when encountered. If script A imports +script B, and B (directly or indirectly) imports A, this will be skipped over. +At this point items in A after "import B" will not have been processed and +defined yet. Therefore cyclic imports can exist and not result in an error +directly, but may result in an error for items in A after "import B" not being +defined. This does not apply to autoload imports, see the next section. Importing an autoload script ~ diff --git a/src/errors.h b/src/errors.h index 4d2818a817..94675289c1 100644 --- a/src/errors.h +++ b/src/errors.h @@ -2738,8 +2738,7 @@ EXTERN char e_invalid_command_after_export[] INIT(= N_("E1043: Invalid command after :export")); EXTERN char e_export_with_invalid_argument[] INIT(= N_("E1044: Export with invalid argument")); -EXTERN char e_import_nesting_too_deep[] - INIT(= N_("E1045: Import nesting too deep")); +// E1045 not used // E1046 not used EXTERN char e_syntax_error_in_import_str[] INIT(= N_("E1047: Syntax error in import: %s")); diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index 3b3ea2015f..c39f18c4d7 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -3662,73 +3662,7 @@ def Test_extend_imported_class() v9.CheckScriptSuccess(lines) enddef -" Test for multi level import -def Test_multi_level_import_normal() - var lines =<< trim END - vim9script - export class Property - public var value: string - endclass - END - writefile(lines, 'aa.vim', 'D') - - lines =<< trim END - vim9script - import './aa.vim' - export class View - var content = aa.Property.new('') - endclass - END - writefile(lines, 'bb.vim', 'D') - - lines =<< trim END - vim9script - import './bb.vim' - class MyView extends bb.View - def new(value: string) - this.content.value = value - enddef - endclass - var myView = MyView.new('This should be ok') - END - v9.CheckScriptSuccess(lines) -enddef - -" Test for multi level import -def Test_multi_level_import_nest_over() - var lines =<< trim END - vim9script - import './xbb.vim' - export class Property - public var value: string - endclass - END - writefile(lines, 'xaa.vim', 'D') - - lines =<< trim END - vim9script - import './xaa.vim' - export class View - var content = aa.Property.new('') - endclass - END - writefile(lines, 'xbb.vim', 'D') - - lines =<< trim END - vim9script - set maxfuncdepth=100 - import './xbb.vim' - class MyView extends bb.View - def new(value: string) - this.content.value = value - enddef - endclass - var myView = MyView.new('This should be ok') - END - v9.CheckSourceFailure(lines, 'E1045: Import nesting too deep', 3) -enddef - -def Test_abtstract_class() +def Test_abstract_class() var lines =<< trim END vim9script abstract class Base diff --git a/src/version.c b/src/version.c index 7a2e5a8030..ad451d70a6 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1044, /**/ 1043, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index 338415e85f..29b6414c46 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -778,7 +778,6 @@ get_script_item_idx( static imported_T * find_imported_in_script(char_u *name, size_t len, int sid) { - static int nesting = 0; scriptitem_T *si; int idx; @@ -793,19 +792,6 @@ find_imported_in_script(char_u *name, size_t len, int sid) : STRLEN(import->imp_name) == len && STRNCMP(name, import->imp_name, len) == 0) return import; - else - { - if (nesting >= p_mfd) - { - emsg(_(e_import_nesting_too_deep)); - return NULL; - } - ++nesting; - import = find_imported_in_script(name, len, import->imp_sid); - --nesting; - if (import != NULL) - return import; - } } return NULL; } From c04334c33f543a6b84a4442cf235d84f5eaef6bb Mon Sep 17 00:00:00 2001 From: Gordian Dziwis Date: Tue, 21 Jan 2025 22:24:23 +0100 Subject: [PATCH 73/93] patch 9.1.1045: filetype: N-Tripels and TriG files are not recognized Problem: filetype: N-Tripels and TriG files are not recognized Solution: detect '*.nt' files as ntriples filetype and '*.trig' files as trig filetype (Gordian Dziwis) closes: #16493 Signed-off-by: Gordian Dziwis Signed-off-by: Christian Brabandt --- runtime/filetype.vim | 8 +++++++- src/testdir/test_filetype.vim | 2 ++ src/version.c | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 6b323bd823..d2ff662269 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: The Vim Project -" Last Change: 2025 Jan 20 +" Last Change: 2025 Jan 21 " Former Maintainer: Bram Moolenaar " Listen very carefully, I will say this only once @@ -1727,6 +1727,9 @@ au BufNewFile,BufRead *.nse setf lua " NSIS au BufNewFile,BufRead *.nsi,*.nsh setf nsis +" N-Triples +au BufNewFile,BufRead *.nt setf ntriples + " Nu au BufNewFile,BufRead *.nu setf nu @@ -2323,6 +2326,9 @@ au BufNewFile,BufRead .tcshrc,*.tcsh,tcsh.tcshrc,tcsh.login call dist#ft#SetFile " (patterns ending in a start further below) au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias call dist#ft#CSH() +" TriG +au BufNewFile,BufRead *.trig setf trig + " Zig and Zig Object Notation (ZON) au BufNewFile,BufRead *.zig,*.zon setf zig diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 9faa272a1a..e5411af154 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -552,6 +552,7 @@ def s:GetFilenameChecks(): dict> nqc: ['file.nqc'], nroff: ['file.tr', 'file.nr', 'file.roff', 'file.tmac', 'file.mom', 'tmac.file'], nsis: ['file.nsi', 'file.nsh'], + ntriples: ['file.nt'], nu: ['file.nu'], obj: ['file.obj'], objdump: ['file.objdump', 'file.cppobjdump'], @@ -817,6 +818,7 @@ def s:GetFilenameChecks(): dict> tpp: ['file.tpp'], trace32: ['file.cmm', 'file.t32'], treetop: ['file.treetop'], + trig: ['file.trig'], trustees: ['trustees.conf'], tsalt: ['file.slt'], tsscl: ['file.tsscl'], diff --git a/src/version.c b/src/version.c index ad451d70a6..fb5fd376e6 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1045, /**/ 1044, /**/ From 9dfc7e5e6169594f6f4607ef1ba9dd347a9194d2 Mon Sep 17 00:00:00 2001 From: glepnir Date: Tue, 21 Jan 2025 22:33:13 +0100 Subject: [PATCH 74/93] patch 9.1.1046: fuzzymatching doesn't prefer matching camelcase Problem: fuzzymatching doesn't prefer matching camelcase (Tomasz N) Solution: Add extra score when case matches (glepnir) fixes: #16434 closes: #16439 Signed-off-by: glepnir Signed-off-by: Christian Brabandt --- src/search.c | 70 ++++++++++++++++++++++++++++++--- src/testdir/test_matchfuzzy.vim | 60 +++++++++++++++++----------- src/version.c | 2 + 3 files changed, 102 insertions(+), 30 deletions(-) diff --git a/src/search.c b/src/search.c index 616331ee17..46fa7b9d99 100644 --- a/src/search.c +++ b/src/search.c @@ -42,7 +42,7 @@ static void find_mps_values(int *initc, int *findc, int *backwards, int switchit static int is_zero_width(char_u *pattern, size_t patternlen, int move, pos_T *cur, int direction); static void cmdline_search_stat(int dirc, pos_T *pos, pos_T *cursor_pos, int show_top_bot_msg, char_u *msgbuf, size_t msgbuflen, int recompute, int maxcount, long timeout); static void update_search_stat(int dirc, pos_T *pos, pos_T *cursor_pos, searchstat_T *stat, int recompute, int maxcount, long timeout); -static int fuzzy_match_compute_score(char_u *str, int strSz, int_u *matches, int numMatches); +static int fuzzy_match_compute_score(char_u *fuzpat, char_u *str, int strSz, int_u *matches, int numMatches); static int fuzzy_match_recursive(char_u *fuzpat, char_u *str, int_u strIdx, int *outScore, char_u *strBegin, int strLen, int_u *srcMatches, int_u *matches, int maxMatches, int nextMatch, int *recursionCount); #if defined(FEAT_EVAL) || defined(FEAT_PROTO) static int fuzzy_match_item_compare(const void *s1, const void *s2); @@ -4355,6 +4355,10 @@ typedef struct #define CAMEL_BONUS 30 // bonus if the first letter is matched #define FIRST_LETTER_BONUS 15 +// bonus if exact match +#define EXACT_MATCH_BONUS 100 +// bonus if case match when no ignorecase +#define CASE_MATCH_BONUS 25 // penalty applied for every letter in str before the first match #define LEADING_LETTER_PENALTY (-5) // maximum penalty for leading letters @@ -4374,6 +4378,7 @@ typedef struct */ static int fuzzy_match_compute_score( + char_u *fuzpat, char_u *str, int strSz, int_u *matches, @@ -4386,6 +4391,11 @@ fuzzy_match_compute_score( char_u *p = str; int_u sidx = 0; int is_exact_match = TRUE; + char_u *orig_fuzpat = fuzpat - numMatches; + char_u *curpat = orig_fuzpat; + int pat_idx = 0; + // Track consecutive camel case matches + int consecutive_camel = 0; // Initialize score score = 100; @@ -4404,6 +4414,8 @@ fuzzy_match_compute_score( for (i = 0; i < numMatches; ++i) { int_u currIdx = matches[i]; + int curr; + int is_camel = FALSE; if (i > 0) { @@ -4413,15 +4425,18 @@ fuzzy_match_compute_score( if (currIdx == (prevIdx + 1)) score += SEQUENTIAL_BONUS; else + { score += GAP_PENALTY * (currIdx - prevIdx); + // Reset consecutive camel count on gap + consecutive_camel = 0; + } } // Check for bonuses based on neighbor character value if (currIdx > 0) { // Camel case - int neighbor = ' '; - int curr; + int neighbor = ' '; if (has_mbyte) { @@ -4439,8 +4454,18 @@ fuzzy_match_compute_score( curr = str[currIdx]; } + // Enhanced camel case scoring if (vim_islower(neighbor) && vim_isupper(curr)) - score += CAMEL_BONUS; + { + score += CAMEL_BONUS * 2; // Double the camel case bonus + is_camel = TRUE; + consecutive_camel++; + // Additional bonus for consecutive camel + if (consecutive_camel > 1) + score += CAMEL_BONUS; + } + else + consecutive_camel = 0; // Bonus if the match follows a separator character if (neighbor == '/' || neighbor == '\\') @@ -4452,14 +4477,47 @@ fuzzy_match_compute_score( { // First letter score += FIRST_LETTER_BONUS; + curr = has_mbyte ? (*mb_ptr2char)(p) : str[currIdx]; } + + // Case matching bonus + if (vim_isalpha(curr)) + { + while (pat_idx < i && *curpat) + { + if (has_mbyte) + MB_PTR_ADV(curpat); + else + curpat++; + pat_idx++; + } + + if (has_mbyte) + { + if (curr == (*mb_ptr2char)(curpat)) + { + score += CASE_MATCH_BONUS; + // Extra bonus for exact case match in camel + if (is_camel) + score += CASE_MATCH_BONUS / 2; + } + } + else if (curr == *curpat) + { + score += CASE_MATCH_BONUS; + if (is_camel) + score += CASE_MATCH_BONUS / 2; + } + } + // Check exact match condition if (currIdx != (int_u)i) is_exact_match = FALSE; } + // Boost score for exact matches if (is_exact_match && numMatches == strSz) - score += 100; + score += EXACT_MATCH_BONUS; return score; } @@ -4563,7 +4621,7 @@ fuzzy_match_recursive( // Calculate score if (matched) - *outScore = fuzzy_match_compute_score(strBegin, strLen, matches, + *outScore = fuzzy_match_compute_score(fuzpat, strBegin, strLen, matches, nextMatch); // Return best result diff --git a/src/testdir/test_matchfuzzy.vim b/src/testdir/test_matchfuzzy.vim index e880d7335a..cba08446b5 100644 --- a/src/testdir/test_matchfuzzy.vim +++ b/src/testdir/test_matchfuzzy.vim @@ -96,15 +96,15 @@ endfunc " Test for the matchfuzzypos() function func Test_matchfuzzypos() - call assert_equal([['curl', 'world'], [[2,3], [2,3]], [128, 127]], matchfuzzypos(['world', 'curl'], 'rl')) - call assert_equal([['curl', 'world'], [[2,3], [2,3]], [128, 127]], matchfuzzypos(['world', 'one', 'curl'], 'rl')) + call assert_equal([['curl', 'world'], [[2,3], [2,3]], [178, 177]], matchfuzzypos(['world', 'curl'], 'rl')) + call assert_equal([['curl', 'world'], [[2,3], [2,3]], [178, 177]], matchfuzzypos(['world', 'one', 'curl'], 'rl')) call assert_equal([['hello', 'hello world hello world'], - \ [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]], [375, 257]], + \ [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]], [500, 382]], \ matchfuzzypos(['hello world hello world', 'hello', 'world'], 'hello')) - call assert_equal([['aaaaaaa'], [[0, 1, 2]], [191]], matchfuzzypos(['aaaaaaa'], 'aaa')) - call assert_equal([['a b'], [[0, 3]], [219]], matchfuzzypos(['a b'], 'a b')) - call assert_equal([['a b'], [[0, 3]], [219]], matchfuzzypos(['a b'], 'a b')) - call assert_equal([['a b'], [[0]], [112]], matchfuzzypos(['a b'], ' a ')) + call assert_equal([['aaaaaaa'], [[0, 1, 2]], [266]], matchfuzzypos(['aaaaaaa'], 'aaa')) + call assert_equal([['a b'], [[0, 3]], [269]], matchfuzzypos(['a b'], 'a b')) + call assert_equal([['a b'], [[0, 3]], [269]], matchfuzzypos(['a b'], 'a b')) + call assert_equal([['a b'], [[0]], [137]], matchfuzzypos(['a b'], ' a ')) call assert_equal([[], [], []], matchfuzzypos(['a b'], ' ')) call assert_equal([[], [], []], matchfuzzypos(['world', 'curl'], 'ab')) let x = matchfuzzypos([repeat('a', 256)], repeat('a', 256)) @@ -113,33 +113,33 @@ func Test_matchfuzzypos() call assert_equal([[], [], []], matchfuzzypos([], 'abc')) " match in a long string - call assert_equal([[repeat('x', 300) .. 'abc'], [[300, 301, 302]], [-135]], + call assert_equal([[repeat('x', 300) .. 'abc'], [[300, 301, 302]], [-60]], \ matchfuzzypos([repeat('x', 300) .. 'abc'], 'abc')) " preference for camel case match - call assert_equal([['xabcxxaBc'], [[6, 7, 8]], [189]], matchfuzzypos(['xabcxxaBc'], 'abc')) + call assert_equal([['xabcxxaBc'], [[6, 7, 8]], [269]], matchfuzzypos(['xabcxxaBc'], 'abc')) " preference for match after a separator (_ or space) - call assert_equal([['xabx_ab'], [[5, 6]], [145]], matchfuzzypos(['xabx_ab'], 'ab')) + call assert_equal([['xabx_ab'], [[5, 6]], [195]], matchfuzzypos(['xabx_ab'], 'ab')) " preference for leading letter match - call assert_equal([['abcxabc'], [[0, 1]], [150]], matchfuzzypos(['abcxabc'], 'ab')) + call assert_equal([['abcxabc'], [[0, 1]], [200]], matchfuzzypos(['abcxabc'], 'ab')) " preference for sequential match - call assert_equal([['aobncedone'], [[7, 8, 9]], [158]], matchfuzzypos(['aobncedone'], 'one')) + call assert_equal([['aobncedone'], [[7, 8, 9]], [233]], matchfuzzypos(['aobncedone'], 'one')) " best recursive match - call assert_equal([['xoone'], [[2, 3, 4]], [168]], matchfuzzypos(['xoone'], 'one')) + call assert_equal([['xoone'], [[2, 3, 4]], [243]], matchfuzzypos(['xoone'], 'one')) " match multiple words (separated by space) - call assert_equal([['foo bar baz'], [[8, 9, 10, 0, 1, 2]], [369]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('baz foo')) + call assert_equal([['foo bar baz'], [[8, 9, 10, 0, 1, 2]], [519]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('baz foo')) call assert_equal([[], [], []], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('baz foo', {'matchseq': 1})) - call assert_equal([['foo bar baz'], [[0, 1, 2, 8, 9, 10]], [369]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('foo baz')) - call assert_equal([['foo bar baz'], [[0, 1, 2, 3, 4, 5, 10]], [326]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('foo baz', {'matchseq': 1})) + call assert_equal([['foo bar baz'], [[0, 1, 2, 8, 9, 10]], [519]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('foo baz')) + call assert_equal([['foo bar baz'], [[0, 1, 2, 3, 4, 5, 10]], [476]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('foo baz', {'matchseq': 1})) call assert_equal([[], [], []], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('one two')) call assert_equal([[], [], []], ['foo bar']->matchfuzzypos(" \t ")) - call assert_equal([['grace'], [[1, 2, 3, 4, 2, 3, 4, 0, 1, 2, 3, 4]], [757]], ['grace']->matchfuzzypos('race ace grace')) + call assert_equal([['grace'], [[1, 2, 3, 4, 2, 3, 4, 0, 1, 2, 3, 4]], [1057]], ['grace']->matchfuzzypos('race ace grace')) let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}] - call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]], [192]], + call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]], [267]], \ matchfuzzypos(l, 'cam', {'text_cb' : {v -> v.val}})) - call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]], [192]], + call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]], [267]], \ matchfuzzypos(l, 'cam', {'key' : 'val'})) call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'text_cb' : {v -> v.val}})) call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'key' : 'val'})) @@ -154,6 +154,18 @@ func Test_matchfuzzypos() call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : test_null_string()})", 'E475:') call assert_fails("let x = matchfuzzypos(l, 'foo', {'text_cb' : test_null_function()})", 'E475:') + " case match + call assert_equal([['Match', 'match'], [[0, 1], [0, 1]], [202, 177]], matchfuzzypos(['match', 'Match'], 'Ma')) + call assert_equal([['match', 'Match'], [[0, 1], [0, 1]], [202, 177]], matchfuzzypos(['Match', 'match'], 'ma')) + " CamelCase has high weight even case match + call assert_equal(['MyTestCase', 'mytestcase'], matchfuzzy(['mytestcase', 'MyTestCase'], 'mtc')) + call assert_equal(['MyTestCase', 'mytestcase'], matchfuzzy(['MyTestCase', 'mytestcase'], 'mtc')) + call assert_equal(['MyTest', 'Mytest', 'mytest', ],matchfuzzy(['Mytest', 'mytest', 'MyTest'], 'MyT')) + call assert_equal(['CamelCaseMatchIngAlg', 'camelCaseMatchingAlg', 'camelcasematchingalg'], + \ matchfuzzy(['CamelCaseMatchIngAlg', 'camelcasematchingalg', 'camelCaseMatchingAlg'], 'CamelCase')) + call assert_equal(['CamelCaseMatchIngAlg', 'camelCaseMatchingAlg', 'camelcasematchingalg'], + \ matchfuzzy(['CamelCaseMatchIngAlg', 'camelcasematchingalg', 'camelCaseMatchingAlg'], 'CamelcaseM')) + let l = [{'id' : 5, 'name' : 'foo'}, {'id' : 6, 'name' : []}, {'id' : 7}] call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : 'name'})", 'E730:') endfunc @@ -204,12 +216,12 @@ func Test_matchfuzzypos_mbyte() call assert_equal([['ンヹㄇヺヴ'], [[1, 3]], [88]], matchfuzzypos(['ンヹㄇヺヴ'], 'ヹヺ')) " reverse the order of characters call assert_equal([[], [], []], matchfuzzypos(['ンヹㄇヺヴ'], 'ヺヹ')) - call assert_equal([['αβΩxxx', 'xαxβxΩx'], [[0, 1, 2], [1, 3, 5]], [222, 113]], + call assert_equal([['αβΩxxx', 'xαxβxΩx'], [[0, 1, 2], [1, 3, 5]], [252, 143]], \ matchfuzzypos(['αβΩxxx', 'xαxβxΩx'], 'αβΩ')) call assert_equal([['ππbbππ', 'πππbbbπππ', 'ππππbbbbππππ', 'πbπ'], - \ [[0, 1], [0, 1], [0, 1], [0, 2]], [151, 148, 145, 110]], + \ [[0, 1], [0, 1], [0, 1], [0, 2]], [176, 173, 170, 135]], \ matchfuzzypos(['πbπ', 'ππbbππ', 'πππbbbπππ', 'ππππbbbbππππ'], 'ππ')) - call assert_equal([['ααααααα'], [[0, 1, 2]], [191]], + call assert_equal([['ααααααα'], [[0, 1, 2]], [216]], \ matchfuzzypos(['ααααααα'], 'ααα')) call assert_equal([[], [], []], matchfuzzypos(['ンヹㄇ', 'ŗŝţ'], 'fffifl')) @@ -222,10 +234,10 @@ func Test_matchfuzzypos_mbyte() call assert_equal([[], [], []], ['세 마리의 작은 돼지', '마리의', '마리의 작은', '작은 돼지']->matchfuzzypos('파란 하늘')) " match in a long string - call assert_equal([[repeat('ぶ', 300) .. 'ẼẼẼ'], [[300, 301, 302]], [-135]], + call assert_equal([[repeat('ぶ', 300) .. 'ẼẼẼ'], [[300, 301, 302]], [-110]], \ matchfuzzypos([repeat('ぶ', 300) .. 'ẼẼẼ'], 'ẼẼẼ')) " preference for camel case match - call assert_equal([['xѳѵҁxxѳѴҁ'], [[6, 7, 8]], [189]], matchfuzzypos(['xѳѵҁxxѳѴҁ'], 'ѳѵҁ')) + call assert_equal([['xѳѵҁxxѳѴҁ'], [[6, 7, 8]], [219]], matchfuzzypos(['xѳѵҁxxѳѴҁ'], 'ѳѵҁ')) " preference for match after a separator (_ or space) call assert_equal([['xちだx_ちだ'], [[5, 6]], [145]], matchfuzzypos(['xちだx_ちだ'], 'ちだ')) " preference for leading letter match diff --git a/src/version.c b/src/version.c index fb5fd376e6..ad8a7480bb 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1046, /**/ 1045, /**/ From 613d0bc128a86870ed978f08981becc619f95d58 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 22 Jan 2025 22:21:50 +0100 Subject: [PATCH 75/93] patch 9.1.1047: Makefiles uses non-portable syntax Problem: Makefiles uses non-portable syntax (simo-zz, after v9.1.1029) Solution: Revert auto-generation of MAJOR/MINOR variables fixes: #16502 closes: #16503 Signed-off-by: Christian Brabandt --- Makefile | 10 ++-------- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 3151c24aa8..12aa1f37da 100644 --- a/Makefile +++ b/Makefile @@ -96,14 +96,8 @@ syntaxtest: # To do all this you need the Unix archive and compiled binaries. # Before creating an archive first delete all backup files, *.orig, etc. -# I think it is better to place getting the current version number in the -# configure script. And then automatically fill in the fields in the files -# listed below. (Restorer) - -MAJOR != grep -E 'VIM_VERSION_MAJOR\s{2,}' src/version.h | \ - awk '{ printf "%d",$$3 }' -MINOR != grep -E 'VIM_VERSION_MINOR\s{2,}' src/version.h | \ - awk '{ printf "%d",$$3 }' +MAJOR = 9 +MINOR = 1 # CHECKLIST for creating a new version: # diff --git a/src/version.c b/src/version.c index ad8a7480bb..c9f88e93d9 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1047, /**/ 1046, /**/ From df098fedbc2c481e91ea7e6207dab90359a92cc3 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 22 Jan 2025 22:27:30 +0100 Subject: [PATCH 76/93] patch 9.1.1048: crash after scrolling and pasting in silent Ex mode Problem: Crash after scrolling and pasting in silent Ex mode. (fizz-is-on-the-way) Solution: Don't move cursor to line 0 when scrolling. (zeertzjq) closes: #16506 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- src/move.c | 5 ++++- src/testdir/test_normal.vim | 17 +++++++++++++++++ src/version.c | 2 ++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/move.c b/src/move.c index f2780e584e..ed252d9dbd 100644 --- a/src/move.c +++ b/src/move.c @@ -3285,8 +3285,11 @@ pagescroll(int dir, long count, int half) { // Place cursor at top or bottom of window. validate_botline(); - curwin->w_cursor.lnum = (dir == FORWARD ? curwin->w_topline + linenr_T lnum = (dir == FORWARD ? curwin->w_topline : curwin->w_botline - 1); + // In silent Ex mode the value of w_botline - 1 may be 0, + // but cursor lnum needs to be at least 1. + curwin->w_cursor.lnum = MAX(lnum, 1); } } diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index 6dd3fac0cd..75a3028b6d 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -1342,6 +1342,22 @@ func Test_scroll_in_ex_mode() call delete('Xdone') endfunc +func Test_scroll_and_paste_in_ex_mode() + " This used to crash because of moving cursor to line 0. + let lines =<< trim END + v/foo/vi|YY9PYQ + v/bar/vi|YY9PYQ + v/bar/exe line('.') == 1 ? "vi|Y\9PYQ" : "vi|YQ" + call writefile(['done'], 'Xdone') + qa! + END + call writefile(lines, 'Xscript', 'D') + call assert_equal(1, RunVim([], [], '-u NONE -i NONE -n -X -Z -e -s -S Xscript')) + call assert_equal(['done'], readfile('Xdone')) + + call delete('Xdone') +endfunc + " Test for the 'sidescroll' option func Test_sidescroll_opt() new @@ -4293,4 +4309,5 @@ func Test_normal_go() bwipe! endfunc + " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/version.c b/src/version.c index c9f88e93d9..67f168903e 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1048, /**/ 1047, /**/ From c083c5bb5bd53903168b36eb1040ac2d508a7193 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Wed, 22 Jan 2025 21:13:28 -0800 Subject: [PATCH 77/93] Fix code to be buildable on Xcode 8 again We added code to rely on MAC_OS_X_VERSION_10_15, and therefore need to add stub for that to make it buildable on older Xcode versions. Use this opportunity to add the other missing ones to prevent future mistakes. --- src/MacVim/MMCoreTextView.h | 2 ++ src/MacVim/MMCoreTextView.m | 2 ++ src/MacVim/MacVim.h | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/src/MacVim/MMCoreTextView.h b/src/MacVim/MMCoreTextView.h index 42a246f3e4..6dd64125d4 100644 --- a/src/MacVim/MMCoreTextView.h +++ b/src/MacVim/MMCoreTextView.h @@ -88,7 +88,9 @@ NS_ASSUME_NONNULL_BEGIN // NSFontChanging methods // - (void)changeFont:(nullable id)sender; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 - (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel; +#endif // // NSMenuItemValidation diff --git a/src/MacVim/MMCoreTextView.m b/src/MacVim/MMCoreTextView.m index 81b21d2750..44794a665c 100644 --- a/src/MacVim/MMCoreTextView.m +++ b/src/MacVim/MMCoreTextView.m @@ -1355,6 +1355,7 @@ - (void)changeFont:(id)sender } } +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 - (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel { // Lets the user pick only the font face / size, as other properties as not @@ -1362,6 +1363,7 @@ - (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel // Otherwise it could just be white text on white background in the preview. return NSFontPanelModesMaskStandardModes & (~NSFontPanelModeMaskAllEffects | NSFontPanelModeMaskTextColorEffect | NSFontPanelModeMaskDocumentColorEffect); } +#endif /// Specifies whether the menu item should be enabled/disabled. - (BOOL)validateMenuItem:(NSMenuItem *)item diff --git a/src/MacVim/MacVim.h b/src/MacVim/MacVim.h index bad6f8e09a..515ebe8355 100644 --- a/src/MacVim/MacVim.h +++ b/src/MacVim/MacVim.h @@ -43,6 +43,9 @@ #ifndef MAC_OS_X_VERSION_10_14 # define MAC_OS_X_VERSION_10_14 101400 #endif +#ifndef MAC_OS_X_VERSION_10_15 +# define MAC_OS_X_VERSION_10_15 101500 +#endif #ifndef MAC_OS_VERSION_11_0 # define MAC_OS_VERSION_11_0 110000 #endif @@ -55,6 +58,9 @@ #ifndef MAC_OS_VERSION_14_0 # define MAC_OS_VERSION_14_0 140000 #endif +#ifndef MAC_OS_VERSION_15_0 +# define MAC_OS_VERSION_15_0 150000 +#endif #ifndef NSAppKitVersionNumber10_10 # define NSAppKitVersionNumber10_10 1343 @@ -62,6 +68,9 @@ #ifndef NSAppKitVersionNumber10_10_Max # define NSAppKitVersionNumber10_10_Max 1349 #endif +#ifndef NSAppKitVersionNumber10_11 +# define NSAppKitVersionNumber10_11 1404 +#endif #ifndef NSAppKitVersionNumber10_12 # define NSAppKitVersionNumber10_12 1504 #endif @@ -74,6 +83,9 @@ #ifndef NSAppKitVersionNumber10_14 # define NSAppKitVersionNumber10_14 1671 #endif +#ifndef NSAppKitVersionNumber10_15 +# define NSAppKitVersionNumber10_15 1894 +#endif #ifndef NSAppKitVersionNumber11_0 # define NSAppKitVersionNumber11_0 2022 #endif From f400a0cc41113eb75516bdd7f38aeaa15208ba2c Mon Sep 17 00:00:00 2001 From: glepnir Date: Thu, 23 Jan 2025 19:55:14 +0100 Subject: [PATCH 78/93] patch 9.1.1049: insert-completed items are always sorted Problem: insert-completed items are always sorted, although the LSP spec[1] standard defines sortText in the returned completionitem list. This means that the server has sorted the results. When fuzzy is enabled, this will break the server's sorting results. Solution: disable sorting of candidates when "nosort" is set in 'completeopt' [1] https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem closes: #16501 Signed-off-by: glepnir Signed-off-by: Christian Brabandt --- runtime/doc/options.txt | 6 +++++- runtime/doc/version9.txt | 20 ++++++++++---------- src/insexpand.c | 19 +++++++++++-------- src/option.h | 1 + src/optionstr.c | 2 +- src/testdir/test_ins_complete.vim | 17 ++++++++++++++++- src/version.c | 2 ++ 7 files changed, 46 insertions(+), 21 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 50ef430b68..599f903a0c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Jan 21 +*options.txt* For Vim version 9.1. Last change: 2025 Jan 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2164,6 +2164,10 @@ A jump table for the options with a short description can be found at |Q_op|. characters can be skipped and matches can be found even if the exact sequence is not typed. + nosort Disable sorting of completion candidates based on fuzzy + scores when "fuzzy" is enabled. Candidates will appear + in their original order. + *'completepopup'* *'cpp'* 'completepopup' 'cpp' string (default empty) global diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index 6cbd1022a8..2f2ab5ae07 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2025 Jan 18 +*version9.txt* For Vim version 9.1. Last change: 2025 Jan 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41560,15 +41560,17 @@ Support for Wayland UI. Support for the XDG Desktop Specification |xdg-base-dir| -Support highlighting the matched text for insert-mode completion and -command-line completion in |ins-completion-menu|. - -Support highlighting the completion kind in |ins-completion-menu|, see -|complete-items|. - Support for translating messages in Vim script plugins using the |gettext()| and |bindtextdomain()| functions. +Support highlighting the matched text and the completion kind for insert-mode +completion and command-line completion in |ins-completion-menu|, see +|complete-items| + +Include the "linematch" algorithm for the 'diffopt' setting. This aligns +changes between buffers on similar lines improving the diff highlighting in +Vim + *changed-9.2* Changed~ ------- @@ -41623,9 +41625,7 @@ Changed~ the "matches" key - |v:stacktrace| The stack trace of the exception most recently caught and not finished -- include the linematch algorithm for the 'diffopt' setting. This aligns - changes between buffers on similar lines improving the diff highlighting in - Vim +- New option value "nosort" for 'completeopt' *added-9.2* Added ~ diff --git a/src/insexpand.c b/src/insexpand.c index e33e15d43b..1a71f63fb1 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -1264,7 +1264,8 @@ ins_compl_build_pum(void) int max_fuzzy_score = 0; unsigned int cur_cot_flags = get_cot_flags(); int compl_no_select = (cur_cot_flags & COT_NOSELECT) != 0; - int compl_fuzzy_match = (cur_cot_flags & COT_FUZZY) != 0; + int fuzzy_nosort = (cur_cot_flags & COT_NOSORT) != 0; + int fuzzy_filter = fuzzy_nosort || (cur_cot_flags & COT_FUZZY) != 0; compl_T *match_head = NULL; compl_T *match_tail = NULL; compl_T *match_next = NULL; @@ -1289,13 +1290,13 @@ ins_compl_build_pum(void) compl->cp_in_match_array = FALSE; // When 'completeopt' contains "fuzzy" and leader is not NULL or empty, // set the cp_score for later comparisons. - if (compl_fuzzy_match && compl_leader.string != NULL && compl_leader.length > 0) + if (fuzzy_filter && compl_leader.string != NULL && compl_leader.length > 0) compl->cp_score = fuzzy_match_str(compl->cp_str.string, compl_leader.string); if (!match_at_original_text(compl) && (compl_leader.string == NULL || ins_compl_equal(compl, compl_leader.string, (int)compl_leader.length) - || (compl_fuzzy_match && compl->cp_score > 0))) + || (fuzzy_filter && compl->cp_score > 0))) { ++compl_match_arraysize; compl->cp_in_match_array = TRUE; @@ -1305,7 +1306,7 @@ ins_compl_build_pum(void) match_tail->cp_match_next = compl; match_tail = compl; - if (!shown_match_ok && !compl_fuzzy_match) + if (!shown_match_ok && !fuzzy_filter) { if (compl == compl_shown_match || did_find_shown_match) { @@ -1321,19 +1322,21 @@ ins_compl_build_pum(void) shown_compl = compl; cur = i; } - else if (compl_fuzzy_match) + else if (fuzzy_filter) { if (i == 0) shown_compl = compl; // Update the maximum fuzzy score and the shown match // if the current item's score is higher - if (compl->cp_score > max_fuzzy_score) + if (!fuzzy_nosort && compl->cp_score > max_fuzzy_score) { did_find_shown_match = TRUE; max_fuzzy_score = compl->cp_score; if (!compl_no_select) compl_shown_match = compl; } + else if (fuzzy_nosort && i == 0 && !compl_no_select) + compl_shown_match = shown_compl; if (!shown_match_ok && compl == compl_shown_match && !compl_no_select) { @@ -1344,7 +1347,7 @@ ins_compl_build_pum(void) i++; } - if (compl == compl_shown_match && !compl_fuzzy_match) + if (compl == compl_shown_match && !fuzzy_filter) { did_find_shown_match = TRUE; @@ -1389,7 +1392,7 @@ ins_compl_build_pum(void) compl = match_next; } - if (compl_fuzzy_match && compl_leader.string != NULL && compl_leader.length > 0) + if (fuzzy_filter && !fuzzy_nosort && compl_leader.string != NULL && compl_leader.length > 0) { for (i = 0; i < compl_match_arraysize; i++) compl_match_array[i].pum_idx = i; diff --git a/src/option.h b/src/option.h index a3634a6023..11fefc3208 100644 --- a/src/option.h +++ b/src/option.h @@ -530,6 +530,7 @@ EXTERN unsigned cot_flags; // flags from 'completeopt' #define COT_NOINSERT 0x040 // FALSE: select & insert, TRUE: noinsert #define COT_NOSELECT 0x080 // FALSE: select & insert, TRUE: noselect #define COT_FUZZY 0x100 // TRUE: fuzzy match enabled +#define COT_NOSORT 0x200 // TRUE: fuzzy match without qsort score #ifdef BACKSLASH_IN_FILENAME EXTERN char_u *p_csl; // 'completeslash' #endif diff --git a/src/optionstr.c b/src/optionstr.c index 86c7967e53..8672665bcb 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -120,7 +120,7 @@ static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax", NULL}; static char *(p_fcl_values[]) = {"all", NULL}; #endif -static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", "fuzzy", NULL}; +static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", "fuzzy", "nosort", NULL}; #ifdef BACKSLASH_IN_FILENAME static char *(p_csl_values[]) = {"slash", "backslash", NULL}; #endif diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 289a281885..75ccb673b2 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -2700,7 +2700,7 @@ func Test_complete_fuzzy_match() if a:findstart return col(".") endif - return [#{word: "foo"}, #{word: "foobar"}, #{word: "fooBaz"}, #{word: "foobala"}] + return [#{word: "foo"}, #{word: "foobar"}, #{word: "fooBaz"}, #{word: "foobala"}, #{word: "你好吗"}, #{word: "我好"}] endfunc new @@ -2855,6 +2855,21 @@ func Test_complete_fuzzy_match() call feedkeys("STe\\x\\0", 'tx!') call assert_equal('Tex', getline('.')) + " test case for nosort option + set cot=menuone,menu,noinsert,fuzzy,nosort + " fooBaz" should have a higher score when the leader is "fb". + " With `nosort`, "foobar" should still be shown first in the popup menu. + call feedkeys("S\\fb", 'tx') + call assert_equal('foobar', g:word) + call feedkeys("S\\好", 'tx') + call assert_equal("你好吗", g:word) + + set cot+=noselect + call feedkeys("S\\好", 'tx') + call assert_equal(v:null, g:word) + call feedkeys("S\\好\", 'tx') + call assert_equal('你好吗', g:word) + " clean up set omnifunc= bw! diff --git a/src/version.c b/src/version.c index 67f168903e..02a58aff52 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1049, /**/ 1048, /**/ From efc41a5958bf25b352e0916af5f57dafbbb44f17 Mon Sep 17 00:00:00 2001 From: John Marriott Date: Thu, 23 Jan 2025 20:05:29 +0100 Subject: [PATCH 79/93] patch 9.1.1050: too many strlen() calls in os_unix.c Problem: too many strlen() calls in os_unix.c Solution: refactor os_unix.c and remove calls to strlen() (John Marriott) closes: #16496 Signed-off-by: John Marriott Signed-off-by: Christian Brabandt --- src/os_unix.c | 195 ++++++++++++++++++++++++++++++-------------------- src/version.c | 2 + 2 files changed, 120 insertions(+), 77 deletions(-) diff --git a/src/os_unix.c b/src/os_unix.c index dc518fc676..95b21d297d 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1835,11 +1835,13 @@ may_restore_clipboard(void) void ex_xrestore(exarg_T *eap) { - if (eap->arg != NULL && STRLEN(eap->arg) > 0) + size_t arglen; + + if (eap->arg != NULL && (arglen = STRLEN(eap->arg)) > 0) { if (xterm_display_allocated) vim_free(xterm_display); - xterm_display = (char *)vim_strsave(eap->arg); + xterm_display = (char *)vim_strnsave(eap->arg, arglen); xterm_display_allocated = TRUE; } smsg(_("restoring display %s"), xterm_display == NULL @@ -2625,7 +2627,7 @@ strerror(int err) if (err > 0 && err < sys_nerr) return (sys_errlist[err]); - sprintf(er, "Error %d", err); + snprintf(er, sizeof(er), "Error %d", err); return er; } #endif @@ -2662,7 +2664,7 @@ mch_FullName( int len, int force) // also expand when already absolute path { - int l; + int buflen = 0; #ifdef HAVE_FCHDIR int fd = -1; static int dont_fchdir = FALSE; // TRUE when fchdir() doesn't work @@ -2778,6 +2780,8 @@ mch_FullName( } if (p != NULL) { + int l; + #ifdef HAVE_FCHDIR if (fd >= 0) { @@ -2800,23 +2804,29 @@ mch_FullName( close(fd); #endif - l = STRLEN(buf); - if (l >= len - 1) + buflen = (int)STRLEN(buf); + if (buflen >= len - 1) retval = FAIL; // no space for trailing "/" #ifndef VMS - else if (l > 0 && buf[l - 1] != '/' && *fname != NUL + else if (buflen > 0 && buf[buflen - 1] != PATHSEP && *fname != NUL && STRCMP(fname, ".") != 0) - STRCAT(buf, "/"); + { + STRCPY(buf + buflen, PATHSEPSTR); + buflen += STRLEN_LITERAL(PATHSEPSTR); + } #endif } + if (buflen == 0) + buflen = (int)STRLEN(buf); + // Catch file names which are too long. - if (retval == FAIL || (int)(STRLEN(buf) + STRLEN(fname)) >= len) + if (retval == FAIL || (int)(buflen + STRLEN(fname)) >= len) return FAIL; // Do not append ".", "/dir/." is equal to "/dir". if (STRCMP(fname, ".") != 0) - STRCAT(buf, fname); + STRCPY(buf + buflen, fname); return OK; } @@ -2850,6 +2860,7 @@ fname_case( { struct stat st; char_u *slash, *tail; + size_t taillen; DIR *dirp; struct dirent *dp; @@ -2874,12 +2885,13 @@ fname_case( if (dirp == NULL) return; + taillen = STRLEN(tail); while ((dp = readdir(dirp)) != NULL) { // Only accept names that differ in case and are the same byte // length. TODO: accept different length name. if (STRICMP(tail, dp->d_name) == 0 - && STRLEN(tail) == STRLEN(dp->d_name)) + && taillen == STRLEN(dp->d_name)) { char_u newname[MAXPATHL + 1]; struct stat st2; @@ -3054,8 +3066,7 @@ mch_copy_sec(char_u *from_file, char_u *to_file) if (size <= 0) return; - for (index = 0 ; index < (int)(sizeof(smack_copied_attributes) - / sizeof(smack_copied_attributes)[0]) ; index++) + for (index = 0 ; index < (int)ARRAY_LENGTH(smack_copied_attributes); index++) { // get the name of the attribute to copy name = smack_copied_attributes[index]; @@ -3220,12 +3231,19 @@ mch_get_acl(char_u *fname UNUSED) vim_acl_solaris_T *aclent; aclent = malloc(sizeof(vim_acl_solaris_T)); + if (aclent == NULL) + return NULL; if ((aclent->acl_cnt = acl((char *)fname, GETACLCNT, 0, NULL)) < 0) { free(aclent); return NULL; } aclent->acl_entry = malloc(aclent->acl_cnt * sizeof(aclent_t)); + if (aclent->acl_entry == NULL) + { + free(aclent); + return NULL; + } if (acl((char *)fname, GETACL, aclent->acl_cnt, aclent->acl_entry) < 0) { free(aclent->acl_entry); @@ -3240,13 +3258,15 @@ mch_get_acl(char_u *fname UNUSED) aclsize = sizeof(struct acl); aclent = malloc(aclsize); + if (aclent == NULL) + return NULL; if (statacl((char *)fname, STX_NORMAL, aclent, aclsize) < 0) { if (errno == ENOSPC) { aclsize = aclent->acl_len; aclent = realloc(aclent, aclsize); - if (statacl((char *)fname, STX_NORMAL, aclent, aclsize) < 0) + if (aclent == NULL || statacl((char *)fname, STX_NORMAL, aclent, aclsize) < 0) { free(aclent); return NULL; @@ -3399,7 +3419,11 @@ executable_file(char_u *name) mch_can_exe(char_u *name, char_u **path, int use_path) { char_u *buf; + size_t bufsize; + size_t buflen; char_u *p, *e; + char_u *p_end; + size_t elen; int retval; // When "use_path" is false and if it's an absolute or relative path don't @@ -3425,7 +3449,9 @@ mch_can_exe(char_u *name, char_u **path, int use_path) p = (char_u *)getenv("PATH"); if (p == NULL || *p == NUL) return -1; - buf = alloc(STRLEN(name) + STRLEN(p) + 2); + p_end = p + STRLEN(p); + bufsize = STRLEN(name) + (size_t)(p_end - p) + 2; + buf = alloc(bufsize); if (buf == NULL) return -1; @@ -3437,15 +3463,18 @@ mch_can_exe(char_u *name, char_u **path, int use_path) { e = (char_u *)strchr((char *)p, ':'); if (e == NULL) - e = p + STRLEN(p); - if (e - p <= 1) // empty entry means current dir - STRCPY(buf, "./"); - else + e = p_end; + elen = (size_t)(e - p); + if (elen <= 1) // empty entry means current dir { - vim_strncpy(buf, p, e - p); - add_pathsep(buf); + p = (char_u *)"./"; + elen = STRLEN_LITERAL("./"); } - STRCAT(buf, name); + buflen = vim_snprintf((char *)buf, bufsize, "%.*s%s%s", + (int)elen, + p, + (after_pathsep(p, p + elen)) ? "" : PATHSEPSTR, + name); retval = executable_file(buf); if (retval == 1) { @@ -3454,7 +3483,7 @@ mch_can_exe(char_u *name, char_u **path, int use_path) if (buf[0] != '/') *path = FullName_save(buf, TRUE); else - *path = vim_strsave(buf); + *path = vim_strnsave(buf, buflen); } break; } @@ -5233,13 +5262,13 @@ mch_call_shell_fork( linenr_T lnum = curbuf->b_op_start.lnum; int written = 0; char_u *lp = ml_get(lnum); - size_t l; + size_t lplen = (size_t)ml_get_len(lnum); close(fromshell_fd); for (;;) { - l = STRLEN(lp + written); - if (l == 0) + lplen -= written; + if (lplen == 0) len = 0; else if (lp[written] == NL) // NL -> NUL translation @@ -5249,10 +5278,10 @@ mch_call_shell_fork( char_u *s = vim_strchr(lp + written, NL); len = write(toshell_fd, (char *)lp + written, - s == NULL ? l + s == NULL ? lplen : (size_t)(s - (lp + written))); } - if (len == (int)l) + if (len == (int)lplen) { // Finished a line, add a NL, unless this line // should not have one. @@ -5272,6 +5301,7 @@ mch_call_shell_fork( break; } lp = ml_get(lnum); + lplen = ml_get_len(lnum); written = 0; } else if (len > 0) @@ -6089,14 +6119,14 @@ get_signal_name(int sig) char_u numbuf[NUMBUFLEN]; if (sig == SIGKILL) - return vim_strsave((char_u *)"kill"); + return vim_strnsave((char_u *)"kill", STRLEN_LITERAL("kill")); for (i = 0; signal_info[i].sig != -1; i++) if (sig == signal_info[i].sig) return strlow_save((char_u *)signal_info[i].name); - vim_snprintf((char *)numbuf, NUMBUFLEN, "%d", sig); - return vim_strsave(numbuf); + i = vim_snprintf((char *)numbuf, NUMBUFLEN, "%d", sig); + return vim_strnsave(numbuf, i); } char * @@ -6852,7 +6882,9 @@ mch_expand_wildcards( */ int j; char_u *tempname; + size_t tempnamelen; char_u *command; + size_t commandlen; FILE *fd; char_u *buffer; #define STYLE_ECHO 0 // use "echo", the default @@ -6866,10 +6898,14 @@ mch_expand_wildcards( int check_spaces; static int did_find_nul = FALSE; int ampersand = FALSE; - // vimglob() function to define for Posix shell - static char *sh_vimglob_func = "vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >"; - // vimglob() function with globstar setting enabled, only for bash >= 4.X - static char *sh_globstar_opt = "[[ ${BASH_VERSINFO[0]} -ge 4 ]] && shopt -s globstar; "; +#define STRING_INIT(s) \ + {(char_u *)(s), STRLEN_LITERAL(s)} + // vimglob() function to define for Posix shell + static string_T sh_vimglob_func = STRING_INIT("vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >"); + // vimglob() function with globstar setting enabled, only for bash >= 4.X + static string_T sh_globstar_opt = STRING_INIT("[[ ${BASH_VERSINFO[0]} -ge 4 ]] && shopt -s globstar; "); +#undef STRING_INIT + *num_file = 0; // default: no files found *file = NULL; @@ -6943,12 +6979,12 @@ mch_expand_wildcards( // Compute the length of the command. We need 2 extra bytes: for the // optional '&' and for the NUL. // Worst case: "unset nonomatch; print -N >" plus two is 29 - len = STRLEN(tempname) + 29; + tempnamelen = STRLEN(tempname); + len = tempnamelen + 29; if (shell_style == STYLE_VIMGLOB) - len += STRLEN(sh_vimglob_func); + len += sh_vimglob_func.length; else if (shell_style == STYLE_GLOBSTAR) - len += STRLEN(sh_vimglob_func) - + STRLEN(sh_globstar_opt); + len += sh_vimglob_func.length + sh_globstar_opt.length; for (i = 0; i < num_pat; ++i) { @@ -6985,63 +7021,62 @@ mch_expand_wildcards( if (shell_style == STYLE_BT) { // change `command; command& ` to (command; command ) - STRCPY(command, "("); - STRCAT(command, pat[0] + 1); // exclude first backtick - p = command + STRLEN(command) - 1; - *p-- = ')'; // remove last backtick - while (p > command && VIM_ISWHITE(*p)) - --p; - if (*p == '&') // remove trailing '&' + commandlen = vim_snprintf((char *)command, len, "(%s)>%s", pat[0] + 1, tempname); // +1 to exclude first backtick + + p = (char_u *)strstr((char *)command, ")>"); + if (p == NULL) { - ampersand = TRUE; - *p = ' '; + ; // can't happen ;-) + } + else + { + --p; + while (p > command && VIM_ISWHITE(*p)) + --p; + if (*p == '`') // remove backtick + *p = ' '; + + --p; + while (p > command && VIM_ISWHITE(*p)) + --p; + if (*p == '&') // remove ampersand + { + ampersand = TRUE; + *p = ' '; + } } - STRCAT(command, ">"); } else { - STRCPY(command, ""); if (shell_style == STYLE_GLOB) { // Assume the nonomatch option is valid only for csh like shells, // otherwise, this may set the positional parameters for the shell, // e.g. "$*". - if (flags & EW_NOTFOUND) - STRCAT(command, "set nonomatch; "); - else - STRCAT(command, "unset nonomatch; "); + commandlen = vim_snprintf((char *)command, len, "%sset nonomatch; glob >%s", + (flags & EW_NOTFOUND) ? "" : "un", tempname); } - if (shell_style == STYLE_GLOB) - STRCAT(command, "glob >"); else if (shell_style == STYLE_PRINT) - STRCAT(command, "print -N >"); + commandlen = vim_snprintf((char *)command, len, "print -N >%s", tempname); else if (shell_style == STYLE_VIMGLOB) - STRCAT(command, sh_vimglob_func); + commandlen = vim_snprintf((char *)command, len, "%s%s", sh_vimglob_func.string, tempname); else if (shell_style == STYLE_GLOBSTAR) - { - STRCAT(command, sh_globstar_opt); - STRCAT(command, sh_vimglob_func); - } + commandlen = vim_snprintf((char *)command, len, "%s%s%s", sh_globstar_opt.string, + sh_vimglob_func.string, tempname); else - STRCAT(command, "echo >"); - } - - STRCAT(command, tempname); + commandlen = vim_snprintf((char *)command, len, "echo >%s", tempname); - if (shell_style != STYLE_BT) for (i = 0; i < num_pat; ++i) { // When using system() always add extra quotes, because the shell // is started twice. Otherwise put a backslash before special // characters, except inside ``. #ifdef USE_SYSTEM - STRCAT(command, " \""); - STRCAT(command, pat[i]); - STRCAT(command, "\""); + commandlen += vim_snprintf((char *)command + commandlen, len, " \"%s\"", pat[i]); #else int intick = FALSE; - p = command + STRLEN(command); + p = command + commandlen; *p++ = ' '; for (j = 0; pat[i][j] != NUL; ++j) { @@ -7070,12 +7105,14 @@ mch_expand_wildcards( *p++ = pat[i][j]; } *p = NUL; + commandlen = (size_t)(p - command); #endif } + } if (flags & EW_SILENT) show_shell_mess = FALSE; if (ampersand) - STRCAT(command, "&"); // put the '&' after the redirection + STRCPY(command + commandlen, "&"); // put the '&' after the redirection /* * Using zsh -G: If a pattern has no matches, it is just deleted from @@ -8133,7 +8170,8 @@ do_xterm_trace(void) char_u buf[50]; char_u *strp; long got_hints; - static char_u *mouse_code; + static char_u *mouse_code = NULL; + static size_t mouse_codelen = 0; static char_u mouse_name[2] = {KS_MOUSE, KE_FILLER}; static int prev_row = 0, prev_col = 0; static XSizeHints xterm_hints; @@ -8156,6 +8194,8 @@ do_xterm_trace(void) // Rely on the same mouse code for the duration of this mouse_code = find_termcode(mouse_name); + if (mouse_code != NULL) + mouse_codelen = STRLEN(mouse_code); prev_row = mouse_row; prev_col = mouse_col; xterm_trace = 2; @@ -8174,7 +8214,8 @@ do_xterm_trace(void) xterm_hints.x = 2; return TRUE; } - if (mouse_code == NULL || STRLEN(mouse_code) > 45) + + if (mouse_code == NULL || mouse_codelen > 45) { xterm_trace = 0; return FALSE; @@ -8189,12 +8230,12 @@ do_xterm_trace(void) return TRUE; STRCPY(buf, mouse_code); - strp = buf + STRLEN(buf); + strp = buf + mouse_codelen; *strp++ = (xterm_button | MOUSE_DRAG) & ~0x20; *strp++ = (char_u)(col + ' ' + 1); *strp++ = (char_u)(row + ' ' + 1); - *strp = 0; - add_to_input_buf(buf, STRLEN(buf)); + *strp = NUL; + add_to_input_buf(buf, strp - buf); prev_row = row; prev_col = col; diff --git a/src/version.c b/src/version.c index 02a58aff52..53cecb3460 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1050, /**/ 1049, /**/ From a75eea218e3386af0a8c4566c789718844cbfb7c Mon Sep 17 00:00:00 2001 From: Sanjay Madan Date: Tue, 3 Nov 2020 09:19:32 -0800 Subject: [PATCH 80/93] MMTabline: a new tabline for MacVim --- runtime/doc/gui_mac.txt | 3 +- runtime/doc/tags | 3 +- src/MacVim/MMAppController.m | 22 +- src/MacVim/MMFullScreenWindow.h | 1 - src/MacVim/MMFullScreenWindow.m | 9 - src/MacVim/MMTabline/MMHoverButton.h | 11 + src/MacVim/MMTabline/MMHoverButton.m | 140 ++ src/MacVim/MMTabline/MMTab.h | 23 + src/MacVim/MMTabline/MMTab.m | 167 ++ src/MacVim/MMTabline/MMTabline.h | 47 + src/MacVim/MMTabline/MMTabline.m | 705 ++++++++ src/MacVim/MMVimController.h | 2 +- src/MacVim/MMVimController.m | 6 +- src/MacVim/MMVimView.h | 12 +- src/MacVim/MMVimView.m | 279 ++- src/MacVim/MMWindowController.h | 2 +- src/MacVim/MMWindowController.m | 31 +- src/MacVim/MacVim.xcodeproj/project.pbxproj | 75 +- .../MacVim_xcode8.xcodeproj/project.pbxproj | 75 +- src/MacVim/Miscellaneous.h | 9 +- src/MacVim/Miscellaneous.m | 34 +- .../English.lproj/InfoPlist.strings | Bin 208 -> 0 bytes .../English.lproj/MainMenu.nib/classes.nib | 24 - .../English.lproj/MainMenu.nib/info.nib | 21 - .../MainMenu.nib/keyedobjects.nib | Bin 11566 -> 0 bytes .../English.lproj/MainMenu.nib/objects.nib | Bin 4740 -> 0 bytes .../PSMTabBarControlInspector.nib/classes.nib | 22 - .../PSMTabBarControlInspector.nib/info.nib | 16 - .../keyedobjects.nib | Bin 11273 -> 0 bytes .../PSMTabBarControlInspector.nib/objects.nib | Bin 4291 -> 0 bytes .../PSMTabBarControlPalette.nib/classes.nib | 28 - .../PSMTabBarControlPalette.nib/info.nib | 16 - .../keyedobjects.nib | Bin 3036 -> 0 bytes .../PSMTabBarControlPalette.nib/objects.nib | Bin 1004 -> 0 bytes .../English.lproj/Window.nib/classes.nib | 38 - .../English.lproj/Window.nib/info.nib | 25 - .../English.lproj/Window.nib/keyedobjects.nib | Bin 16340 -> 0 bytes src/MacVim/PSMTabBarControl/Info.plist | 24 - .../Media.xcassets/Contents.json | 6 - .../Contents.json | 38 - .../Contents.json | 38 - .../Contents.json | 38 - .../Contents.json | 38 - .../Contents.json | 38 - .../Contents.json | 38 - .../Contents.json | 38 - .../Contents.json | 38 - .../PSMTabBarControl.ibclassdescription | 7 - .../project.pbxproj | 731 -------- .../PSMTabBarControlFramework-Info.plist | 22 - .../PSMTabBarControl_Prefix.pch | 8 - .../PSMTabBarControl/ReadMe.rtfd/TXT.rtf | 186 -- .../ReadMe.rtfd/startpage.gif | Bin 11246 -> 0 bytes .../TabBarControlDemo-Info.plist | 24 - .../documentation/PSMTabBarControlDoc.html | 301 ---- .../documentation/frameset_styles.css | 943 ----------- .../PSMTabBarControl/images/32x32_log.tiff | Bin 20328 -> 0 bytes .../PSMTabBarControl/images/32x32cancel.png | Bin 1447 -> 0 bytes .../images/AquaTabClose_Front.tif | Bin 15388 -> 0 bytes .../images/AquaTabClose_Front_Pressed.tif | Bin 15416 -> 0 bytes .../images/AquaTabClose_Front_Rollover.tif | Bin 15444 -> 0 bytes .../PSMTabBarControl/images/AquaTabNew.png | Bin 3139 -> 0 bytes .../images/AquaTabNewPressed.png | Bin 3157 -> 0 bytes .../images/AquaTabNewRollover.png | Bin 3147 -> 0 bytes .../images/AquaTabsBackground.png | Bin 3091 -> 0 bytes .../PSMTabBarControl/images/AquaTabsDown.png | Bin 2901 -> 0 bytes .../images/AquaTabsDownGraphite.png | Bin 843 -> 0 bytes .../images/AquaTabsDownNonKey.png | Bin 787 -> 0 bytes .../images/AquaTabsSeparator.png | Bin 257 -> 0 bytes .../images/AquaTabsSeparatorDown.png | Bin 264 -> 0 bytes src/MacVim/PSMTabBarControl/images/Folder.tif | Bin 926 -> 0 bytes src/MacVim/PSMTabBarControl/images/Globe.tiff | Bin 17104 -> 0 bytes .../images/TabClose_Front.png | Bin 518 -> 0 bytes .../images/TabClose_Front@2x.png | Bin 4301 -> 0 bytes .../images/TabClose_Front_Pressed.png | Bin 542 -> 0 bytes .../images/TabClose_Front_Pressed@2x.png | Bin 4114 -> 0 bytes .../images/TabClose_Front_Rollover.png | Bin 525 -> 0 bytes .../images/TabClose_Front_Rollover@2x.png | Bin 4122 -> 0 bytes .../PSMTabBarControl/images/TabControlRep.tif | Bin 29768 -> 0 bytes .../PSMTabBarControl/images/TabIcon.tif | Bin 21160 -> 0 bytes .../PSMTabBarControl/images/TabNewMetal.png | Bin 3137 -> 0 bytes .../images/TabNewMetal@2x.png | Bin 3886 -> 0 bytes .../images/TabNewMetalPressed.png | Bin 3160 -> 0 bytes .../images/TabNewMetalPressed@2x.png | Bin 3759 -> 0 bytes .../images/TabNewMetalRollover.png | Bin 3146 -> 0 bytes .../images/TabNewMetalRollover@2x.png | Bin 3770 -> 0 bytes .../images/TabNewYosemite.png | Bin 1459 -> 0 bytes .../images/TabNewYosemite@2x.png | Bin 4338 -> 0 bytes .../PSMTabBarControl/images/Warning.png | Bin 3412 -> 0 bytes .../PSMTabBarControl/images/overflowImage.png | Bin 449 -> 0 bytes .../images/overflowImage@2x.png | Bin 4028 -> 0 bytes .../images/overflowImagePressed.png | Bin 333 -> 0 bytes .../images/overflowImagePressed@2x.png | Bin 3952 -> 0 bytes src/MacVim/PSMTabBarControl/images/pi.png | Bin 3396 -> 0 bytes src/MacVim/PSMTabBarControl/palette.table | 42 - .../PSMTabBarControl/source/AppController.h | 17 - .../PSMTabBarControl/source/AppController.m | 30 - .../PSMTabBarControl/source/FakeModel.h | 34 - .../PSMTabBarControl/source/FakeModel.m | 77 - .../source/NSBezierPath_AMShading.h | 23 - .../source/NSBezierPath_AMShading.m | 178 -- .../source/PSMMetalTabStyle.h | 28 - .../source/PSMMetalTabStyle.m | 531 ------ .../source/PSMMojaveTabStyle.h | 35 - .../source/PSMMojaveTabStyle.m | 573 ------- .../source/PSMOverflowPopUpButton.h | 21 - .../source/PSMOverflowPopUpButton.m | 90 - .../source/PSMProgressIndicator.h | 23 - .../source/PSMProgressIndicator.m | 20 - .../source/PSMRolloverButton.h | 29 - .../source/PSMRolloverButton.m | 117 -- .../PSMTabBarControl/source/PSMTabBarCell.h | 105 -- .../PSMTabBarControl/source/PSMTabBarCell.m | 404 ----- .../source/PSMTabBarControl.h | 155 -- .../source/PSMTabBarControl.m | 1492 ----------------- .../source/PSMTabBarControlInspector.h | 23 - .../source/PSMTabBarControlInspector.m | 99 -- .../source/PSMTabBarControlPalette.h | 21 - .../source/PSMTabBarControlPalette.m | 35 - .../source/PSMTabBarControl_Prefix.pch | 8 - .../source/PSMTabDragAssistant.h | 84 - .../source/PSMTabDragAssistant.m | 439 ----- .../PSMTabBarControl/source/PSMTabStyle.h | 52 - .../source/PSMUnifiedTabStyle.h | 26 - .../source/PSMUnifiedTabStyle.m | 525 ------ .../source/PSMYosemiteTabStyle.h | 28 - .../source/PSMYosemiteTabStyle.m | 499 ------ .../source/WindowController.h | 58 - .../source/WindowController.m | 280 ---- src/MacVim/PSMTabBarControl/source/main.m | 14 - src/MacVim/PSMTabBarControl/version.plist | 16 - 131 files changed, 1277 insertions(+), 9356 deletions(-) create mode 100644 src/MacVim/MMTabline/MMHoverButton.h create mode 100644 src/MacVim/MMTabline/MMHoverButton.m create mode 100644 src/MacVim/MMTabline/MMTab.h create mode 100644 src/MacVim/MMTabline/MMTab.m create mode 100644 src/MacVim/MMTabline/MMTabline.h create mode 100644 src/MacVim/MMTabline/MMTabline.m delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/InfoPlist.strings delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/classes.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/info.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/keyedobjects.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/objects.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/classes.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/info.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/keyedobjects.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/objects.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/classes.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/info.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/keyedobjects.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/objects.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/Window.nib/classes.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/Window.nib/info.nib delete mode 100644 src/MacVim/PSMTabBarControl/English.lproj/Window.nib/keyedobjects.nib delete mode 100644 src/MacVim/PSMTabBarControl/Info.plist delete mode 100644 src/MacVim/PSMTabBarControl/Media.xcassets/Contents.json delete mode 100644 src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActive.colorset/Contents.json delete mode 100644 src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveHighlight.colorset/Contents.json delete mode 100644 src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveSelected.colorset/Contents.json delete mode 100644 src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactive.colorset/Contents.json delete mode 100644 src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveHighlight.colorset/Contents.json delete mode 100644 src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveSelected.colorset/Contents.json delete mode 100644 src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderActive.colorset/Contents.json delete mode 100644 src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderInactive.colorset/Contents.json delete mode 100755 src/MacVim/PSMTabBarControl/PSMTabBarControl.ibclassdescription delete mode 100644 src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj delete mode 100644 src/MacVim/PSMTabBarControl/PSMTabBarControlFramework-Info.plist delete mode 100644 src/MacVim/PSMTabBarControl/PSMTabBarControl_Prefix.pch delete mode 100644 src/MacVim/PSMTabBarControl/ReadMe.rtfd/TXT.rtf delete mode 100644 src/MacVim/PSMTabBarControl/ReadMe.rtfd/startpage.gif delete mode 100644 src/MacVim/PSMTabBarControl/TabBarControlDemo-Info.plist delete mode 100644 src/MacVim/PSMTabBarControl/documentation/PSMTabBarControlDoc.html delete mode 100644 src/MacVim/PSMTabBarControl/documentation/frameset_styles.css delete mode 100644 src/MacVim/PSMTabBarControl/images/32x32_log.tiff delete mode 100644 src/MacVim/PSMTabBarControl/images/32x32cancel.png delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabClose_Front.tif delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabClose_Front_Pressed.tif delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabClose_Front_Rollover.tif delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabNew.png delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabNewPressed.png delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabNewRollover.png delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabsBackground.png delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabsDown.png delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabsDownGraphite.png delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabsDownNonKey.png delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabsSeparator.png delete mode 100644 src/MacVim/PSMTabBarControl/images/AquaTabsSeparatorDown.png delete mode 100644 src/MacVim/PSMTabBarControl/images/Folder.tif delete mode 100644 src/MacVim/PSMTabBarControl/images/Globe.tiff delete mode 100644 src/MacVim/PSMTabBarControl/images/TabClose_Front.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabClose_Front@2x.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed@2x.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabClose_Front_Rollover.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabClose_Front_Rollover@2x.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabControlRep.tif delete mode 100644 src/MacVim/PSMTabBarControl/images/TabIcon.tif delete mode 100644 src/MacVim/PSMTabBarControl/images/TabNewMetal.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabNewMetal@2x.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabNewMetalPressed.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabNewMetalPressed@2x.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabNewMetalRollover.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabNewMetalRollover@2x.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabNewYosemite.png delete mode 100644 src/MacVim/PSMTabBarControl/images/TabNewYosemite@2x.png delete mode 100644 src/MacVim/PSMTabBarControl/images/Warning.png delete mode 100644 src/MacVim/PSMTabBarControl/images/overflowImage.png delete mode 100644 src/MacVim/PSMTabBarControl/images/overflowImage@2x.png delete mode 100644 src/MacVim/PSMTabBarControl/images/overflowImagePressed.png delete mode 100644 src/MacVim/PSMTabBarControl/images/overflowImagePressed@2x.png delete mode 100644 src/MacVim/PSMTabBarControl/images/pi.png delete mode 100644 src/MacVim/PSMTabBarControl/palette.table delete mode 100644 src/MacVim/PSMTabBarControl/source/AppController.h delete mode 100644 src/MacVim/PSMTabBarControl/source/AppController.m delete mode 100644 src/MacVim/PSMTabBarControl/source/FakeModel.h delete mode 100644 src/MacVim/PSMTabBarControl/source/FakeModel.m delete mode 100644 src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.h delete mode 100644 src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMRolloverButton.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMRolloverButton.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabBarCell.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabBarCell.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabBarControl_Prefix.pch delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMTabStyle.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.h delete mode 100644 src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.m delete mode 100644 src/MacVim/PSMTabBarControl/source/WindowController.h delete mode 100644 src/MacVim/PSMTabBarControl/source/WindowController.m delete mode 100644 src/MacVim/PSMTabBarControl/source/main.m delete mode 100644 src/MacVim/PSMTabBarControl/version.plist diff --git a/runtime/doc/gui_mac.txt b/runtime/doc/gui_mac.txt index 926da6e14a..68963f4bf1 100644 --- a/runtime/doc/gui_mac.txt +++ b/runtime/doc/gui_mac.txt @@ -310,9 +310,10 @@ KEY VALUE ~ *MMSmoothResize* allow smooth resizing of MacVim window [bool] *MMShareFindPboard* share search text to Find Pasteboard [bool] *MMShowAddTabButton* enable "add tab" button on tabline [bool] -*MMTabMaxWidth* maximum width of a tab [int] +*MMShowTabScrollButtons* enable tab scroll buttons on tabline [bool] *MMTabMinWidth* minimum width of a tab [int] *MMTabOptimumWidth* default width of a tab [int] +*MMDefaultTablineColors* use default colors instead of colorscheme for tabs [bool] *MMTextInsetBottom* text area offset in pixels [int] *MMTextInsetLeft* text area offset in pixels [int] *MMTextInsetRight* text area offset in pixels [int] diff --git a/runtime/doc/tags b/runtime/doc/tags index 097d88ed55..9049779b39 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5642,6 +5642,7 @@ MMAllowForceClickLookUp gui_mac.txt /*MMAllowForceClickLookUp* MMAppearanceModeSelection gui_mac.txt /*MMAppearanceModeSelection* MMCellWidthMultiplier gui_mac.txt /*MMCellWidthMultiplier* MMCmdLineAlignBottom gui_mac.txt /*MMCmdLineAlignBottom* +MMDefaultTablineColors gui_mac.txt /*MMDefaultTablineColors* MMDialogsTrackPwd gui_mac.txt /*MMDialogsTrackPwd* MMDisableLaunchAnimation gui_mac.txt /*MMDisableLaunchAnimation* MMFontPreserveLineSpacing gui_mac.txt /*MMFontPreserveLineSpacing* @@ -5658,9 +5659,9 @@ MMRendererClipToRow gui_mac.txt /*MMRendererClipToRow* MMScrollOneDirectionOnly gui_mac.txt /*MMScrollOneDirectionOnly* MMShareFindPboard gui_mac.txt /*MMShareFindPboard* MMShowAddTabButton gui_mac.txt /*MMShowAddTabButton* +MMShowTabScrollButtons gui_mac.txt /*MMShowTabScrollButtons* MMShowWhatsNewOnStartup gui_mac.txt /*MMShowWhatsNewOnStartup* MMSmoothResize gui_mac.txt /*MMSmoothResize* -MMTabMaxWidth gui_mac.txt /*MMTabMaxWidth* MMTabMinWidth gui_mac.txt /*MMTabMinWidth* MMTabOptimumWidth gui_mac.txt /*MMTabOptimumWidth* MMTextInsetBottom gui_mac.txt /*MMTextInsetBottom* diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index 8c8acccb5c..e1c1f4ffee 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -170,30 +170,14 @@ @implementation MMAppController /// persisted user settings to have a clean environment. + (void)registerDefaults { - int tabMinWidthKey; - int tabMaxWidthKey; - int tabOptimumWidthKey; - if (shouldUseYosemiteTabBarStyle()) { - tabMinWidthKey = 120; - tabMaxWidthKey = 0; - tabOptimumWidthKey = 0; - } else { - tabMinWidthKey = 64; - tabMaxWidthKey = 6*64; - tabOptimumWidthKey = 132; - } - NSUserDefaults *ud = NSUserDefaults.standardUserDefaults; NSDictionary *macvimDefaults = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:NO], MMNoWindowKey, - [NSNumber numberWithInt:tabMinWidthKey], - MMTabMinWidthKey, - [NSNumber numberWithInt:tabMaxWidthKey], - MMTabMaxWidthKey, - [NSNumber numberWithInt:tabOptimumWidthKey], - MMTabOptimumWidthKey, + [NSNumber numberWithInt:120], MMTabMinWidthKey, + [NSNumber numberWithInt:200], MMTabOptimumWidthKey, [NSNumber numberWithBool:YES], MMShowAddTabButtonKey, + [NSNumber numberWithBool:NO], MMShowTabScrollButtonsKey, [NSNumber numberWithInt:2], MMTextInsetLeftKey, [NSNumber numberWithInt:1], MMTextInsetRightKey, [NSNumber numberWithInt:1], MMTextInsetTopKey, diff --git a/src/MacVim/MMFullScreenWindow.h b/src/MacVim/MMFullScreenWindow.h index bd1817f61f..34519dbc7e 100644 --- a/src/MacVim/MMFullScreenWindow.h +++ b/src/MacVim/MMFullScreenWindow.h @@ -17,7 +17,6 @@ @interface MMFullScreenWindow : NSWindow { NSWindow *target; MMVimView *view; - NSString *oldTabBarStyle; int options; int state; diff --git a/src/MacVim/MMFullScreenWindow.m b/src/MacVim/MMFullScreenWindow.m index bab3da3198..78bfeb1ec3 100644 --- a/src/MacVim/MMFullScreenWindow.m +++ b/src/MacVim/MMFullScreenWindow.m @@ -29,7 +29,6 @@ #import "MMVimView.h" #import "MMWindowController.h" #import "Miscellaneous.h" -#import // These have to be the same as in option.h #define FUOPT_MAXVERT 0x001 @@ -178,12 +177,6 @@ - (void)enterFullScreen } [self setFrame:[screen frame] display:NO]; - oldTabBarStyle = [[view tabBarControl] styleName]; - - NSString *style = - shouldUseYosemiteTabBarStyle() ? (shouldUseMojaveTabBarStyle() ? @"Mojave" : @"Yosemite") : @"Unified"; - [[view tabBarControl] setStyleNamed:style]; - // add text view [view removeFromSuperviewWithoutNeedingDisplay]; [[self contentView] addSubview:view]; @@ -259,8 +252,6 @@ - (void)leaveFullScreen [self retain]; // NSWindowController releases us once [[self windowController] setWindow:target]; - [[view tabBarControl] setStyleNamed:oldTabBarStyle]; - // fix delegate id delegate = [self delegate]; [self setDelegate:nil]; diff --git a/src/MacVim/MMTabline/MMHoverButton.h b/src/MacVim/MMTabline/MMHoverButton.h new file mode 100644 index 0000000000..df3322b8a9 --- /dev/null +++ b/src/MacVim/MMTabline/MMHoverButton.h @@ -0,0 +1,11 @@ +#import + +// A button that fades in a circular background when hovered. + +@interface MMHoverButton : NSButton + +@property (nonatomic, retain) NSColor *fgColor; + ++ (NSImage *)imageNamed:(NSString *)name; + +@end diff --git a/src/MacVim/MMTabline/MMHoverButton.m b/src/MacVim/MMTabline/MMHoverButton.m new file mode 100644 index 0000000000..e51c4d8c30 --- /dev/null +++ b/src/MacVim/MMTabline/MMHoverButton.m @@ -0,0 +1,140 @@ +#import "MMHoverButton.h" + +@implementation MMHoverButton +{ + NSTrackingArea *_trackingArea; + NSBox *_circle; +} + ++ (NSImage *)imageNamed:(NSString *)name +{ + CGFloat size = [name isEqualToString:@"CloseTabButton"] ? 15 : 17; + return [NSImage imageWithSize:NSMakeSize(size, size) flipped:NO drawingHandler:^BOOL(NSRect dstRect) { + NSBezierPath *p = [NSBezierPath new]; + if ([name isEqualToString:@"AddTabButton"]) { + [p moveToPoint:NSMakePoint( 8.5, 4.5)]; + [p lineToPoint:NSMakePoint( 8.5, 12.5)]; + [p moveToPoint:NSMakePoint( 4.5, 8.5)]; + [p lineToPoint:NSMakePoint(12.5, 8.5)]; + [p setLineWidth:1.2]; + [p stroke]; + } + else if ([name isEqualToString:@"CloseTabButton"]) { + [p moveToPoint:NSMakePoint( 4.5, 4.5)]; + [p lineToPoint:NSMakePoint(10.5, 10.5)]; + [p moveToPoint:NSMakePoint( 4.5, 10.5)]; + [p lineToPoint:NSMakePoint(10.5, 4.5)]; + [p setLineWidth:1.2]; + [p stroke]; + } + else if ([name isEqualToString:@"ScrollLeftButton"]) { + [p moveToPoint:NSMakePoint( 5.0, 8.5)]; + [p lineToPoint:NSMakePoint(10.0, 4.5)]; + [p lineToPoint:NSMakePoint(10.0, 12.5)]; + [p fill]; + } + else if ([name isEqualToString:@"ScrollRightButton"]) { + [p moveToPoint:NSMakePoint(12.0, 8.5)]; + [p lineToPoint:NSMakePoint( 7.0, 4.5)]; + [p lineToPoint:NSMakePoint( 7.0, 12.5)]; + [p fill]; + } + return YES; + }]; +} + +- (instancetype)initWithFrame:(NSRect)frameRect +{ + self = [super initWithFrame:frameRect]; + if (self) { + self.buttonType = NSButtonTypeMomentaryChange; + self.bordered = NO; + self.imagePosition = NSImageOnly; + + // This view will fade in/out when hovered. + _circle = [NSBox new]; + _circle.boxType = NSBoxCustom; + _circle.borderWidth = 0; + _circle.alphaValue = 0.16; + _circle.fillColor = NSColor.clearColor; + _circle.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + _circle.frame = self.bounds; + [self addSubview:_circle positioned:NSWindowBelow relativeTo:nil]; + } + return self; +} + +- (void)setFgColor:(NSColor *)color +{ + _fgColor = color; + self.image = super.image; +} + +- (void)setImage:(NSImage *)image +{ + _circle.cornerRadius = image.size.width / 2.0; + NSColor *fillColor = self.fgColor ?: NSColor.controlTextColor; + super.image = [NSImage imageWithSize:image.size flipped:NO drawingHandler:^BOOL(NSRect dstRect) { + [image drawInRect:dstRect]; + [fillColor set]; + NSRectFillUsingOperation(dstRect, NSCompositingOperationSourceAtop); + return YES; + }]; + self.alternateImage = [NSImage imageWithSize:image.size flipped:NO drawingHandler:^BOOL(NSRect dstRect) { + [[fillColor colorWithAlphaComponent:0.2] set]; + [[NSBezierPath bezierPathWithOvalInRect:dstRect] fill]; + [super.image drawInRect:dstRect]; + return YES; + }]; +} + +- (void)setEnabled:(BOOL)enabled +{ + [super setEnabled:enabled]; + [self evaluateHover]; +} + +- (void)updateTrackingAreas +{ + [self removeTrackingArea:_trackingArea]; + _trackingArea = [[NSTrackingArea alloc] initWithRect:self.bounds options:(NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow) owner:self userInfo:nil]; + [self addTrackingArea:_trackingArea]; + [self evaluateHover]; + [super updateTrackingAreas]; +} + +- (void)backgroundCircleShouldHighlight:(BOOL)shouldHighlight +{ + NSColor *fillColor = NSColor.clearColor; + if (shouldHighlight) { + fillColor = self.fgColor ?: NSColor.controlTextColor; + } + [NSAnimationContext beginGrouping]; + [[NSAnimationContext currentContext] setDuration:0.1]; + _circle.animator.fillColor = fillColor; + [NSAnimationContext endGrouping]; +} + +- (void)evaluateHover +{ + NSPoint mouseLocation = [self.window mouseLocationOutsideOfEventStream]; + mouseLocation = [self convertPoint:mouseLocation fromView:nil]; + if (NSPointInRect(mouseLocation, self.bounds)) { + if (self.enabled) [self backgroundCircleShouldHighlight:YES]; + else [self backgroundCircleShouldHighlight:NO]; + } else { + [self backgroundCircleShouldHighlight:NO]; + } +} + +- (void)mouseEntered:(NSEvent *)event +{ + if (self.enabled) [self backgroundCircleShouldHighlight:YES]; +} + +- (void)mouseExited:(NSEvent *)event +{ + [self backgroundCircleShouldHighlight:NO]; +} + +@end diff --git a/src/MacVim/MMTabline/MMTab.h b/src/MacVim/MMTabline/MMTab.h new file mode 100644 index 0000000000..2bd05037d2 --- /dev/null +++ b/src/MacVim/MMTabline/MMTab.h @@ -0,0 +1,23 @@ +#import + +// A tab with a close button and title. + +#define MMTabShadowBlurRadius (2) + +typedef enum : NSInteger { + MMTabStateSelected, + MMTabStateUnselected, + MMTabStateUnselectedHover, +} MMTabState; + +@class MMTabline; + +@interface MMTab : NSView + +@property (nonatomic, copy) NSString *title; +@property (nonatomic, getter=isCloseButtonHidden) BOOL closeButtonHidden; +@property (nonatomic) MMTabState state; + +- (instancetype)initWithFrame:(NSRect)frameRect tabline:(MMTabline *)tabline; + +@end diff --git a/src/MacVim/MMTabline/MMTab.m b/src/MacVim/MMTabline/MMTab.m new file mode 100644 index 0000000000..e69b1335f2 --- /dev/null +++ b/src/MacVim/MMTabline/MMTab.m @@ -0,0 +1,167 @@ +#import +#import "MMTab.h" +#import "MMTabline.h" +#import "MMHoverButton.h" + +#import "MacVim.h" // for availability macros + +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13 +typedef NSString * NSAnimatablePropertyKey; +#endif + +@interface MMTab () +@property (nonatomic) NSColor *fillColor; +@end + +@implementation MMTab +{ + MMTabline __weak *_tabline; + MMHoverButton *_closeButton; + NSTextField *_titleLabel; +} + ++ (id)defaultAnimationForKey:(NSAnimatablePropertyKey)key +{ + if ([key isEqualToString:@"fillColor"]) { + CABasicAnimation *anim = [CABasicAnimation new]; + anim.duration = 0.1; + return anim; + } + return [super defaultAnimationForKey:key]; +} + +- (instancetype)initWithFrame:(NSRect)frameRect tabline:(MMTabline *)tabline +{ + self = [super initWithFrame:frameRect]; + if (self) { + _tabline = tabline; + + _closeButton = [MMHoverButton new]; + _closeButton.image = [MMHoverButton imageNamed:@"CloseTabButton"]; + _closeButton.target = self; + _closeButton.action = @selector(closeTab:); + _closeButton.translatesAutoresizingMaskIntoConstraints = NO; + [self addSubview:_closeButton]; + + _titleLabel = [NSTextField new]; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11 + if (AVAILABLE_MAC_OS(10,11)) { + _titleLabel.font = [NSFont systemFontOfSize:NSFont.smallSystemFontSize weight:NSFontWeightSemibold]; + } else +#endif + { + _titleLabel.font = [NSFont systemFontOfSize:NSFont.smallSystemFontSize]; + } + _titleLabel.textColor = NSColor.controlTextColor; + _titleLabel.editable = NO; + _titleLabel.selectable = NO; + _titleLabel.bordered = NO; + _titleLabel.bezeled = NO; + _titleLabel.drawsBackground = NO; + _titleLabel.cell.lineBreakMode = NSLineBreakByTruncatingTail; + // Title can be compressed smaller than its contents. See centerConstraint + // below where priority is set less than here for compression resistance. + // This breaks centering and allows label to fill all available space. + [_titleLabel setContentCompressionResistancePriority:NSLayoutPriorityFittingSizeCompression+2 forOrientation:NSLayoutConstraintOrientationHorizontal]; + _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; + [self addSubview:_titleLabel]; + + NSDictionary *viewDict = NSDictionaryOfVariableBindings(_closeButton, _titleLabel); + [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-9-[_closeButton]-(>=5)-[_titleLabel]-(>=16)-|" options:NSLayoutFormatAlignAllCenterY metrics:nil views:viewDict]]; + [self addConstraint:[NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:_titleLabel attribute:NSLayoutAttributeCenterY multiplier:1 constant:0]]; + NSLayoutConstraint *centerConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:_titleLabel attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]; + centerConstraint.priority = NSLayoutPriorityFittingSizeCompression+1; + [self addConstraint:centerConstraint]; + + self.state = MMTabStateUnselected; + } + return self; +} + +- (void)closeTab:(id)sender +{ + [_tabline closeTab:self force:NO layoutImmediately:NO]; +} + +- (NSString *)title +{ + return _titleLabel.stringValue; +} + +- (void)setTitle:(NSString *)title +{ + _titleLabel.stringValue = title; +} + +- (void)setCloseButtonHidden:(BOOL)closeButtonHidden +{ + _closeButtonHidden = closeButtonHidden; + _closeButton.hidden = closeButtonHidden; +} + +- (void)setFillColor:(NSColor *)fillColor +{ + _fillColor = fillColor; + self.needsDisplay = YES; +} + +- (void)setState:(MMTabState)state +{ + // Transitions to and from MMTabStateSelected + // DO NOT animate so that UX feels snappier. + if (state == MMTabStateSelected) { + _closeButton.fgColor = _tabline.tablineSelFgColor; + _titleLabel.textColor = _tabline.tablineSelFgColor; + self.fillColor = _tabline.tablineSelBgColor; + } + else if (state == MMTabStateUnselected) { + if (_state == MMTabStateSelected) { + _closeButton.fgColor = _tabline.tablineFgColor; + _titleLabel.textColor = _tabline.tablineFgColor; + self.fillColor = _tabline.tablineBgColor; + } else { + _closeButton.animator.fgColor = _tabline.tablineFgColor; + _titleLabel.animator.textColor = _tabline.tablineFgColor; + self.animator.fillColor = _tabline.tablineBgColor; + } + } + else { // state == MMTabStateUnselectedHover + _closeButton.animator.fgColor = _tabline.tablineSelFgColor; + _titleLabel.animator.textColor = _tabline.tablineSelFgColor; + self.animator.fillColor = self.unselectedHoverColor; + } + _state = state; +} + +- (NSColor *)unselectedHoverColor +{ + return [_tabline.tablineSelBgColor blendedColorWithFraction:0.6 ofColor:_tabline.tablineBgColor]; +} + +- (void)drawRect:(NSRect)dirtyRect +{ + [self.fillColor set]; + CGFloat minX = MMTabShadowBlurRadius; + CGFloat maxX = NSMaxX(self.bounds); + CGFloat maxY = MMTablineHeight; + NSBezierPath *p = [NSBezierPath new]; + [p moveToPoint:NSMakePoint(minX, 0)]; + [p lineToPoint:NSMakePoint(minX + 3.6, maxY - 2.5)]; + [p curveToPoint: NSMakePoint(minX + 6.5, maxY) controlPoint1: NSMakePoint(minX + 3.8, maxY - 1) controlPoint2: NSMakePoint(minX + 5.1, maxY)]; + [p lineToPoint:NSMakePoint(maxX - 6.5 - minX, maxY)]; + [p curveToPoint:NSMakePoint(maxX - 3.6 - minX, maxY - 2.5) controlPoint1: NSMakePoint(maxX - 5.1 - minX, maxY) controlPoint2: NSMakePoint(maxX - 3.8 - minX, maxY - 1)]; + [p lineToPoint:NSMakePoint(maxX - minX, 0)]; + [p closePath]; + // On macOS 11, translate the tab down 1 pt to provide a thin + // line between the top of the tab and the window's title bar. + // It looks better given the new way macOS 11 draws title bars. + // Older macOS versions don't need this. + if (AVAILABLE_MAC_OS(11,0)) { + NSAffineTransform *transform = [NSAffineTransform new]; + [transform translateXBy:0 yBy:-1.0]; + [p transformUsingAffineTransform:transform]; + } + [p fill]; +} + +@end diff --git a/src/MacVim/MMTabline/MMTabline.h b/src/MacVim/MMTabline/MMTabline.h new file mode 100644 index 0000000000..18c7dca70e --- /dev/null +++ b/src/MacVim/MMTabline/MMTabline.h @@ -0,0 +1,47 @@ +#import +#import "MMHoverButton.h" +#import "MMTab.h" + +// A tabline containing one or more tabs. + +#define MMTablineHeight (23) + +@protocol MMTablineDelegate; + +@interface MMTabline : NSView + +@property (nonatomic) NSInteger selectedTabIndex; +@property (nonatomic) NSInteger optimumTabWidth; +@property (nonatomic) NSInteger minimumTabWidth; +@property (nonatomic) BOOL showsAddTabButton; +@property (nonatomic) BOOL showsTabScrollButtons; +@property (nonatomic, readonly) NSInteger numberOfTabs; +@property (nonatomic, retain, readonly) MMHoverButton *addTabButton; +@property (nonatomic, retain) NSColor *tablineBgColor; +@property (nonatomic, retain) NSColor *tablineFgColor; +@property (nonatomic, retain) NSColor *tablineSelBgColor; +@property (nonatomic, retain) NSColor *tablineSelFgColor; +@property (nonatomic, retain) NSColor *tablineFillFgColor; +@property (nonatomic, weak) id delegate; + +- (NSInteger)addTabAtEnd; +- (NSInteger)addTabAfterSelectedTab; +- (NSInteger)addTabAtIndex:(NSInteger)index; +- (void)closeTab:(MMTab *)tab force:(BOOL)force layoutImmediately:(BOOL)layoutImmediately; +- (void)selectTabAtIndex:(NSInteger)index; +- (MMTab *)tabAtIndex:(NSInteger)index; +- (void)scrollTabToVisibleAtIndex:(NSInteger)index; +- (void)setTablineSelBackground:(NSColor *)back foreground:(NSColor *)fore; + +@end + +@protocol MMTablineDelegate +@optional + +- (BOOL)tabline:(MMTabline *)tabline shouldSelectTabAtIndex:(NSInteger)index; +- (BOOL)tabline:(MMTabline *)tabline shouldCloseTabAtIndex:(NSInteger)index; +- (void)tabline:(MMTabline *)tabline didDragTab:(MMTab *)tab toIndex:(NSInteger)index; +- (NSDragOperation)tabline:(MMTabline *)tabline draggingEntered:(id )dragInfo forTabAtIndex:(NSInteger)index; +- (BOOL)tabline:(MMTabline *)tabline performDragOperation:(id )dragInfo forTabAtIndex:(NSInteger)index; + +@end diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m new file mode 100644 index 0000000000..5d0d04c7ba --- /dev/null +++ b/src/MacVim/MMTabline/MMTabline.m @@ -0,0 +1,705 @@ +#import +#import +#import "MMTabline.h" +#import "Miscellaneous.h" + +typedef struct TabWidth { + CGFloat width; + CGFloat remainder; +} TabWidth; + +const CGFloat OptimumTabWidth = 200; +const CGFloat MinimumTabWidth = 100; +const CGFloat TabOverlap = 6; + +static MMHoverButton* MakeHoverButton(MMTabline *tabline, NSString *imageName, NSString *tooltip, SEL action, BOOL continuous) { + MMHoverButton *button = [MMHoverButton new]; + button.image = [MMHoverButton imageNamed:imageName]; + button.translatesAutoresizingMaskIntoConstraints = NO; + button.target = tabline; + button.action = action; + button.continuous = continuous; + [button sizeToFit]; + [button setToolTip:NSLocalizedString(tooltip, @"Tabline button")]; + [tabline addSubview:button]; + return button; +} + +static BOOL isDarkMode(NSAppearance *appearance) { + int flags = getCurrentAppearance(appearance); + return (flags == 1 || flags == 3); +} + +@implementation MMTabline +{ + NSView *_tabsContainer; + NSScrollView *_scrollView; + NSMutableArray *_tabs; + NSTrackingArea *_trackingArea; + NSLayoutConstraint *_tabScrollButtonsLeadingConstraint; + NSLayoutConstraint *_addTabButtonTrailingConstraint; + BOOL _pendingFixupLayout; + MMTab *_selectedTab; + MMTab *_draggedTab; + CGFloat _xOffsetForDrag; + NSInteger _initialDraggedTabIndex; + NSInteger _finalDraggedTabIndex; + MMHoverButton *_leftScrollButton; + MMHoverButton *_rightScrollButton; + id _scrollWheelEventMonitor; +} + +@synthesize tablineBgColor = _tablineBgColor; +@synthesize tablineFgColor = _tablineFgColor; +@synthesize tablineSelBgColor = _tablineSelBgColor; +@synthesize tablineSelFgColor = _tablineSelFgColor; +@synthesize tablineFillFgColor = _tablineFillFgColor; + +- (instancetype)initWithFrame:(NSRect)frameRect +{ + self = [super initWithFrame:frameRect]; + if (self) { + self.wantsLayer = YES; // we use -updateLayer to fill background + + _tabs = [NSMutableArray new]; + _showsAddTabButton = YES; // get from NSUserDefaults + _showsTabScrollButtons = YES; // get from NSUserDefaults + + // This view holds the tab views. + _tabsContainer = [NSView new]; + _tabsContainer.frame = (NSRect){{0, 0}, frameRect.size}; + + _scrollView = [NSScrollView new]; + _scrollView.drawsBackground = NO; + _scrollView.verticalScrollElasticity = NSScrollElasticityNone; + _scrollView.contentView.postsBoundsChangedNotifications = YES; + _scrollView.translatesAutoresizingMaskIntoConstraints = NO; + _scrollView.documentView = _tabsContainer; + [self addSubview:_scrollView]; + + _addTabButton = MakeHoverButton(self, @"AddTabButton", @"New Tab (⌘T)", @selector(addTabAtEnd), NO); + _leftScrollButton = MakeHoverButton(self, @"ScrollLeftButton", @"Scroll Tabs", @selector(scrollLeftOneTab), YES); + _rightScrollButton = MakeHoverButton(self, @"ScrollRightButton", @"Scroll Tabs", @selector(scrollRightOneTab), YES); + + [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[_leftScrollButton][_rightScrollButton]-5-[_scrollView]-5-[_addTabButton]" options:NSLayoutFormatAlignAllCenterY metrics:nil views:NSDictionaryOfVariableBindings(_scrollView, _leftScrollButton, _rightScrollButton, _addTabButton)]]; + [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_scrollView]|" options:0 metrics:nil views:@{@"_scrollView":_scrollView}]]; + + _tabScrollButtonsLeadingConstraint = [NSLayoutConstraint constraintWithItem:_leftScrollButton attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeading multiplier:1 constant:5]; + [self addConstraint:_tabScrollButtonsLeadingConstraint]; + + _addTabButtonTrailingConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:_addTabButton attribute:NSLayoutAttributeTrailing multiplier:1 constant:5]; + [self addConstraint:_addTabButtonTrailingConstraint]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didScroll:) name:NSViewBoundsDidChangeNotification object:_scrollView.contentView]; + + // Monitor for scroll wheel events so we can scroll the tabline + // horizontally without the user having to hold down SHIFT. + _scrollWheelEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskScrollWheel handler:^NSEvent * _Nullable(NSEvent * _Nonnull event) { + NSPoint location = [_scrollView convertPoint:event.locationInWindow fromView:nil]; + // We want events: + // where the mouse is over the _scrollView + // and where the user is not modifying it with the SHIFT key + // and initiated by the scroll wheel and not the trackpad + if ([_scrollView mouse:location inRect:_scrollView.bounds] + && !event.modifierFlags + && !event.hasPreciseScrollingDeltas) + { + // Create a new scroll wheel event based on the original, + // but set the new deltaX to the original's deltaY. + // stackoverflow.com/a/38991946/111418 + CGEventRef cgEvent = CGEventCreateCopy(event.CGEvent); + CGEventSetIntegerValueField(cgEvent, kCGScrollWheelEventDeltaAxis2, event.scrollingDeltaY); + NSEvent *newEvent = [NSEvent eventWithCGEvent:cgEvent]; + CFRelease(cgEvent); + return newEvent; + } + return event; + }]; + } + return self; +} + +- (void)layout +{ + [super layout]; + [self fixupLayoutWithAnimation:NO]; +} + +- (BOOL)wantsUpdateLayer { return YES; } + +- (void)updateLayer +{ + self.layer.backgroundColor = self.tablineFillFgColor.CGColor; +} + +- (void)viewDidChangeEffectiveAppearance +{ + for (MMTab *tab in _tabs) tab.state = tab.state; +} + +#pragma mark - Accessors + +- (NSInteger)numberOfTabs +{ + return _tabs.count; +} + +- (NSInteger)optimumTabWidth +{ + return _optimumTabWidth ?: OptimumTabWidth; +} + +- (NSInteger)minimumTabWidth +{ + return _minimumTabWidth ?: MinimumTabWidth; +} + +- (void)setShowsAddTabButton:(BOOL)showsAddTabButton +{ + // showsAddTabButton: + // The trailing constraint is a 5pt margin. + // !showsAddTabButton: + // The trailing constraint is a negative margin so the add + // button is clipped out of the right side of the view. The + // amount of negative margin is the width of the button plus + // 5 to account for the margin between the scroll view and + // the button plus the shadow blur radius of each tab (see + // -drawRect: in MMTab.m). + if (_showsAddTabButton != showsAddTabButton) { + _showsAddTabButton = showsAddTabButton; + _addTabButtonTrailingConstraint.constant = showsAddTabButton ? 5 : -(NSWidth(_addTabButton.frame) + 5 + MMTabShadowBlurRadius); + } +} + +- (void)setShowsTabScrollButtons:(BOOL)showsTabScrollButtons +{ + // showsTabScrollButtons: + // The leading constraint is a 5pt margin. + // !showsTabScrollButtons: + // The leading constraint is a negative margin so the scroll + // buttons are clipped out of the left side of the view. The + // amount of the negative margin is the width of each button + // plus 5 to account for the margin between the buttons and + // the scroll view plus the shadow blur radius of each tab + // (see -drawRect: in MMTab.m). + if (_showsTabScrollButtons != showsTabScrollButtons) { + _showsTabScrollButtons = showsTabScrollButtons; + _tabScrollButtonsLeadingConstraint.constant = showsTabScrollButtons ? 5 : -((NSWidth(_leftScrollButton.frame) * 2) + 5 + MMTabShadowBlurRadius); + } +} + +- (NSColor *)tablineBgColor +{ + return _tablineBgColor ?: isDarkMode(self.effectiveAppearance) + ? [NSColor colorWithWhite:0.2 alpha:1] + : [NSColor colorWithWhite:0.8 alpha:1]; +} + +- (void)setTablineBgColor:(NSColor *)color +{ + _tablineBgColor = color; + for (MMTab *tab in _tabs) tab.state = tab.state; +} + +- (NSColor *)tablineFgColor +{ + return _tablineFgColor ?: NSColor.disabledControlTextColor; +} + +- (void)setTablineFgColor:(NSColor *)color +{ + _tablineFgColor = color; + for (MMTab *tab in _tabs) tab.state = tab.state; +} + +- (NSColor *)tablineSelBgColor +{ + return _tablineSelBgColor ?: isDarkMode(self.effectiveAppearance) + ? [NSColor colorWithWhite:0.4 alpha:1] + : NSColor.whiteColor; +} + +- (void)setTablineSelBgColor:(NSColor *)color +{ + _tablineSelBgColor = color; + for (MMTab *tab in _tabs) tab.state = tab.state; +} + +- (NSColor *)tablineSelFgColor +{ + return _tablineSelFgColor ?: NSColor.controlTextColor; +} + +- (void)setTablineSelFgColor:(NSColor *)color +{ + _tablineSelFgColor = color; + _addTabButton.fgColor = color; + _leftScrollButton.fgColor = color; + _rightScrollButton.fgColor = color; + for (MMTab *tab in _tabs) tab.state = tab.state; +} + +- (NSColor *)tablineFillFgColor +{ + return _tablineFillFgColor ?: isDarkMode(self.effectiveAppearance) + ? [NSColor colorWithWhite:0.2 alpha:1] + : [NSColor colorWithWhite:0.8 alpha:1]; +} + +- (void)setTablineFillFgColor:(NSColor *)color +{ + _tablineFillFgColor = color; + self.needsDisplay = YES; +} + +- (NSInteger)addTabAtEnd +{ + return [self addTabAtIndex:(_tabs.count ? _tabs.count : 0)]; +} + +- (NSInteger)addTabAfterSelectedTab +{ + return [self addTabAtIndex:(_tabs.count ? _selectedTabIndex + 1 : 0)]; +} + +- (NSInteger)addTabAtIndex:(NSInteger)index +{ + if (!self.superview || index > _tabs.count) return NSNotFound; + + TabWidth t = [self tabWidthForTabs:_tabs.count + 1]; + NSRect frame = _tabsContainer.bounds; + frame.size.width = index == _tabs.count ? t.width + t.remainder : t.width; + frame.origin.x = index ? index * (t.width - TabOverlap) : 0; + MMTab *newTab = [[MMTab alloc] initWithFrame:frame tabline:self]; + + [_tabs insertObject:newTab atIndex:index]; + [_tabsContainer addSubview:newTab]; + + [self selectTabAtIndex:index]; + [self fixupLayoutWithAnimation:YES]; + [self fixupCloseButtons]; + /* Let MacVim handle scrolling to selected tab. + [self scrollTabToVisibleAtIndex:_selectedTabIndex]; */ + [self evaluateHoverStateForMouse:[self.window mouseLocationOutsideOfEventStream]]; + + return index; +} + +- (void)closeTab:(MMTab *)tab force:(BOOL)force layoutImmediately:(BOOL)layoutImmediately +{ + NSInteger index = [_tabs indexOfObject:tab]; + if (!force && [self.delegate respondsToSelector:@selector(tabline:shouldCloseTabAtIndex:)]) { + if (![self.delegate tabline:self shouldCloseTabAtIndex:index]) return; + } + if (index != NSNotFound) { + CGFloat w = NSWidth(tab.frame) - TabOverlap; + [tab removeFromSuperview]; + for (NSInteger i = index + 1; i < _tabs.count; i++) { + MMTab *tv = _tabs[i]; + NSRect frame = tv.frame; + frame.origin.x -= w; + tv.animator.frame = frame; + } + [_tabs removeObject:tab]; + if (index <= _selectedTabIndex) { + if (index < _selectedTabIndex || index > _tabs.count - 1) { + [self selectTabAtIndex:_selectedTabIndex - 1]; + } + else { + [self selectTabAtIndex:_selectedTabIndex]; + } + } + [self fixupCloseButtons]; + [self evaluateHoverStateForMouse:[self.window mouseLocationOutsideOfEventStream]]; + if (layoutImmediately) [self fixupLayoutWithAnimation:YES]; + else _pendingFixupLayout = YES; + } else { + NSLog(@"CANNOT FIND TAB TO REMOVE"); + } +} + +- (void)selectTabAtIndex:(NSInteger)index +{ + if (_selectedTabIndex <= _tabs.count - 1) { + _tabs[_selectedTabIndex].state = MMTabStateUnselected; + } + if (index <= _tabs.count - 1) { + _selectedTabIndex = index; + _tabs[_selectedTabIndex].state = MMTabStateSelected; + } + else { + NSLog(@"TRIED TO SELECT OUT OF BOUNDS: %ld/%ld", index, _tabs.count - 1); + } + _selectedTab = _tabs[_selectedTabIndex]; + [self fixupTabZOrder]; +} + +- (MMTab *)tabAtIndex:(NSInteger)index +{ + if (index >= _tabs.count) { + [NSException raise:NSRangeException format:@"Index (%lu) beyond bounds (%lu)", index, _tabs.count - 1]; + } + return _tabs[index]; +} + +- (void)setTablineSelBackground:(NSColor *)back foreground:(NSColor *)fore +{ + // Reset to default tabline colors if user doesn't want auto-generated ones. + if ([NSUserDefaults.standardUserDefaults boolForKey:@"MMDefaultTablineColors"]) { + self.tablineBgColor = nil; + self.tablineFgColor = nil; + self.tablineSelBgColor = nil; + self.tablineSelFgColor = nil; + self.tablineFillFgColor = nil; + return; + } + + // Set the colors for the tabline based on the default background and + // foreground colors. Calculate brightness according to a formula from + // the W3C that gives brightness as the eye perceives it. Then lighten + // or darken the default colors based on whether brightness is greater + // than 50% to achieve good visual contrast. + // www.w3.org/WAI/ER/WD-AERT/#color-contrast + CGFloat r, g, b, brightness; + [back getRed:&r green:&g blue:&b alpha:NULL]; + brightness = r * 0.299 + g * 0.114 + b * 0.587; + + self.tablineSelBgColor = back; + + self.tablineSelFgColor = (brightness > 0.5) + ? [fore blendedColorWithFraction:0.6 ofColor:NSColor.blackColor] + : [fore blendedColorWithFraction:0.6 ofColor:NSColor.whiteColor]; + + self.tablineBgColor = (brightness > 0.5) + ? [back blendedColorWithFraction:0.16 ofColor:NSColor.blackColor] + : [back blendedColorWithFraction:0.13 ofColor:NSColor.whiteColor]; + + self.tablineFgColor = [self.tablineSelFgColor blendedColorWithFraction:0.5 ofColor:self.tablineBgColor]; + + self.tablineFillFgColor = (brightness > 0.5) + ? [back blendedColorWithFraction:0.25 ofColor:NSColor.blackColor] + : [back blendedColorWithFraction:0.18 ofColor:NSColor.whiteColor]; +} + +#pragma mark - Helpers + +NSComparisonResult SortTabsForZOrder(MMTab *tab1, MMTab *tab2, void *draggedTab) +{ // Z-order, highest to lowest: dragged, selected, hovered, rightmost + if (tab1 == (__bridge MMTab *)draggedTab) return NSOrderedDescending; + if (tab2 == (__bridge MMTab *)draggedTab) return NSOrderedAscending; + if (tab1.state == MMTabStateSelected) return NSOrderedDescending; + if (tab2.state == MMTabStateSelected) return NSOrderedAscending; + if (tab1.state == MMTabStateUnselectedHover) return NSOrderedDescending; + if (tab2.state == MMTabStateUnselectedHover) return NSOrderedAscending; + if (NSMinX(tab1.frame) < NSMinX(tab2.frame)) return NSOrderedAscending; + if (NSMinX(tab1.frame) > NSMinX(tab2.frame)) return NSOrderedDescending; + return NSOrderedSame; +} + +- (TabWidth)tabWidthForTabs:(NSInteger)numTabs +{ + // Each tab (except the first) overlaps the previous tab by TabOverlap + // points so we add TabOverlap * (numTabs - 1) to account for this. + CGFloat availableWidthForTabs = NSWidth(_scrollView.frame) + TabOverlap * (numTabs - 1); + CGFloat tabWidth = (availableWidthForTabs / numTabs); + if (tabWidth > self.optimumTabWidth) { + return (TabWidth){self.optimumTabWidth, 0}; + } + if (tabWidth < self.minimumTabWidth) { + return (TabWidth){self.minimumTabWidth, 0}; + } + // Round tabWidth down to nearest 0.5 + CGFloat f = floor(tabWidth); + tabWidth = (tabWidth - f < 0.5) ? f : f + 0.5; + return (TabWidth){tabWidth, availableWidthForTabs - tabWidth * numTabs}; +} + +- (void)fixupCloseButtons +{ + if (_tabs.count == 1) { + _tabs.firstObject.closeButtonHidden = YES; + } + else for (MMTab *tab in _tabs) { + tab.closeButtonHidden = NO; + } +} + +- (void)fixupTabZOrder +{ + [_tabsContainer sortSubviewsUsingFunction:SortTabsForZOrder context:(__bridge void *)(_draggedTab)]; +} + +- (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate +{ + if (_tabs.count == 0) return; + + TabWidth t = [self tabWidthForTabs:_tabs.count]; + for (NSInteger i = 0; i < _tabs.count; i++) { + MMTab *tab = _tabs[i]; + if (_draggedTab == tab) continue; + NSRect frame = tab.frame; + frame.size.width = i == _tabs.count - 1 ? t.width + t.remainder : t.width; + frame.origin.x = i ? i * (t.width - TabOverlap) : 0; + if (shouldAnimate) { + [NSAnimationContext runAnimationGroup:^(NSAnimationContext * _Nonnull context) { + context.allowsImplicitAnimation = YES; + tab.animator.frame = frame; + [tab layout]; + } completionHandler:nil]; + } else { + tab.frame = frame; + } + } + // _tabsContainer expands to fit tabs, is at least as wide as _scrollView. + NSRect frame = _tabsContainer.frame; + frame.size.width = t.width * _tabs.count - TabOverlap * (_tabs.count - 1); + frame.size.width = NSWidth(frame) < NSWidth(_scrollView.frame) ? NSWidth(_scrollView.frame) : NSWidth(frame); + if (shouldAnimate) _tabsContainer.animator.frame = frame; + else _tabsContainer.frame = frame; + [self updateTabScrollButtonsEnabledState]; +} + +#pragma mark - Mouse + +- (void)updateTrackingAreas +{ + [self removeTrackingArea:_trackingArea]; + _trackingArea = [[NSTrackingArea alloc] initWithRect:_scrollView.frame options:(NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | NSTrackingActiveInKeyWindow) owner:self userInfo:nil]; + [self addTrackingArea:_trackingArea]; + [super updateTrackingAreas]; +} + +- (BOOL)mouse:(NSPoint)windowLocation inTab:(MMTab *)tab +{ + // YES if windowLocation is inside _scrollview AND tab. + NSPoint location = [_scrollView convertPoint:windowLocation fromView:nil]; + if ([_scrollView mouse:location inRect:_scrollView.bounds]) { + location = [tab convertPoint:windowLocation fromView:nil]; + return [tab mouse:location inRect:tab.bounds]; + } + return NO; +} + +- (NSInteger)indexOfTabAtMouse:(NSPoint)windowLocation +{ + for (MMTab *tab in _tabs) + if ([self mouse:windowLocation inTab:tab]) + return [_tabs indexOfObject:tab]; + return NSNotFound; +} + +- (void)evaluateHoverStateForMouse:(NSPoint)locationInWindow +{ + for (MMTab *tab in _tabs) { + if ([self mouse:locationInWindow inTab:tab]) { + if (tab.state == MMTabStateUnselected) { + tab.state = MMTabStateUnselectedHover; + } + } + else if (tab.state == MMTabStateUnselectedHover) { + tab.state = MMTabStateUnselected; + } + } + [self fixupTabZOrder]; +} + +- (void)mouseExited:(NSEvent *)event +{ + for (MMTab *tab in _tabs) { + if (tab.state == MMTabStateUnselectedHover) { + tab.state = MMTabStateUnselected; + } + } + if (_pendingFixupLayout) { + _pendingFixupLayout = NO; + [self fixupLayoutWithAnimation:YES]; + } + [self fixupTabZOrder]; +} + +- (void)mouseMoved:(NSEvent *)event +{ + [self evaluateHoverStateForMouse:event.locationInWindow]; +} + +- (void)mouseDown:(NSEvent *)event +{ + _draggedTab = nil; + _initialDraggedTabIndex = _finalDraggedTabIndex = NSNotFound; + + // Select clicked tab, possibly pending delegate's approval. + for (MMTab *tab in _tabs) { + if ([self mouse:event.locationInWindow inTab:tab]) { + _draggedTab = tab; + if (tab.state != MMTabStateSelected) { + NSInteger index = [_tabs indexOfObject:tab]; + if ([self.delegate respondsToSelector:@selector(tabline:shouldSelectTabAtIndex:)]) { + if (![self.delegate tabline:self shouldSelectTabAtIndex:index]) break; + } + [self selectTabAtIndex:index]; + } + [self scrollTabToVisibleAtIndex:_selectedTabIndex]; + break; + } + } +} + +- (void)mouseUp:(NSEvent *)event +{ + _draggedTab = nil; + [self fixupLayoutWithAnimation:YES]; + [self fixupTabZOrder]; + if (_finalDraggedTabIndex != NSNotFound) [self scrollTabToVisibleAtIndex:_finalDraggedTabIndex]; + if (_initialDraggedTabIndex != NSNotFound && + _initialDraggedTabIndex != _finalDraggedTabIndex) { + if ([self.delegate respondsToSelector:@selector(tabline:didDragTab:toIndex:)]) { + [self.delegate tabline:self didDragTab:_tabs[_finalDraggedTabIndex] toIndex:_finalDraggedTabIndex]; + } + } +} + +- (void)mouseDragged:(NSEvent *)event +{ + if (!_draggedTab || _tabs.count < 2) return; + NSPoint mouse = [_tabsContainer convertPoint:event.locationInWindow fromView:nil]; + if (_initialDraggedTabIndex == NSNotFound) { + _initialDraggedTabIndex = [_tabs indexOfObject:_draggedTab]; + _xOffsetForDrag = mouse.x - _draggedTab.frame.origin.x; + } + [_tabsContainer autoscroll:event]; + [self fixupTabZOrder]; + [_draggedTab setFrameOrigin:NSMakePoint(mouse.x - _xOffsetForDrag, 0)]; + [_tabs sortWithOptions:NSSortStable usingComparator:^NSComparisonResult(MMTab *t1, MMTab *t2) { + if (NSMinX(t1.frame) <= NSMinX(t2.frame)) return NSOrderedAscending; + if (NSMinX(t1.frame) > NSMinX(t2.frame)) return NSOrderedDescending; + return NSOrderedSame; + }]; + _selectedTabIndex = [_tabs indexOfObject:_selectedTab]; + _finalDraggedTabIndex = [_tabs indexOfObject:_draggedTab]; + [self fixupLayoutWithAnimation:YES]; +} + +#pragma mark - Scroll + +- (void)didScroll:(NSNotification *)note +{ + [self evaluateHoverStateForMouse:[self.window mouseLocationOutsideOfEventStream]]; + [self updateTabScrollButtonsEnabledState]; +} + +- (void)updateTabScrollButtonsEnabledState +{ + // Enable scroll buttons if there is scrollable content + // on either side of _scrollView. + NSRect clipBounds = _scrollView.contentView.bounds; + if (NSWidth(_tabsContainer.frame) <= NSWidth(clipBounds)) { + _leftScrollButton.enabled = NO; + _rightScrollButton.enabled = NO; + } else { + _leftScrollButton.enabled = clipBounds.origin.x > 0; + _rightScrollButton.enabled = clipBounds.origin.x + NSWidth(clipBounds) < NSMaxX(_tabsContainer.frame); + } +} + +- (void)scrollTabToVisibleAtIndex:(NSInteger)index +{ + if (_tabs.count == 0) return; + + // Get the amount of time elapsed between the previous invocation + // of this method and now. Use this elapsed time to set the animation + // duration such that rapid invocations of this method result in + // faster animations. For example, the user might hold down the tab + // scrolling buttons (causing them to repeatedly fire) or they might + // rapidly click them. +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 + static NSTimeInterval lastTime = 0; + struct timespec t; + clock_gettime(CLOCK_MONOTONIC, &t); + NSTimeInterval currentTime = t.tv_sec + t.tv_nsec * 1.e-9; + NSTimeInterval elapsedTime = currentTime - lastTime; + lastTime = currentTime; +#else + // clock_gettime was only added in macOS 10.12. Just use a fixed value + // here. No need to find an alternative API for legacy macOS versions. + NSTimeInterval elapsedTime = 0.1; +#endif + + NSRect tabFrame = _tabs[index].frame; + NSRect clipBounds = _scrollView.contentView.bounds; + // One side or the other of the selected tab is clipped. + if (!NSContainsRect(clipBounds, tabFrame)) { + if (NSMinX(tabFrame) > NSMinX(clipBounds)) { + // Right side of the selected tab is clipped. + clipBounds.origin.x = NSMaxX(tabFrame) - NSWidth(clipBounds); + } else { + // Left side of the selected tab is clipped. + clipBounds.origin.x = tabFrame.origin.x; + } + [NSAnimationContext beginGrouping]; + [NSAnimationContext.currentContext setDuration:elapsedTime < 0.2 ? 0.05 : 0.2]; + _scrollView.contentView.animator.bounds = clipBounds; + [NSAnimationContext endGrouping]; + } +} + +- (void)scrollLeftOneTab +{ + NSRect clipBounds = _scrollView.contentView.bounds; + for (NSInteger i = _tabs.count - 1; i >= 0; i--) { + NSRect tabFrame = _tabs[i].frame; + if (!NSContainsRect(clipBounds, tabFrame)) { + if (NSMinX(tabFrame) < NSMinX(clipBounds)) { + [self scrollTabToVisibleAtIndex:i]; + break; + } + } + } +} + +- (void)scrollRightOneTab +{ + NSRect clipBounds = _scrollView.contentView.bounds; + for (NSInteger i = 0; i < _tabs.count; i++) { + NSRect tabFrame = _tabs[i].frame; + if (!NSContainsRect(clipBounds, tabFrame)) { + if (NSMaxX(tabFrame) > NSMaxX(clipBounds)) { + [self scrollTabToVisibleAtIndex:i]; + break; + } + } + } +} + + +#pragma mark - Drag and drop + +- (NSDragOperation)draggingEntered:(id)dragInfo +{ + [self evaluateHoverStateForMouse:dragInfo.draggingLocation]; + if (self.delegate && [self.delegate respondsToSelector:@selector(tabline:draggingEntered:forTabAtIndex:)]) { + NSInteger index = [self indexOfTabAtMouse:dragInfo.draggingLocation]; + return [self.delegate tabline:self draggingEntered:dragInfo forTabAtIndex:index]; + } + return NSDragOperationNone; +} + +- (NSDragOperation)draggingUpdated:(id)dragInfo +{ + return [self draggingEntered:dragInfo]; +} + +- (void)draggingExited:(id)dragInfo +{ + [self evaluateHoverStateForMouse:dragInfo.draggingLocation]; +} + +- (BOOL)performDragOperation:(id)dragInfo +{ + if (self.delegate && [self.delegate respondsToSelector:@selector(tabline:performDragOperation:forTabAtIndex:)]) { + NSInteger index = [self indexOfTabAtMouse:dragInfo.draggingLocation]; + return [self.delegate tabline:self performDragOperation:dragInfo forTabAtIndex:index]; + } + return NO; +} + +@end diff --git a/src/MacVim/MMVimController.h b/src/MacVim/MMVimController.h index 0d99780019..4b16e08253 100644 --- a/src/MacVim/MMVimController.h +++ b/src/MacVim/MMVimController.h @@ -74,7 +74,7 @@ - (void)cleanup; - (void)dropFiles:(NSArray *)filenames forceOpen:(BOOL)force; - (void)file:(NSString *)filename draggedToTabAtIndex:(NSUInteger)tabIndex; -- (void)filesDraggedToTabBar:(NSArray *)filenames; +- (void)filesDraggedToTabline:(NSArray *)filenames; - (void)dropString:(NSString *)string; - (void)appearanceChanged:(int)flag; diff --git a/src/MacVim/MMVimController.m b/src/MacVim/MMVimController.m index a1ffcc2897..df12bfa0f4 100644 --- a/src/MacVim/MMVimController.m +++ b/src/MacVim/MMVimController.m @@ -383,7 +383,7 @@ - (void)file:(NSString *)filename draggedToTabAtIndex:(NSUInteger)tabIndex // This is called when a file is dragged on top of the tab bar but not a // particular tab (e.g. the new tab button). We will open the file list similar // to drag-and-dropped files. -- (void)filesDraggedToTabBar:(NSArray *)filenames +- (void)filesDraggedToTabline:(NSArray *)filenames { filenames = normalizeFilenames(filenames); ASLogInfo(@"%@", filenames); @@ -714,13 +714,13 @@ - (void)handleMessage:(int)msgid data:(NSData *)data break; case ShowTabBarMsgID: { - [windowController showTabBar:YES]; + [windowController showTabline:YES]; [self sendMessage:BackingPropertiesChangedMsgID data:nil]; } break; case HideTabBarMsgID: { - [windowController showTabBar:NO]; + [windowController showTabline:NO]; [self sendMessage:BackingPropertiesChangedMsgID data:nil]; } break; diff --git a/src/MacVim/MMVimView.h b/src/MacVim/MMVimView.h index ba65674645..eac3d4da39 100644 --- a/src/MacVim/MMVimView.h +++ b/src/MacVim/MMVimView.h @@ -12,17 +12,17 @@ -@class PSMTabBarControl; +@class MMTabline; +@class MMTab; @class MMTextView; @class MMScroller; @class MMVimController; @interface MMVimView : NSView { - PSMTabBarControl *tabBarControl; - NSTabView *tabView; + MMTabline *tabline; + MMTab *tabToClose; MMVimController *vimController; - BOOL vimTaskSelectedTab; MMTextView *textView; NSMutableArray *scrollbars; } @@ -41,11 +41,11 @@ - (NSSize)constrainRows:(int *)r columns:(int *)c toSize:(NSSize)size; - (void)setDesiredRows:(int)r columns:(int)c; -- (PSMTabBarControl *)tabBarControl; +- (MMTabline *)tabline; - (IBAction)addNewTab:(id)sender; - (void)updateTabsWithData:(NSData *)data; - (void)selectTabWithIndex:(int)idx; -- (NSTabViewItem *)addNewTabViewItem; +- (MMTab *)addNewTab; - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type; - (BOOL)destroyScrollbarWithIdentifier:(int32_t)ident; diff --git a/src/MacVim/MMVimView.m b/src/MacVim/MMVimView.m index 0ce0167c66..2a88fa9616 100644 --- a/src/MacVim/MMVimView.m +++ b/src/MacVim/MMVimView.m @@ -24,7 +24,7 @@ #import "MMVimController.h" #import "MMVimView.h" #import "MMWindowController.h" -#import +#import "MMTabline.h" @@ -50,16 +50,14 @@ - (void)setRange:(NSRange)newRange; @end -@interface MMVimView (Private) +@interface MMVimView (Private) - (BOOL)bottomScrollbarVisible; - (BOOL)leftScrollbarVisible; - (BOOL)rightScrollbarVisible; - (void)placeScrollbars; -- (NSUInteger)representedIndexOfTabViewItem:(NSTabViewItem *)tvi; - (MMScroller *)scrollbarForIdentifier:(int32_t)ident index:(unsigned *)idx; - (NSSize)vimViewSizeForTextViewSize:(NSSize)textViewSize; - (NSRect)textViewRectForVimViewSize:(NSSize)contentSize; -- (NSTabView *)tabView; - (void)frameSizeMayHaveChanged:(BOOL)keepGUISize; @end @@ -109,61 +107,21 @@ - (MMVimView *)initWithFrame:(NSRect)frame [textView setAutoresizingMask:NSViewNotSizable]; [self addSubview:textView]; - // Create the tab view (which is never visible, but the tab bar control - // needs it to function). - tabView = [[NSTabView alloc] initWithFrame:NSZeroRect]; - - // Create the tab bar control (which is responsible for actually - // drawing the tabline and tabs). - NSRect tabFrame = { { 0, frame.size.height - kPSMTabBarControlHeight }, - { frame.size.width, kPSMTabBarControlHeight } }; - tabBarControl = [[PSMTabBarControl alloc] initWithFrame:tabFrame]; - - [tabView setDelegate:tabBarControl]; - - [tabBarControl setTabView:tabView]; - [tabBarControl setDelegate:self]; - [tabBarControl setHidden:YES]; - - if (shouldUseYosemiteTabBarStyle() || shouldUseMojaveTabBarStyle()) { - CGFloat screenWidth = [[NSScreen mainScreen] frame].size.width; - int tabMaxWidth = (int)[ud integerForKey:MMTabMaxWidthKey]; - if (tabMaxWidth == 0) - tabMaxWidth = (int)screenWidth; - int tabOptimumWidth = (int)[ud integerForKey:MMTabOptimumWidthKey]; - if (tabOptimumWidth == 0) - tabOptimumWidth = (int)screenWidth; - - NSString* tabStyleName = shouldUseMojaveTabBarStyle() ? @"Mojave" : @"Yosemite"; - - [tabBarControl setStyleNamed:tabStyleName]; - [tabBarControl setCellMinWidth:(int)[ud integerForKey:MMTabMinWidthKey]]; - [tabBarControl setCellMaxWidth:tabMaxWidth]; - [tabBarControl setCellOptimumWidth:tabOptimumWidth]; - } else { - [tabBarControl setCellMinWidth:(int)[ud integerForKey:MMTabMinWidthKey]]; - [tabBarControl setCellMaxWidth:(int)[ud integerForKey:MMTabMaxWidthKey]]; - [tabBarControl setCellOptimumWidth: - (int)[ud integerForKey:MMTabOptimumWidthKey]]; - } - - [tabBarControl setShowAddTabButton:[ud boolForKey:MMShowAddTabButtonKey]]; - [[tabBarControl addTabButton] setTarget:self]; - [[tabBarControl addTabButton] setAction:@selector(addNewTab:)]; - [tabBarControl setAllowsDragBetweenWindows:NO]; - [tabBarControl registerForDraggedTypes:[NSArray arrayWithObject:getPasteboardFilenamesType()]]; - - [tabBarControl setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin]; - - //[tabBarControl setPartnerView:textView]; + // Create the tabline which is responsible for drawing the tabline and tabs. + NSRect tablineFrame = {{0, frame.size.height - MMTablineHeight}, {frame.size.width, MMTablineHeight}}; + tabline = [[MMTabline alloc] initWithFrame:tablineFrame]; + tabline.autoresizingMask = NSViewWidthSizable | NSViewMinYMargin; + tabline.delegate = self; + tabline.hidden = YES; + tabline.showsAddTabButton = [ud boolForKey:MMShowAddTabButtonKey]; + tabline.showsTabScrollButtons = [ud boolForKey:MMShowTabScrollButtonsKey]; + tabline.optimumTabWidth = [ud integerForKey:MMTabOptimumWidthKey]; + tabline.minimumTabWidth = [ud integerForKey:MMTabMinWidthKey]; + tabline.addTabButton.target = self; + tabline.addTabButton.action = @selector(addNewTab:); + [tabline registerForDraggedTypes:@[getPasteboardFilenamesType()]]; + [self addSubview:tabline]; - // tab bar resizing only works if awakeFromNib is called (that's where - // the NSViewFrameDidChangeNotification callback is installed). Sounds like - // a PSMTabBarControl bug, let's live with it for now. - [tabBarControl awakeFromNib]; - - [self addSubview:tabBarControl]; - return self; } @@ -171,8 +129,7 @@ - (void)dealloc { ASLogDebug(@""); - [tabBarControl release]; tabBarControl = nil; - [tabView release]; tabView = nil; + [tabline release]; [scrollbars release]; scrollbars = nil; // HACK! The text storage is the principal owner of the text system, but we @@ -250,37 +207,24 @@ - (MMTextView *)textView return textView; } -- (PSMTabBarControl *)tabBarControl +- (MMTabline *)tabline { - return tabBarControl; + return tabline; } - (void)cleanup { vimController = nil; - // NOTE! There is a bug in PSMTabBarControl in that it retains the delegate - // so reset the delegate here, otherwise the delegate may never get - // released. - [tabView setDelegate:nil]; - [tabBarControl setDelegate:nil]; - [tabBarControl setTabView:nil]; [[self window] setDelegate:nil]; - // NOTE! There is another bug in PSMTabBarControl where the control is not - // removed as an observer, so remove it here (failing to remove an observer - // may lead to very strange bugs). - [[NSNotificationCenter defaultCenter] removeObserver:tabBarControl]; - - [tabBarControl removeFromSuperviewWithoutNeedingDisplay]; + [tabline removeFromSuperviewWithoutNeedingDisplay]; [textView removeFromSuperviewWithoutNeedingDisplay]; for (NSUInteger i = 0, count = scrollbars.count; i < count; ++i) { MMScroller *sb = [scrollbars objectAtIndex:i]; [sb removeFromSuperviewWithoutNeedingDisplay]; } - - [tabView removeAllTabViewItems]; } - (NSSize)desiredSize @@ -315,16 +259,35 @@ - (void)updateTabsWithData:(NSData *)data const void *p = [data bytes]; const void *end = p + [data length]; int tabIdx = 0; + BOOL didCloseTab = NO; + + // Count how many tabs Vim has and compare to the number MacVim's tabline has. + const void *q = [data bytes]; + int vimNumberOfTabs = 0; + q += sizeof(int); // skip over current tab index + while (q < end) { + int infoCount = *((int*)q); q += sizeof(int); + for (unsigned i = 0; i < infoCount; ++i) { + int length = *((int*)q); q += sizeof(int); + if (length <= 0) continue; + q += length; + if (i == MMTabLabel) ++vimNumberOfTabs; + } + } + // Close the specific tab where the user clicked the close button. + if (tabToClose && vimNumberOfTabs == tabline.numberOfTabs - 1) { + [tabline closeTab:tabToClose force:YES layoutImmediately:NO]; + tabToClose = nil; + didCloseTab = YES; + } // HACK! Current tab is first in the message. This way it is not // necessary to guess which tab should be the selected one (this can be // problematic for instance when new tabs are created). int curtabIdx = *((int*)p); p += sizeof(int); - NSArray *tabViewItems = [[self tabBarControl] representedTabViewItems]; - while (p < end) { - NSTabViewItem *tvi = nil; + MMTab *tv; //int wincount = *((int*)p); p += sizeof(int); int infoCount = *((int*)p); p += sizeof(int); @@ -342,16 +305,14 @@ - (void)updateTabsWithData:(NSData *)data switch (i) { case MMTabLabel: // Set the label of the tab, adding a new tab when needed. - tvi = [[self tabView] numberOfTabViewItems] <= tabIdx - ? [self addNewTabViewItem] - : [tabViewItems objectAtIndex:tabIdx]; - [tvi setLabel:val]; + tv = tabline.numberOfTabs <= tabIdx + ? [self addNewTab] + : [tabline tabAtIndex:tabIdx]; + tv.title = val; ++tabIdx; break; case MMTabToolTip: - if (tvi) - [[self tabBarControl] setToolTip:val - forTabViewItem:tvi]; + if (tv) tv.toolTip = val; break; default: ASLogWarn(@"Unknown tab info for index: %d", i); @@ -361,59 +322,48 @@ - (void)updateTabsWithData:(NSData *)data } } - // Remove unused tabs from the NSTabView. Note that when a tab is closed - // the NSTabView will automatically select another tab, but we want Vim to - // take care of which tab to select so set the vimTaskSelectedTab flag to - // prevent the tab selection message to be passed on to the VimTask. - vimTaskSelectedTab = YES; - for (NSInteger i = [self tabView].numberOfTabViewItems-1; i >= tabIdx; --i) { - id tvi = [tabViewItems objectAtIndex:i]; - [[self tabView] removeTabViewItem:tvi]; + // Remove unused tabs from the tabline. + long i, count = tabline.numberOfTabs; + for (i = count-1; i >= tabIdx; --i) { + MMTab *tv = [tabline tabAtIndex:i]; + [tabline closeTab:tv force:YES layoutImmediately:YES]; } - vimTaskSelectedTab = NO; [self selectTabWithIndex:curtabIdx]; + // It would be better if we could scroll to the selected tab only if it + // reflected user intent. Presumably, the user expects MacVim to scroll + // to the selected tab if they: added a tab, clicked a partially hidden + // tab, or navigated to a tab with a keyboard command. Since we don't + // have this kind of information, we always scroll to selected unless + // the window isn't key or we think the user is in the process of + // closing a tab by clicking its close button. Doing it this way instead + // of using a signal of explicit user intent is probably too aggressive. + if (self.window.isKeyWindow && !tabToClose && !didCloseTab) { + [tabline scrollTabToVisibleAtIndex:curtabIdx]; + } } - (void)selectTabWithIndex:(int)idx { - NSArray *tabViewItems = [[self tabBarControl] representedTabViewItems]; - if (idx < 0 || idx >= [tabViewItems count]) { + if (idx < 0 || idx >= tabline.numberOfTabs) { ASLogWarn(@"No tab with index %d exists.", idx); return; } - // Do not try to select a tab if already selected. - NSTabViewItem *tvi = [tabViewItems objectAtIndex:idx]; - if (tvi != [[self tabView] selectedTabViewItem]) { - vimTaskSelectedTab = YES; - [[self tabView] selectTabViewItem:tvi]; - vimTaskSelectedTab = NO; - + if (idx != tabline.selectedTabIndex) { + [tabline selectTabAtIndex:idx]; // We might need to change the scrollbars that are visible. self.pendingPlaceScrollbars = YES; } } -- (NSTabViewItem *)addNewTabViewItem +- (MMTab *)addNewTab { // NOTE! A newly created tab is not by selected by default; Vim decides // which tab should be selected at all times. However, the AppKit will // automatically select the first tab added to a tab view. - - // The documentation claims initWithIdentifier can be given a nil identifier, but the API itself - // is decorated such that doing so produces a warning, so the tab count is used as identifier. - NSInteger identifier = [[self tabView] numberOfTabViewItems]; - NSTabViewItem *tvi = [[NSTabViewItem alloc] initWithIdentifier:[NSNumber numberWithInt:(int)identifier]]; - - // NOTE: If this is the first tab it will be automatically selected. - vimTaskSelectedTab = YES; - [[self tabView] addTabViewItem:tvi]; - vimTaskSelectedTab = NO; - - [tvi autorelease]; - - return tvi; + NSUInteger index = [tabline addTabAtEnd]; + return [tabline tabAtIndex:index]; } - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type @@ -508,6 +458,8 @@ - (void)finishPlaceScrollbars - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore { [textView setDefaultColorsBackground:back foreground:fore]; + + [tabline setTablineSelBackground:back foreground:fore]; CALayer *backedLayer = [self layer]; if (backedLayer) { @@ -527,91 +479,67 @@ - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore } -// -- PSMTabBarControl delegate ---------------------------------------------- +// -- MMTablineDelegate ---------------------------------------------- -- (BOOL)tabView:(NSTabView *)theTabView shouldSelectTabViewItem: - (NSTabViewItem *)tabViewItem +- (BOOL)tabline:(MMTabline *)tabline shouldSelectTabAtIndex:(NSUInteger)index { - // NOTE: It would be reasonable to think that 'shouldSelect...' implies - // that this message only gets sent when the user clicks the tab. - // Unfortunately it is not so, which is why we need the - // 'vimTaskSelectedTab' flag. - // - // HACK! The selection message should not be propagated to Vim if Vim - // selected the tab (e.g. as opposed the user clicking the tab). The - // delegate method has no way of knowing who initiated the selection so a - // flag is set when Vim initiated the selection. - if (!vimTaskSelectedTab) { - // Propagate the selection message to Vim. - NSUInteger idx = [self representedIndexOfTabViewItem:tabViewItem]; - if (NSNotFound != idx) { - int i = (int)idx; // HACK! Never more than MAXINT tabs?! - NSData *data = [NSData dataWithBytes:&i length:sizeof(int)]; - [vimController sendMessage:SelectTabMsgID data:data]; - } + // Propagate the selection message to Vim. + if (NSNotFound != index) { + int i = (int)index; // HACK! Never more than MAXINT tabs?! + NSData *data = [NSData dataWithBytes:&i length:sizeof(int)]; + [vimController sendMessage:SelectTabMsgID data:data]; } - - // Unless Vim selected the tab, return NO, and let Vim decide if the tab - // should get selected or not. - return vimTaskSelectedTab; + // Let Vim decide whether to select the tab or not. + return NO; } -- (BOOL)tabView:(NSTabView *)theTabView shouldCloseTabViewItem: - (NSTabViewItem *)tabViewItem +- (BOOL)tabline:(MMTabline *)tabline shouldCloseTabAtIndex:(NSUInteger)index { + if (index >= 0 && index < tabline.numberOfTabs - 1) { + tabToClose = [tabline tabAtIndex:index]; + } // HACK! This method is only called when the user clicks the close button // on the tab. Instead of letting the tab bar close the tab, we return NO // and pass a message on to Vim to let it handle the closing. - NSUInteger idx = [self representedIndexOfTabViewItem:tabViewItem]; - int i = (int)idx; // HACK! Never more than MAXINT tabs?! + int i = (int)index; // HACK! Never more than MAXINT tabs?! NSData *data = [NSData dataWithBytes:&i length:sizeof(int)]; [vimController sendMessage:CloseTabMsgID data:data]; - return NO; } -- (void)tabView:(NSTabView *)theTabView didDragTabViewItem: - (NSTabViewItem *)tabViewItem toIndex:(int)idx +- (void)tabline:(MMTabline *)tabline didDragTab:(MMTab *)tab toIndex:(NSUInteger)index { NSMutableData *data = [NSMutableData data]; - [data appendBytes:&idx length:sizeof(int)]; - + [data appendBytes:&index length:sizeof(int)]; [vimController sendMessage:DraggedTabMsgID data:data]; } -- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl - draggingEntered:(id )sender - forTabAtIndex:(NSUInteger)tabIndex +- (NSDragOperation)tabline:(MMTabline *)tabline draggingEntered:(id )dragInfo forTabAtIndex:(NSUInteger)index { - NSPasteboard *pb = [sender draggingPasteboard]; - return [[pb types] containsObject:getPasteboardFilenamesType()] + return [dragInfo.draggingPasteboard.types containsObject:getPasteboardFilenamesType()] ? NSDragOperationCopy : NSDragOperationNone; } -- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl - performDragOperation:(id )sender - forTabAtIndex:(NSUInteger)tabIndex +- (BOOL)tabline:(MMTabline *)tabline performDragOperation:(id )dragInfo forTabAtIndex:(NSUInteger)index { - NSPasteboard *pb = [sender draggingPasteboard]; + NSPasteboard *pb = dragInfo.draggingPasteboard; NSArray* filenames = extractPasteboardFilenames(pb); if (filenames == nil || filenames.count == 0) return NO; - if (tabIndex != NSNotFound) { + if (index != NSNotFound) { // If dropping on a specific tab, only open one file - [vimController file:[filenames objectAtIndex:0] - draggedToTabAtIndex:tabIndex]; + [vimController file:[filenames objectAtIndex:0] draggedToTabAtIndex:index]; } else { // Files were dropped on empty part of tab bar; open them all - [vimController filesDraggedToTabBar:filenames]; + [vimController filesDraggedToTabline:filenames]; } return YES; } - // -- NSView customization --------------------------------------------------- @@ -839,12 +767,6 @@ - (void)placeScrollbars } } -- (NSUInteger)representedIndexOfTabViewItem:(NSTabViewItem *)tvi -{ - NSArray *tabViewItems = [[self tabBarControl] representedTabViewItems]; - return [tabViewItems indexOfObject:tvi]; -} - - (MMScroller *)scrollbarForIdentifier:(int32_t)ident index:(unsigned *)idx { for (NSUInteger i = 0, count = scrollbars.count; i < count; ++i) { @@ -867,8 +789,8 @@ - (NSSize)vimViewSizeForTextViewSize:(NSSize)textViewSize CGFloat scrollerWidth = [NSScroller scrollerWidth]; #endif - if (![[self tabBarControl] isHidden]) - size.height += [[self tabBarControl] frame].size.height; + if (!tabline.isHidden) + size.height += NSHeight(tabline.frame); if ([self bottomScrollbarVisible]) size.height += scrollerWidth; @@ -889,8 +811,8 @@ - (NSRect)textViewRectForVimViewSize:(NSSize)contentSize CGFloat scrollerWidth = [NSScroller scrollerWidth]; #endif - if (![[self tabBarControl] isHidden]) - rect.size.height -= [[self tabBarControl] frame].size.height; + if (!tabline.isHidden) + rect.size.height -= NSHeight(tabline.frame); if ([self bottomScrollbarVisible]) { rect.size.height -= scrollerWidth; @@ -906,11 +828,6 @@ - (NSRect)textViewRectForVimViewSize:(NSSize)contentSize return rect; } -- (NSTabView *)tabView -{ - return tabView; -} - - (void)frameSizeMayHaveChanged:(BOOL)keepGUISize { // NOTE: Whenever a call is made that may have changed the frame size we diff --git a/src/MacVim/MMWindowController.h b/src/MacVim/MMWindowController.h index 6aa28e2852..8d4605abe8 100644 --- a/src/MacVim/MMWindowController.h +++ b/src/MacVim/MMWindowController.h @@ -91,7 +91,7 @@ - (void)setWideFont:(NSFont *)font; - (void)refreshFonts; - (void)processInputQueueDidFinish; -- (void)showTabBar:(BOOL)on; +- (void)showTabline:(BOOL)on; - (void)showToolbar:(BOOL)on size:(int)size mode:(int)mode; - (void)setMouseShape:(int)shape; - (void)adjustLinespace:(int)linespace; diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 775d51da70..e52896ee85 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -71,7 +71,6 @@ #import "MMWindow.h" #import "MMWindowController.h" #import "Miscellaneous.h" -#import // These have to be the same as in option.h @@ -86,7 +85,6 @@ - (void)resizeWindowToFitContentSize:(NSSize)contentSize keepOnScreen:(BOOL)onScreen; - (NSSize)constrainContentSizeToScreenSize:(NSSize)contentSize; - (NSRect)constrainFrame:(NSRect)frame; -- (NSTabViewItem *)addNewTabViewItem; - (BOOL)askBackendForSelectedText:(NSPasteboard *)pb; - (void)updateTablineSeparator; - (void)hideTablineSeparator:(BOOL)hide; @@ -96,8 +94,6 @@ - (BOOL)maximizeWindow:(int)options; - (void)applicationDidChangeScreenParameters:(NSNotification *)notification; - (void)enterNativeFullScreen; - (void)processAfterWindowPresentedQueue; -+ (NSString *)tabBarStyleForUnified; -+ (NSString *)tabBarStyleForMetal; @end @@ -336,7 +332,7 @@ - (void)openWindow // presentWindow: but must carefully check dependencies on 'setupDone' // flag. - [self addNewTabViewItem]; + [vimView addNewTab]; setupDone = YES; } @@ -457,7 +453,7 @@ - (void)setTextDimensionsWithRows:(int)rows columns:(int)cols isLive:(BOOL)live // for example if 'showtabline=2'). // TODO: Store window pixel dimensions instead of rows/columns? int autosaveRows = rows; - if (![[vimView tabBarControl] isHidden]) + if (![[vimView tabline] isHidden]) ++autosaveRows; NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; @@ -878,9 +874,9 @@ - (void)processInputQueueDidFinish } } -- (void)showTabBar:(BOOL)on +- (void)showTabline:(BOOL)on { - [[vimView tabBarControl] setHidden:!on]; + [[vimView tabline] setHidden:!on]; [self updateTablineSeparator]; shouldMaximizeWindow = YES; } @@ -1864,11 +1860,6 @@ - (NSRect)constrainFrame:(NSRect)frame return [decoratedWindow frameRectForContentRect:contentRect]; } -- (NSTabViewItem *)addNewTabViewItem -{ - return [vimView addNewTabViewItem]; -} - /// Ask Vim to fill in the pasteboard with the currently selected text in visual mode. - (BOOL)askBackendForSelectedText:(NSPasteboard *)pb { @@ -1895,7 +1886,7 @@ - (BOOL)askBackendForSelectedText:(NSPasteboard *)pb - (void)updateTablineSeparator { - BOOL tabBarVisible = ![[vimView tabBarControl] isHidden]; + BOOL tablineVisible = ![[vimView tabline] isHidden]; BOOL toolbarHidden = [decoratedWindow toolbar] == nil; BOOL hideSeparator = NO; @@ -1914,7 +1905,7 @@ - (void)updateTablineSeparator // modern macOS versions. hideSeparator = YES; } else { - if (fullScreenEnabled || tabBarVisible) + if (fullScreenEnabled || tablineVisible) hideSeparator = YES; else hideSeparator = toolbarHidden && !windowTextured; @@ -2117,15 +2108,5 @@ - (void)processAfterWindowPresentedQueue [afterWindowPresentedQueue release]; afterWindowPresentedQueue = nil; } -+ (NSString *)tabBarStyleForUnified -{ - return shouldUseYosemiteTabBarStyle() ? (shouldUseMojaveTabBarStyle() ? @"Mojave" : @"Yosemite") : @"Unified"; -} - -+ (NSString *)tabBarStyleForMetal -{ - return shouldUseYosemiteTabBarStyle() ? (shouldUseMojaveTabBarStyle() ? @"Mojave" : @"Yosemite") : @"Metal"; -} - @end // MMWindowController (Private) diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj index 2d676cbb8d..403e34fcf8 100644 --- a/src/MacVim/MacVim.xcodeproj/project.pbxproj +++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj @@ -22,7 +22,6 @@ 1D384A0E100D671700D3C22F /* KeyBinding.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1D384A0D100D671700D3C22F /* KeyBinding.plist */; }; 1D44972211FCA9B400B0630F /* MMCoreTextView+ToolTip.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */; }; 1D493D580C5247BF00AB718C /* Vim in Copy Executables */ = {isa = PBXBuildFile; fileRef = 1D493D570C5247BF00AB718C /* Vim */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */; }; 1D80591F0E1185EA001699D1 /* Miscellaneous.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80591D0E1185EA001699D1 /* Miscellaneous.m */; }; 1D80FBD40CBBD3B700102A1C /* MMFullScreenWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80FBD00CBBD3B700102A1C /* MMFullScreenWindow.m */; }; @@ -60,7 +59,6 @@ 1DE8CC620C5E2AAD003F56E3 /* Actions.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1DE8CC610C5E2AAD003F56E3 /* Actions.plist */; }; 1DE9B9500D341AB8008FEDD4 /* MMWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE9B94E0D341AB8008FEDD4 /* MMWindow.m */; }; 1DED78600C6DE43D0079945F /* vimrc in Copy default vimrc files */ = {isa = PBXBuildFile; fileRef = 1DED785F0C6DE43D0079945F /* vimrc */; }; - 1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; }; 52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 528DA6691426D4EB003380F1 /* macvim-askpass */; }; 52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; @@ -77,23 +75,13 @@ 90A33BEA28D563DF003A2E2F /* MMSparkle2Delegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A33BE928D563DF003A2E2F /* MMSparkle2Delegate.m */; }; 90AF83AB2A8C37F70046DA2E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 90AF83A92A8C37F70046DA2E /* Security.framework */; }; 90B9877D2A579F9500FC95D6 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 90B9877B2A579F9500FC95D6 /* WebKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 925B55D5254B604A006B047E /* MMHoverButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 925B55D1254B604A006B047E /* MMHoverButton.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; + 925B55D7254B61AC006B047E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 925B55D6254B61AB006B047E /* QuartzCore.framework */; }; + 92C6F6E825587E1C007AE21E /* MMTab.m in Sources */ = {isa = PBXBuildFile; fileRef = 92C6F6E325587E1C007AE21E /* MMTab.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; + 92C6F6E925587E1C007AE21E /* MMTabline.m in Sources */ = {isa = PBXBuildFile; fileRef = 92C6F6E525587E1C007AE21E /* MMTabline.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1D493DB80C52533B00AB718C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 53DF68FD067E5B5A0090B5B0; - remoteInfo = PSMTabBarControlFramework; - }; - 1D493DCC0C5254A400AB718C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 53DF68FC067E5B5A0090B5B0; - remoteInfo = PSMTabBarControlFramework; - }; 52818AFE1C1C075300F59085 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */; @@ -136,7 +124,6 @@ dstSubfolderSpec = 10; files = ( 52A364761C4A57C1005757EC /* Sparkle.framework in Copy Frameworks */, - 1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */, ); name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -203,7 +190,6 @@ 1D384A0D100D671700D3C22F /* KeyBinding.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = KeyBinding.plist; sourceTree = ""; }; 1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MMCoreTextView+ToolTip.m"; sourceTree = ""; }; 1D493D570C5247BF00AB718C /* Vim */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = Vim; path = ../Vim; sourceTree = SOURCE_ROOT; }; - 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PSMTabBarControl.xcodeproj; path = PSMTabBarControl/PSMTabBarControl.xcodeproj; sourceTree = ""; }; 1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMFindReplaceController.h; sourceTree = ""; }; 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMFindReplaceController.m; sourceTree = ""; }; 1D80591D0E1185EA001699D1 /* Miscellaneous.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Miscellaneous.m; sourceTree = ""; }; @@ -468,6 +454,13 @@ 95241CF925749CC7001E3711 /* errors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = errors.h; path = ../errors.h; sourceTree = ""; }; 95241CFA25749CC7001E3711 /* textobject.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = textobject.c; path = ../textobject.c; sourceTree = ""; }; 95241CFB25749D4A001E3711 /* os_macosx.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = os_macosx.m; path = ../os_macosx.m; sourceTree = ""; }; + 925B55CD254B604A006B047E /* MMHoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHoverButton.h; sourceTree = ""; }; + 925B55D1254B604A006B047E /* MMHoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHoverButton.m; sourceTree = ""; }; + 925B55D6254B61AB006B047E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 92C6F6E325587E1C007AE21E /* MMTab.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTab.m; sourceTree = ""; }; + 92C6F6E525587E1C007AE21E /* MMTabline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTabline.m; sourceTree = ""; }; + 92C6F6E625587E1C007AE21E /* MMTabline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTabline.h; sourceTree = ""; }; + 92C6F6E725587E1C007AE21E /* MMTab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTab.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -477,7 +470,7 @@ files = ( 90AF83AB2A8C37F70046DA2E /* Security.framework in Frameworks */, 90B9877D2A579F9500FC95D6 /* WebKit.framework in Frameworks */, - 1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */, + 925B55D7254B61AC006B047E /* QuartzCore.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 1D8B5A53104AF9FF002E59D5 /* Carbon.framework in Frameworks */, 52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */, @@ -499,6 +492,7 @@ children = ( 9098943A2A56ECF6007B84A3 /* MMWhatsNewController.h */, 9098943B2A56ECF6007B84A3 /* MMWhatsNewController.m */, + 925B55CB254B604A006B047E /* MMTabline */, 1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */, 1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */, 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */, @@ -583,14 +577,6 @@ name = Executables; sourceTree = ""; }; - 1D493DB40C52533B00AB718C /* Products */ = { - isa = PBXGroup; - children = ( - 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */, - ); - name = Products; - sourceTree = ""; - }; 1DE602460C587F760055263D /* Vim Resources */ = { isa = PBXGroup; children = ( @@ -676,9 +662,9 @@ children = ( 90AF83A92A8C37F70046DA2E /* Security.framework */, 90B9877B2A579F9500FC95D6 /* WebKit.framework */, + 925B55D6254B61AB006B047E /* QuartzCore.framework */, 52A364721C4A5789005757EC /* Sparkle.framework */, 1D8B5A52104AF9FF002E59D5 /* Carbon.framework */, - 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */, 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); @@ -898,6 +884,19 @@ name = MacVim; sourceTree = ""; }; + 925B55CB254B604A006B047E /* MMTabline */ = { + isa = PBXGroup; + children = ( + 925B55CD254B604A006B047E /* MMHoverButton.h */, + 925B55D1254B604A006B047E /* MMHoverButton.m */, + 92C6F6E725587E1C007AE21E /* MMTab.h */, + 92C6F6E325587E1C007AE21E /* MMTab.m */, + 92C6F6E625587E1C007AE21E /* MMTabline.h */, + 92C6F6E525587E1C007AE21E /* MMTabline.m */, + ); + path = MMTabline; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -923,7 +922,6 @@ buildRules = ( ); dependencies = ( - 1D493DCD0C5254A400AB718C /* PBXTargetDependency */, 52818B011C1C084100F59085 /* PBXTargetDependency */, ); name = MacVim; @@ -997,10 +995,6 @@ mainGroup = 29B97314FDCFA39411CA2CEA /* MacVim */; projectDirPath = ""; projectReferences = ( - { - ProductGroup = 1D493DB40C52533B00AB718C /* Products */; - ProjectRef = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */; - }, { ProductGroup = 52818AFB1C1C075300F59085 /* Products */; ProjectRef = 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */; @@ -1015,13 +1009,6 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = PSMTabBarControl.framework; - remoteRef = 1D493DB80C52533B00AB718C /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; @@ -1215,6 +1202,7 @@ files = ( 8D11072D0486CEB800E47090 /* main.m in Sources */, 1D1474980C56703C0038FA2B /* MacVim.m in Sources */, + 925B55D5254B604A006B047E /* MMHoverButton.m in Sources */, 1D1474A00C5673AE0038FA2B /* MMAppController.m in Sources */, 1D1474AA0C5677450038FA2B /* MMTextStorage.m in Sources */, 1D1474B00C5678370038FA2B /* MMTextView.m in Sources */, @@ -1233,7 +1221,9 @@ 1D145C7F0E5227CE00691AA0 /* MMTextViewHelper.m in Sources */, 1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */, 1DE63FFB0E71820F00959BDB /* MMCoreTextView.m in Sources */, + 92C6F6E825587E1C007AE21E /* MMTab.m in Sources */, 1D44972211FCA9B400B0630F /* MMCoreTextView+ToolTip.m in Sources */, + 92C6F6E925587E1C007AE21E /* MMTabline.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1248,11 +1238,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 1D493DCD0C5254A400AB718C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PSMTabBarControlFramework; - targetProxy = 1D493DCC0C5254A400AB718C /* PBXContainerItemProxy */; - }; 52818B011C1C084100F59085 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = QuickLookStephen; diff --git a/src/MacVim/MacVim_xcode8.xcodeproj/project.pbxproj b/src/MacVim/MacVim_xcode8.xcodeproj/project.pbxproj index eba27acc12..cd4b93f341 100644 --- a/src/MacVim/MacVim_xcode8.xcodeproj/project.pbxproj +++ b/src/MacVim/MacVim_xcode8.xcodeproj/project.pbxproj @@ -23,7 +23,6 @@ 1D384A0E100D671700D3C22F /* KeyBinding.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1D384A0D100D671700D3C22F /* KeyBinding.plist */; }; 1D44972211FCA9B400B0630F /* MMCoreTextView+ToolTip.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */; }; 1D493D580C5247BF00AB718C /* Vim in Copy Executables */ = {isa = PBXBuildFile; fileRef = 1D493D570C5247BF00AB718C /* Vim */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */; }; 1D80591F0E1185EA001699D1 /* Miscellaneous.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80591D0E1185EA001699D1 /* Miscellaneous.m */; }; 1D80FBD40CBBD3B700102A1C /* MMFullScreenWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80FBD00CBBD3B700102A1C /* MMFullScreenWindow.m */; }; @@ -61,7 +60,6 @@ 1DE8CC620C5E2AAD003F56E3 /* Actions.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1DE8CC610C5E2AAD003F56E3 /* Actions.plist */; }; 1DE9B9500D341AB8008FEDD4 /* MMWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE9B94E0D341AB8008FEDD4 /* MMWindow.m */; }; 1DED78600C6DE43D0079945F /* vimrc in Copy default vimrc files */ = {isa = PBXBuildFile; fileRef = 1DED785F0C6DE43D0079945F /* vimrc */; }; - 1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; }; 52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 528DA6691426D4EB003380F1 /* macvim-askpass */; }; 52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; @@ -78,23 +76,13 @@ 90A33BEA28D563DF003A2E2F /* MMSparkle2Delegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A33BE928D563DF003A2E2F /* MMSparkle2Delegate.m */; }; 90AF83AB2A8C37F70046DA2E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 90AF83A92A8C37F70046DA2E /* Security.framework */; }; 90B9877D2A579F9500FC95D6 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 90B9877B2A579F9500FC95D6 /* WebKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 925B55D5254B604A006B047E /* MMHoverButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 925B55D1254B604A006B047E /* MMHoverButton.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; + 925B55D7254B61AC006B047E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 925B55D6254B61AB006B047E /* QuartzCore.framework */; }; + 92C6F6E825587E1C007AE21E /* MMTab.m in Sources */ = {isa = PBXBuildFile; fileRef = 92C6F6E325587E1C007AE21E /* MMTab.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; + 92C6F6E925587E1C007AE21E /* MMTabline.m in Sources */ = {isa = PBXBuildFile; fileRef = 92C6F6E525587E1C007AE21E /* MMTabline.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1D493DB80C52533B00AB718C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 53DF68FD067E5B5A0090B5B0; - remoteInfo = PSMTabBarControlFramework; - }; - 1D493DCC0C5254A400AB718C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 53DF68FC067E5B5A0090B5B0; - remoteInfo = PSMTabBarControlFramework; - }; 52818AFE1C1C075300F59085 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */; @@ -137,7 +125,6 @@ dstSubfolderSpec = 10; files = ( 52A364761C4A57C1005757EC /* Sparkle.framework in Copy Frameworks */, - 1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */, ); name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -204,7 +191,6 @@ 1D384A0D100D671700D3C22F /* KeyBinding.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = KeyBinding.plist; sourceTree = ""; }; 1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MMCoreTextView+ToolTip.m"; sourceTree = ""; }; 1D493D570C5247BF00AB718C /* Vim */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = Vim; path = ../Vim; sourceTree = SOURCE_ROOT; }; - 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PSMTabBarControl.xcodeproj; path = PSMTabBarControl/PSMTabBarControl.xcodeproj; sourceTree = ""; }; 1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMFindReplaceController.h; sourceTree = ""; }; 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMFindReplaceController.m; sourceTree = ""; }; 1D80591D0E1185EA001699D1 /* Miscellaneous.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Miscellaneous.m; sourceTree = ""; }; @@ -469,6 +455,13 @@ 95241CF925749CC7001E3711 /* errors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = errors.h; path = ../errors.h; sourceTree = ""; }; 95241CFA25749CC7001E3711 /* textobject.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = textobject.c; path = ../textobject.c; sourceTree = ""; }; 95241CFB25749D4A001E3711 /* os_macosx.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = os_macosx.m; path = ../os_macosx.m; sourceTree = ""; }; + 925B55CD254B604A006B047E /* MMHoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHoverButton.h; sourceTree = ""; }; + 925B55D1254B604A006B047E /* MMHoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHoverButton.m; sourceTree = ""; }; + 925B55D6254B61AB006B047E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 92C6F6E325587E1C007AE21E /* MMTab.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTab.m; sourceTree = ""; }; + 92C6F6E525587E1C007AE21E /* MMTabline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTabline.m; sourceTree = ""; }; + 92C6F6E625587E1C007AE21E /* MMTabline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTabline.h; sourceTree = ""; }; + 92C6F6E725587E1C007AE21E /* MMTab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTab.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -478,7 +471,7 @@ files = ( 90AF83AB2A8C37F70046DA2E /* Security.framework in Frameworks */, 90B9877D2A579F9500FC95D6 /* WebKit.framework in Frameworks */, - 1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */, + 925B55D7254B61AC006B047E /* QuartzCore.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 1D8B5A53104AF9FF002E59D5 /* Carbon.framework in Frameworks */, 52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */, @@ -500,6 +493,7 @@ children = ( 9098943A2A56ECF6007B84A3 /* MMWhatsNewController.h */, 9098943B2A56ECF6007B84A3 /* MMWhatsNewController.m */, + 925B55CB254B604A006B047E /* MMTabline */, 1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */, 1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */, 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */, @@ -584,14 +578,6 @@ name = Executables; sourceTree = ""; }; - 1D493DB40C52533B00AB718C /* Products */ = { - isa = PBXGroup; - children = ( - 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */, - ); - name = Products; - sourceTree = ""; - }; 1DE602460C587F760055263D /* Vim Resources */ = { isa = PBXGroup; children = ( @@ -677,9 +663,9 @@ children = ( 90AF83A92A8C37F70046DA2E /* Security.framework */, 90B9877B2A579F9500FC95D6 /* WebKit.framework */, + 925B55D6254B61AB006B047E /* QuartzCore.framework */, 52A364721C4A5789005757EC /* Sparkle.framework */, 1D8B5A52104AF9FF002E59D5 /* Carbon.framework */, - 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */, 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); @@ -899,6 +885,19 @@ name = MacVim; sourceTree = ""; }; + 925B55CB254B604A006B047E /* MMTabline */ = { + isa = PBXGroup; + children = ( + 925B55CD254B604A006B047E /* MMHoverButton.h */, + 925B55D1254B604A006B047E /* MMHoverButton.m */, + 92C6F6E725587E1C007AE21E /* MMTab.h */, + 92C6F6E325587E1C007AE21E /* MMTab.m */, + 92C6F6E625587E1C007AE21E /* MMTabline.h */, + 92C6F6E525587E1C007AE21E /* MMTabline.m */, + ); + path = MMTabline; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -924,7 +923,6 @@ buildRules = ( ); dependencies = ( - 1D493DCD0C5254A400AB718C /* PBXTargetDependency */, 52818B011C1C084100F59085 /* PBXTargetDependency */, ); name = MacVim; @@ -998,10 +996,6 @@ mainGroup = 29B97314FDCFA39411CA2CEA /* MacVim */; projectDirPath = ""; projectReferences = ( - { - ProductGroup = 1D493DB40C52533B00AB718C /* Products */; - ProjectRef = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */; - }, { ProductGroup = 52818AFB1C1C075300F59085 /* Products */; ProjectRef = 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */; @@ -1016,13 +1010,6 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = PSMTabBarControl.framework; - remoteRef = 1D493DB80C52533B00AB718C /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; @@ -1216,6 +1203,7 @@ files = ( 8D11072D0486CEB800E47090 /* main.m in Sources */, 1D1474980C56703C0038FA2B /* MacVim.m in Sources */, + 925B55D5254B604A006B047E /* MMHoverButton.m in Sources */, 1D1474A00C5673AE0038FA2B /* MMAppController.m in Sources */, 1D1474AA0C5677450038FA2B /* MMTextStorage.m in Sources */, 1D1474B00C5678370038FA2B /* MMTextView.m in Sources */, @@ -1234,7 +1222,9 @@ 1D145C7F0E5227CE00691AA0 /* MMTextViewHelper.m in Sources */, 1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */, 1DE63FFB0E71820F00959BDB /* MMCoreTextView.m in Sources */, + 92C6F6E825587E1C007AE21E /* MMTab.m in Sources */, 1D44972211FCA9B400B0630F /* MMCoreTextView+ToolTip.m in Sources */, + 92C6F6E925587E1C007AE21E /* MMTabline.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1249,11 +1239,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 1D493DCD0C5254A400AB718C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PSMTabBarControlFramework; - targetProxy = 1D493DCC0C5254A400AB718C /* PBXContainerItemProxy */; - }; 52818B011C1C084100F59085 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = QuickLookStephen; diff --git a/src/MacVim/Miscellaneous.h b/src/MacVim/Miscellaneous.h index 33c2be980c..3b864602a8 100644 --- a/src/MacVim/Miscellaneous.h +++ b/src/MacVim/Miscellaneous.h @@ -22,6 +22,7 @@ extern NSString *MMTabMinWidthKey; extern NSString *MMTabMaxWidthKey; extern NSString *MMTabOptimumWidthKey; extern NSString *MMShowAddTabButtonKey; +extern NSString *MMShowTabScrollButtonsKey; extern NSString *MMTextInsetLeftKey; extern NSString *MMTextInsetRightKey; extern NSString *MMTextInsetTopKey; @@ -148,11 +149,6 @@ enum { @end -@interface NSTabView (MMExtras) -- (void)removeAllTabViewItems; -@end - - @interface NSNumber (MMExtras) // Used by modifyFont:/convertFont: to allow font size to be changed via menu // (bound to Cmd+/Cmd-) or using macaction fontSizeUp:/fontSizeDown:. @@ -177,9 +173,6 @@ NSView *showHiddenFilesView(void); NSString *normalizeFilename(NSString *filename); NSArray *normalizeFilenames(NSArray *filenames); -BOOL shouldUseYosemiteTabBarStyle(void); -BOOL shouldUseMojaveTabBarStyle(void); - int getCurrentAppearance(NSAppearance *appearance); // Pasteboard helpers diff --git a/src/MacVim/Miscellaneous.m b/src/MacVim/Miscellaneous.m index 98ffcd75f7..84b1bbec44 100644 --- a/src/MacVim/Miscellaneous.m +++ b/src/MacVim/Miscellaneous.m @@ -18,6 +18,7 @@ NSString *MMTabMaxWidthKey = @"MMTabMaxWidth"; NSString *MMTabOptimumWidthKey = @"MMTabOptimumWidth"; NSString *MMShowAddTabButtonKey = @"MMShowAddTabButton"; +NSString *MMShowTabScrollButtonsKey = @"MMShowTabScrollButtons"; NSString *MMTextInsetLeftKey = @"MMTextInsetLeft"; NSString *MMTextInsetRightKey = @"MMTextInsetRight"; NSString *MMTextInsetTopKey = @"MMTextInsetTop"; @@ -233,23 +234,6 @@ - (NSToolbarItem *)itemWithItemIdentifier:(NSString *)identifier -@implementation NSTabView (MMExtras) - -- (void)removeAllTabViewItems -{ - NSArray *existingItems = [self tabViewItems]; - NSEnumerator *e = [existingItems objectEnumerator]; - NSTabViewItem *item; - while ((item = [e nextObject])) { - [self removeTabViewItem:item]; - } -} - -@end // NSTabView (MMExtras) - - - - @implementation NSNumber (MMExtras) // HACK to allow font size to be changed via menu (bound to Cmd+/Cmd-) @@ -320,22 +304,6 @@ - (NSInteger)tag - BOOL -shouldUseYosemiteTabBarStyle(void) -{ - return floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_10; -} - BOOL -shouldUseMojaveTabBarStyle(void) -{ -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 - if (@available(macos 10.14, *)) { - return true; - } -#endif - return false; -} - int getCurrentAppearance(NSAppearance *appearance){ int flag = 0; // for macOS 10.13 or earlier always return 0; diff --git a/src/MacVim/PSMTabBarControl/English.lproj/InfoPlist.strings b/src/MacVim/PSMTabBarControl/English.lproj/InfoPlist.strings deleted file mode 100644 index 0bf04f0d2c2a0a3273e92116975021ec5e2b6f6b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 208 zcmW-b%?`m(5Ju0sPtjO5f=H~y%7z3Ho}jcv&^B#Jcq1=~(`GU=-~63>zdwdVgsdny z5_99io0P=f(_B&8Dag&CIWsP;GWCG6+plTtUfq6mTanB_+puTBgS*_Eo%2|3%)zUa sxrEY-O8$v+$C%0K@iA_lwl6n&`;Smosm@hv>qH&Xw;D6jCf-d6{`3tbT>t<8 diff --git a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/classes.nib b/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 2e3f46075b..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,24 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {newWindow = id; }; - CLASS = AppController; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - {CLASS = FakeModel; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {addNewTab = id; closeTab = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - CLASS = PSMTabBarControl; - LANGUAGE = ObjC; - OUTLETS = {delegate = id; partnerView = id; style = id; tabView = NSTabView; }; - SUPERCLASS = NSControl; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/info.nib b/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/info.nib deleted file mode 100644 index c7f7c64d43..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/info.nib +++ /dev/null @@ -1,21 +0,0 @@ - - - - - IBDocumentLocation - 135 107 356 240 0 0 1680 1028 - IBEditorPositions - - 29 - 130 357 371 44 0 0 1680 1028 - - IBFramework Version - 443.0 - IBOpenObjects - - 29 - - IBSystem Version - 8H14 - - diff --git a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/keyedobjects.nib b/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/keyedobjects.nib deleted file mode 100644 index 348142185703c0cdbdd5313a4e0fad5e742f3a77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11566 zcmbt)2Y6J)*Z$1ix!cR#-gEB_p-KxigdS>u1VTaxAp|zb0t-nt>~5%{bLB@B1yMi{ z>4*r3f`}AFL=-zsI*5qa8;HI9&)rR8_#w~t|DG>-HaoY>`<|Keo--{aRpp^*taa;C z2qOk55J49zhJJBxm0@{Q2qu0_n*3O|FN$2;*Z zya&I658_wx>-Zh~E`ARm$LH~7{1Lu_KgOTpZ}7KJ`VQa3zvDlk^e2NE4Wq?Z7#(9` z9E_83F>c1sq%aMcMoeR-In#=1&7?Bzm`+R&rZ>}v>C5zE1~NmLTqchh#*ARbFaf57 zDP_hn>zHlKcIH{;Ip!s1A9Ij-l{v~Bhdala6U-InE9M4sllhVPQ=w$GD^v=-!l*DS zEDEn8MbS{v67IE9q$<)BJrtQx9-tVc7^x^zR469H)nvsK#Z1K(X`~ZcL%NWzq#Nl$dcvLdq&MjS_xh0jBom%@ zAcNp43!Y??AtZ+kMQfN=B$woq5#)JR!)jR_t7i?Yku|X#Yi2F1m9?>U*1Ya0fKpIH)Ce_3O;A(R4Bdm8qZX(oYK2i($Ziw8Y&5uhho!ug)1u|?81>m;PomGM5DoI;_brh+`*x;CQHFQ46kW zT96=f{+Ipr4D1^L3#Wu56QNGuaAhnjP#G8(jEn%h;M5qrn4g_HG#rl6YZ4AfSR-LA z{Zztg371M(M^zFoqZ)dhJ|*E2s-(z_(#jfjYpWjwlWA zTSjA%P~|w_?O6qhuQU*YhEQ?>rK8TM3+h^sXlF25m?%^N#s<_Cbwl0bKFX?&1)x`Q z<0u8$xpjp^(-Sy7QO0_dfw~uiA=S}XxT5xx@ zPPjT!8l(>Dq`I@H8cjx1&{Q-HO-D1}{d>_&bRW7OQ6!-U&@AwIR1vjUU@T?U$qza#fgXlk%5exK?s z_y7I(-xdf^L=DtLjnqo*r@)5Uz&{7gMf1>nv;df8t$=Q112SX5iYPrtFVb!Fd_h*I zGE@Ncq?;bfmkpBz8bArkJg~>&=<9> zNCb zaP7yVIY(ZgBqI>1X>D&1ozOp6UX{~5Vai*OF{0zcQ{;PK!YTA_jm%r4_rZ)~pw!;M zXe?BjNFoev0%oP$Y1WCjStr4)594Mvq>aF=#sxmXth-Jb+8pd@b|xNo|3sZ^%@=iEX-Mz+$1BdBCE@CS z;Y=`oFMGxxj+6x>aj$^(D$4?qvUsH-fy!X{f0^+knDG;skqTzC{P%A875xUL{E_Gu z3yhnHwgP)v%Y8Glf2b@d433S5xo6IJ=#cSn9lxxXx})j!8jcByU?nhi0LHfe&Uhcz zAc}Q0j%WvD?Guu;#_6(yQ|h4)lPPawumFP%7}9|u?QRUtdfnTpwtEY5K}xdXp(WLo zGBA|uaYfT>G>&=T5NQu!=yC@GZXk;Zr$8GT#oN%8b_0g)^)!x~q4~HueGg>xKIE8K z&eXX7aBGy7S6UqdC)E(rbu%0a0(6XxNZIG#1R6oWSjY((|TX3MyRxxsRnJIURj6G)(sfdGoe@50S`6s15BqEU1xWfUrAdcHBTs1AHG=WP2w-m1H z;m!iw*>p7Ej=U3hZd@(%0Czzgw}_4c++rEGCL`j9K`o2vDNxIYA(%H*!MvaxenYS_ z8z(f%Nly?z7EjA^HtYwJ(`aqD*D7f_7_owuff0eb8Lpk5u1DK*t^n+we0!5 zL29w!@Ur+<9o!*+J4~wpuJR7J#QX@qQ3t1|;aa%7!f?2vsAf!;%XNq_GT~!%G9X6I z{r8LupTH;Mf;a`fI4%1EpMxo6USJ%J(imV@%Rb@YrTAcpFMu>I(Puy!TZ6D%mnBgK zk{COhbJkGzh1Ee^3q4EaiFBP6SHX&FbOu;4_3l=D23C9#x8iHyp9cKXR%|rAUYdR zAGj+jqd=5lWmHBDsIvg|KXFtQWb$FrppeKd(0l=ASc1%y6RaU%^gv*w3xHtm9S%-7 zgE0fVRfY%fc>q3N28Y?;fa;1Wd3IC>pECi*-_l?u4EuHWGAnD=X+0ysKyCLk9$@v+ zMZmi7PF7i^zcM_qigDJi^dVqQ-V*OIUp^83kip%?zs?wvyxk7*{)KW!f-pH!y7z zQ%_rbk~z2wM2~?|Ps^Ky& z%-V8dBLZb*Z~^67G2{bg0o@3g>+Xg*5->;AV6F$u4Kn74UgcrXnT$H6pj0kHF+S^O z%9!8=CdiD9FE(oyhCN~OJPp<&@$dNJkQvXc-NAKaLd*oTk7zZ7(R^KGil5mW-c=iufToKGt5GC03Tx(VI{uC z6fg)kV3sn=7$1saky*(+fw$nf=qFJ9X1bjwfxnv33o!eCi%y`=(R}(k-A6~#6q-hJ zXhXW29s=2~qBH4odWjCAl{AAcqc79b^hFw={ivJ1MtK^c$7x$Sm9C=?(5`eZJw_K& z9qmHjrXSF;w1~E(bLl7N6X}jw|IZSW*-$fII>|g$n?{+fux`w)E~$Vu6f98_i3?Dp z^l9kt_)tN&<8a5G2r;ZvgGPcn~zCd!R8d$w5#KTN@FWoQ#E!{9Or~ z7(o<;@u+!C_x#V6-A@0ny;@_!90e>z5)D$YQ0-;9zphsg6yydYlS8mISLa!UTA@Mn z6*~F~eHA==Fs>DavQ8@s6RLoH5?I-embYvYwPnx$-%S7Cwzvq` zu4q!%{1zap<@88h^WT8rC=VuD*z%tiwm}seAyHH@10csOgK%F3;kxOLQI)xxNYv1` zHT}z62Y66LjVS)rD+#l314XaeT8jQ)R#*B?Z9V#KUZ1iM?1jM|n%mx_Uam9tqda+sCea0(P{lgfAWEW}MgsUh`4zTz70)nZ z*UKYi;>~UGArX4HH97#F6EGmoWzu0Vn;?JC2^hpqz~2T;ME(Z3q{FZnlb@n{;chx4 z&G=jLH9VK_NhrYtJO18Exn|9qPy^3p7Rk@Re+-z;Ktj>e(;)k0n2YN zM%*5(2{ID%1PtJ_!HfG~5-T0wFXNq{qMz!oz5|9D*waEbIqXt%CsD48n{+ z%O0t*ju_(B5hF1Xj+lvsSc#3;iGw(a3w}MsOMJvnk_b-(B9dg%fTY0vMx-%mLYk6h z+`>E4Z6VKck=1FX)%_EBZD4hJH)Gqu0k732_p$(34<3E5+)L6CD=#$LBcB8O2{b8K{*8KZ4kGuS5B>0?o_YbCSH}K zqqLkW=lwX>kFOJZA0MT6YbvS1y!YHw>iYL-{Zh zoC~uF*zp6QU6aEjF0UbII6el44`r~W5I`XiSpzf*_d!GDStZJ22B2J+*&9)7n138Y z!_a6n0Rj&WE#$c;99xv2>u7v@X1NfSOF&gHMcyXw zkax*@{J_oL<5P2^%GBk}xM>vxF@Ywo2G0VY`GK5_U@1C1JOOJredx*e7AXgp(x9OIVPw zDB)xYH;{0Ogd0k@k%SvdxQT?DO1PPX?~!nG3Ad1NO9{7RuI8DNxB%Chc&Jyk-;jR+yCgJW9?jhlx63&otFA4XSa32Zxm2f`^_m^;{ga=4? zpo9lWI7`CW5*{q!Arj7!@K6coN;nVnDB*kw50`L(ghxoYP{Jc6TqNO95-yhTXbF#@ zpKzNC{ zp5$0g;?|jQ8n>8R&ArX#atFBs+#;?M_l_BN;5KkCaSw3IxHq|t+|%4n?q#kqx1Mux zVeVCK0(T@H-E47uYMLkq{)uk3tfmY@Cp(TEzn&c*Uu0%xBu+DX2Vw!FhJ)?~aEzS_ z=cj{E4xBiap|Of~igd+n#d5_i#Sz6Z#YM%JLdkpWDD6wc95MQ^F1K&{UGjFLDsK>px*-dUIv+71ySAtp|S8k0!}#pZwlx6z2Uq* zAI{|`uu*mnJCA*YUBy1hu3?{Mcd!T8*VuQIYNb}GR~nU^(xS8}9ZHwdqx310l!7u@ znWAi@Y@%$YY_4pnY^`jgY^Us?OjD*SyC}OUdnhxMy_Gr25y}!}nR2XhymG#Bv2wL? zr*fb2b>#=ji^|K&Pn4f4zf^v${8stB@`g&G(yAOPm&&8^sghKURZUeLRDD$aRGF%Q zs$5l2RjI00%~P#XZBcDiZCCA3y{39cbxd_Zbxrk~>JK%m)~i$0ZPh*08S38ZzUp!6 zkb0uJLLF95Qb*PE)brI#)Em`LsduS&tM{n)s?V!0sxParsIRK8sjsVVs&A=(R{yH8 zXlxq4rm?1}CSB8CGe9#)ldTz|nWTwosx?zI(=;9jBeAU7%g0eMI}H zcByu`c7=A6cC+?X?Q!i%?T6Yk+H>09w0~&-(jgtABRZwdr%Tqg)wS1k)OFHz))ncB zbz^iTx-#8Z-FV$3-2&Zm-3r|kx+it7=w8*mrh8rYhVH2DZQU8&Io$=_CEdrmPjp}F ze$d_2BR!)hdZoUxzN!8meG7dneX72#zLUPQzPEm$K1*MyFVYw5$LJ;fEd6Z#T>X6g zgZhW`OZ1QFpVV*AZ_@A7zo36n|C0Wk{(}CJ{v-Xz`cL$q>c7|D(En~w8q@~6!D(}Q!<8I>~<6h%_<3;0T;}zpo<2B=TWu~#F3RAV|0n>j>b4>G0TTEL`+f6%6&zp9ccANH@-ZY&u zoi?2{oj3grNkYYGI2~u;Oq>}qlfWf&DO@8im21moafOhXin%e|Y;G<$AM(#bkUt*b z9);wx29nORkbHJ>XSj3R1@02}5%)3o3HK>?le=YR%*3oTtIaLUt<0(Bw&wQcj^83$Z9IYKzvQ zx1?AaS<)>7Em@YqmK;m2rN~lj8DpumOtDbQT+3?94$JeFU6$RJJ(jbU^OlR2%a$va ztCnk)A1pU5w=6$f87r}xtUha!Rj?*ods+Kf`&l!s1Fc!s!Peo{5!O;`l{I3GStnbU zTUS`0us&&BV_j$6VBK!rVSUMZ$a>Uz#`=-wzNw!(G*|xd1`L+jb57`#k9`_M~l%ZJlj{ zZIf-YZHsNIZM$uU?RncS+iu$)+g{s#+sn3twnMhVwj;JTZEx9b*#5Ayc9mUY*Vzqr zlih5$+U<6ay{Wy8y`8{OtJE@td=Ov!S!Gv#IkQXA5U5XR5QUvx_s!IoO%w%ykZP7CXl{L(U1#a_4={ z&CV^(t0t`t`zR})t=S94cO zS8G=rS4US5SB7h#E6x}E1>#FN_*PpJx-Po;gvu>4Ji6_;Q?&;#`=IPV~_+3nfm+3VTwdD(N&bI5bpbJTO(bINntbJlas^Nr_*=XYE3(2_j#%J0q=jjbG-As3%m=x4|^ATmv|rZF7rO_UFlurUF}`#UGLrKeaic^ z_Zjat@3Y?LygR)wcwh9s)toKN4;-*-}S!lJ?1^(J>@;^J?lO1 zz3Bba*V@;{*Us0$m*z|Nb@6rc_3&l*di(nN`uhg>2KlmmLwrMhdA@vKfv?b4d}Dp%eG`1;zDi$}FXD^&Ci|xPru%03-uE5zo$#IVo%Wseo%dbzUG`n^UG-h_ zUH5(N`_lKd?_1yZz8k(DeLwkr@%`re!}pgT`58a)tNdEO!O!`veuv-f_xh9kg1@Q% z9)CxFFaKcwNPn4stbe?}+AsMR_!s&g_pkGB@Ne?(^zZi{^}p?Z-+#t`&VRvw#s7`} zC;u-=Y?3+2pVTO+aZ=NyHc4%h+9!2O`YP$0r0g5p65lr0pE~s%s1ul;al*n_*A|v-=6Qtcj7zqUHR^O zPreu5hwsN{@&oxSelVZI=kmk&;rs}GBtMED%?J2WKFE*bL;OU(f)DeP_$Xh^PvNKW zGx(YO{k+7_;%D=7`T6{V{6qXA{t^CBeks44Un^t@Lxfx*Ul<`238RG)At;O&CJL3p zBq1hD5vB_>1uD!E<_PnJg~B3XiLg|7TzEoQEvyqZ3Y&#zgzds}!Y<)OVXtsNI4Ha( z91)HR?+EV;$AweE8R5KeNw^|>B3u`~5WW_^6K)8%gkOZ;g}+2B5>X{;MT5wRR?#84 zMW4uv$znsXiFl9LQcM-wi5?QUUGsQt-wm3u_D&~p#Vu4sF7Kz2;7_mew z6UU0<#R+1$SSePC5iurC5vPeW#F^s#q9o1|XNz;i1>!>SVR5mzM0`wKCO$5%6jzCB z#C75Zag(@N+#+rjw~IT(=fz#(ZgG#eSKKeYEFKgOiHF5E#G~Td;=AJe;xX}rcuG7i zo)s^Mm&A|6kHt^KPsPu~FT}6JZ^ZA!AH`&&C Yn$|~Ta<_Zk z+rxmWHbd8|N>P7V_6T2&#C4m5j8m}c78TWX19j`xtyN1%NJvOjR?$T$NJ04{NJ!B4 zX7}tnpU(#VVEN|z-n{qb&6}C4tg+4{X)I-#R86po4{cw_w(VedB)son&q*4!_N$i4 z$bW6SsypH$WMI&xbf#05k#ND*A$vmzrJK7WU1>}0iPMN>YI?6vD!uO^+xPjp?np;6 z8P}q!r5U<2;MhKG4+mv6D5;(fTQtEoyfuWAY;++;{yk(@YN1ew*yl$ozaG;p$92J* zs>3wZGsLz7U|W6;WoifQHwLqI9jL-#l!n?hkdKU19@S%p10TM#&N;G$kaItJ^5h8_ z0E1h)BW_HGY05~OQQA7hfe2Q^3ALA^2*U#>JNsz#)r4xk>No@TJN#W30WpqrX{Tu{ zVyPB|AxIVcb)+k!a`MB}oBVju&pibdNl*VVpo0W-R+ zvPUx&Xl+I=bxq#d;%o0nKik*x)71oJT`75`lznx5*=LJoikecsZKRbWu(L}-$(I>y zJSb4dt;z$M9xGvvEk_BPPEsI3KSsD9WdX$U(VZx9)3;pwE`Jm9m2P_4t=8TW#fFuN zI;l8h(o>p|PRVq5#LV}##;Fv8Ciu725T_+IcacP zM~{)VlvT{;8`_F(mK$AXCoGu`Lc&i_lj>2L$}jI1%0=&b^t7g{BGf#kf!(#DKM#8< zPlKQdrhoHyyCZo}rq_{O_34A!`jQr-P<;J`hYxnPzO^I6EnXwF2dzG8xOI^zcH^Sq+J zoC3Eedg8?_FAuB7oGsvO^a5O+DL4E1kvu7%pC*}~sxD2}653h!=u4FI3w?40mB$Su zQL+yCM(y&}FB8|+XZGQx3+oO$*Z~vzOCY7FJ<}s44=8qALaO+g-kPFgnMe$QXKpiM&{lR@p}6uhu9*>=Npv&HHc9Ik+xIJ~uuPZf`S+2KL7 z3=S;7$dUsS#WXN_4Uoclz^9wVB(OCPNRfBLV7wMP&$B7zV80G)$?pTFV)ye9OAF2n zc5WBj0VL4ICyPO#`v9rj4SyWo0G~zki~~^U9dKp`AGLDGf zgjbaZOe0X8l1~IM>Y-zjmWDIS112R9g~yNw%p$NEbMj)Erc#BW&EZfmich}$&D;~s z4?sveEu*(LPI2WlJq`C%Ns?D`XvH3L3YmeJeB*e~PK0W`^}{2;!*3wI&BO8HDt+-@ z9`4%ST%U4leah|iDR+>vBT99si=`WNSU;wvGfx=(^rvLFIT1`btn#(;3II) zmxH$5AWQpT+JYBeVPzk?IE-7S3e(anU(8sz)reK=wBJ3Kya|Fh!6r2pgKGkw`Lf3A z5v+>hML=TC;6Uc6y&859;H(_r;==G!A?7`ZA=FmhS+F)|^Vd&M*(?~6Dilj1BRe;4=Kf$A_aFSc(J z6O4=s!pN{#VB{?rc#V;Nib+N;h+TehpAjZ*Gx94K_$l-46`wNl3o*vXn*f|+WKQ@a zVxEz|2~?4UGI+TxaBu;uDaF$Bc0C14d@W6eGV88AdLO zlZ^aM%rWw3@vUdYEk?#fQl#3@ET5G^OgPDcKgVZQbZ8H9bbCA_cGh#KkvQ%%r* I1AjsJKZ!>(DgXcg diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/classes.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/classes.nib deleted file mode 100644 index 659b73a0ee..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/classes.nib +++ /dev/null @@ -1,22 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - CLASS = PSMTabBarControlInspector; - LANGUAGE = ObjC; - OUTLETS = { - "_allowsDragBetweenWindows" = NSButton; - "_canCloseOnlyTab" = NSButton; - "_cellMaxWidth" = NSTextField; - "_cellMinWidth" = NSTextField; - "_cellOptimumWidth" = NSTextField; - "_hideForSingleTab" = NSButton; - "_showAddTab" = NSButton; - "_sizeToFit" = NSButton; - "_stylePopUp" = NSPopUpButton; - }; - SUPERCLASS = IBInspector; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/info.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/info.nib deleted file mode 100644 index bf503dd361..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBDocumentLocation - 83 72 356 240 0 0 1680 1028 - IBFramework Version - 446.1 - IBOpenObjects - - 3 - - IBSystem Version - 8I127 - - diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/keyedobjects.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/keyedobjects.nib deleted file mode 100644 index 2def97d1d3f7e1448ff52459ec96cb2efc22143f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11273 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 F{(of|s~G?Q diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/objects.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/objects.nib deleted file mode 100644 index 9a89923a6cbc9b46f7d82325448b413fbb1551fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4291 zcmb7HeN0=|6~E6m1_zTtXtU8KnYU%@^3{fJ*IB_e97 z2c&9A%e1JV)Y)*vAB|m7>$6a+&E8bUWA?r+9)zm}6eL7COOnCf}}i$Qz?+y{KAR|<#GI>6toB{cBgn4fxGmHya3N|(DW z&|a&9=}n?^<#JN%RpXr1qT^#;>gnth1dBi4C2yTM|Iq`>a)KU`F)fEXsT?l^t|$+_ zj?w^X<2SqSTE=nG0-?8VahIg4!-U)hoBT0- zAR#wcbj;a1`dR$&?l!=WKBxpA+~E$G94COnKk-YD7nEF+Ho)C|>&*T;<1RXvr#i=j zU<&vM@L1qYp~18eZdEjPLF;+7r>R%hHPs*=@d$TU1IS&Q%9-5+o zR7z1W3d4r*&dWmDpAN5$f^iVgxg^S^E(WRju8GOH4fb*t8lGS9oP>Nu5;$X!`cNLB ze;(e}rgzCn%;S^=3FXb)&(IGu)3gd0A`z~&K>^O;VPE4Ly`nXmCe?(bf3~)^MoiFC z4S~e#2^0XWHz~>c25n%5XpVG?mt_oHG!yhTcgfO~ZZUbqvP}B1{R!;AVccm|`sH{` z7j+rJxTd`aFAiPnrY0uJA0U{yT~laD`KzkZsmSqSV;-7+{UFB*MT#?)waU7fC}b1N z0yaoKC9I@RLH14)2p{@EQD9UWW+M12oM;5%w+=cxS6n{SyV$(LQBaZ zO-&4hpt4zif)E!l$7g2oK)yEZzCPOF9L$ODu6D8~Kfg*zG^#xmTe=u#Ir zsiZ{@2f&_z4Qo6ltf@Vx#N|+@mJFq!peN+KIUY1;w%DA%mDck+gS^d=zrCT$TS`}~ zOX~|Y#^WLA7oiT0ibMCJuDMdWu7j6z)f>9Qy!%{{q3>m~1%)X5dL5LZx~fbT(}eWWMQ1#`z@4#_b^(D#hq&21>$!7FL7djfw)Ic7Pt5LV<7I>e-~HL z)}t%kz1;;OA3s^7c9?p_}{WpP}%ldqlu z>=15A{5{sf5>5~sH>oHqrQ*m5S4A1BSOOLQe1f!to22tR&b)u`U!w=CMEoN?@dV-H^%h5_wS>Q+^7Gr-eEdonKfvqVaCc2ZZPG z807sF!h1iJnJ>Uy3Ao`1#V!0@FG8EK2Qc|wQ{s9T*X52Do8e@=d?+YU=0**2k0<-R zjbyJV0qWVtL_+IJh2lx^a;QVr`(#-S^(kr`h+J_6f((=fi5Or=+rIvr8OZ@1v6r&; zgK2x@hCS!lpHADWD|U9?Udh_tti7DYZU&9wHLm8O+})FaMqvp59)upH;6&-RMo9oC zUNwY|-C;2u?uYmo9u90wuGl%Cor|iRz_#SWrf1zS1?od7V3z+K!{-}=D*_pKhy}b9 z%f1iff>FS-9|K`WkzMuh0b3Sfqi{&H>_;V8!JZk|DAYX(YZ#OYu%b-Mo(1{_ULXts zA=siMk44(XC`JUe;Ff z5GS{%@Qs3pgX`WQw7a@p64hp$uG(O@f>M{;L*r}OyI|O9(ULJf>TGOs2<<7DPGC6M zAY+(UwM#If!|32vOzw#xp0MtQ*k8DT=xX>zuALWdBF1g)DX8@qwHB!KT-F>0>sE*X zo?@Hs;K)Rv_@;*Na9z8|EA3e*v`ucEbu&7}Uvr$7;H_Qx&T$q#%w9jmmiDkfBU^rk zUHArTIm#}6lbw8?t%lg*m)Q*u>-ZLHs%I~hvDvS(Y#lp(fUSIy4GHYTK^F9~ABEYu zV{CFSbH2_F_}J+e*wj<(#r-Va!oGK!MNhDqudsz@*{4lxd+2dVo?rZG)OY8?{*eeaJ;Sj6e$L7D_L>z*1ZFQunS(7xeB`J2x JeHy+5{09nX=-U7Q diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/classes.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/classes.nib deleted file mode 100644 index 4752228596..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/classes.nib +++ /dev/null @@ -1,28 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - {CLASS = PSMAquaTabStyle; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - {CLASS = PSMMetalTabStyle; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - {CLASS = PSMOverflowPopUpButton; LANGUAGE = ObjC; SUPERCLASS = NSPopUpButton; }, - { - CLASS = PSMProgressIndicator; - LANGUAGE = ObjC; - SUPERCLASS = NSProgressIndicator; - }, - {CLASS = PSMRolloverButton; LANGUAGE = ObjC; SUPERCLASS = NSButton; }, - {CLASS = PSMTabBarCell; LANGUAGE = ObjC; SUPERCLASS = NSActionCell; }, - { - CLASS = PSMTabBarControl; - LANGUAGE = ObjC; - OUTLETS = {delegate = id; partnerView = id; style = id; tabView = NSTabView; }; - SUPERCLASS = NSControl; - }, - { - CLASS = PSMTabBarControlPalette; - LANGUAGE = ObjC; - OUTLETS = {repImage = NSImageView; }; - SUPERCLASS = IBPalette; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/info.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/info.nib deleted file mode 100644 index 866500bb2a..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBDocumentLocation - 83 142 356 240 0 0 1680 1028 - IBFramework Version - 443.0 - IBOpenObjects - - 2 - - IBSystem Version - 8H14 - - diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/keyedobjects.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/keyedobjects.nib deleted file mode 100644 index 635e6d8d17cd5a5f4c2f78e7a739806307fce3a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3036 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 - - - - IBDocumentLocation - 35 49 356 240 0 0 1024 746 - IBEditorPositions - - 18 - 271 466 481 64 0 0 1024 746 - 20 - 400 254 224 482 0 0 1024 746 - - IBFramework Version - 446.1 - IBOpenObjects - - 18 - 20 - 5 - - IBSystem Version - 8J135 - - diff --git a/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/keyedobjects.nib b/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/keyedobjects.nib deleted file mode 100644 index d5228b233882ff5ea4828d5254ad3e3cb0e3f163..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16340 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 Th=N0j - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - PSMTabBarControl - CFBundleIconFile - - CFBundleIdentifier - com.positivespinmedia.PSMTabBarControl - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - BNDL - CFBundleSignature - PSM1 - CFBundleVersion - 1.1 - - diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/Contents.json deleted file mode 100644 index da4a164c91..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActive.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActive.colorset/Contents.json deleted file mode 100644 index 5fb7af753e..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActive.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "189", - "alpha" : "1.000", - "blue" : "188", - "green" : "189" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "40", - "alpha" : "1.000", - "blue" : "42", - "green" : "40" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveHighlight.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveHighlight.colorset/Contents.json deleted file mode 100644 index 2eb1b33a04..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveHighlight.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "168", - "alpha" : "1.000", - "blue" : "168", - "green" : "168" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "36", - "alpha" : "1.000", - "blue" : "39", - "green" : "37" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveSelected.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveSelected.colorset/Contents.json deleted file mode 100644 index 48860afed4..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveSelected.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "209", - "alpha" : "1.000", - "blue" : "208", - "green" : "209" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "54", - "alpha" : "1.000", - "blue" : "57", - "green" : "55" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactive.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactive.colorset/Contents.json deleted file mode 100644 index d0a9f160ae..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactive.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "221", - "alpha" : "1.000", - "blue" : "221", - "green" : "221" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "30", - "alpha" : "1.000", - "blue" : "33", - "green" : "31" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveHighlight.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveHighlight.colorset/Contents.json deleted file mode 100644 index 5141105908..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveHighlight.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "198", - "alpha" : "1.000", - "blue" : "198", - "green" : "198" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "27", - "alpha" : "1.000", - "blue" : "30", - "green" : "28" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveSelected.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveSelected.colorset/Contents.json deleted file mode 100644 index a75643d03c..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveSelected.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "246", - "alpha" : "1.000", - "blue" : "246", - "green" : "246" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "43", - "alpha" : "1.000", - "blue" : "47", - "green" : "45" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderActive.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderActive.colorset/Contents.json deleted file mode 100644 index de2f835b0a..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderActive.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "169", - "alpha" : "1.000", - "blue" : "169", - "green" : "169" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "96", - "alpha" : "1.000", - "blue" : "99", - "green" : "97" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderInactive.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderInactive.colorset/Contents.json deleted file mode 100644 index 498a74c360..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderInactive.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "210", - "alpha" : "1.000", - "blue" : "210", - "green" : "210" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "73", - "alpha" : "1.000", - "blue" : "77", - "green" : "74" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControl.ibclassdescription b/src/MacVim/PSMTabBarControl/PSMTabBarControl.ibclassdescription deleted file mode 100755 index 89959b3847..0000000000 --- a/src/MacVim/PSMTabBarControl/PSMTabBarControl.ibclassdescription +++ /dev/null @@ -1,7 +0,0 @@ -{ - PSMTabBarControl = { - SuperClass = NSControl; - Attributes = { - }; - }; -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj b/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj deleted file mode 100644 index 21c3f7f560..0000000000 --- a/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj +++ /dev/null @@ -1,731 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXAggregateTarget section */ - 53DF6901067E5B8E0090B5B0 /* All */ = { - isa = PBXAggregateTarget; - buildConfigurationList = C056398708A954F8003078D8 /* Build configuration list for PBXAggregateTarget "All" */; - buildPhases = ( - ); - dependencies = ( - 53DF6905067E5B930090B5B0 /* PBXTargetDependency */, - ); - name = All; - productName = All; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 13F8B89007B43554008AE28D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD92D38A0106425D02CA0E72 /* Cocoa.framework */; }; - 523897F415BDA9AC00498A53 /* TabClose_Front_Pressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897EE15BDA9AC00498A53 /* TabClose_Front_Pressed@2x.png */; }; - 523897F515BDA9AC00498A53 /* TabClose_Front_Rollover@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897EF15BDA9AC00498A53 /* TabClose_Front_Rollover@2x.png */; }; - 523897F615BDA9AC00498A53 /* TabClose_Front@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897F015BDA9AC00498A53 /* TabClose_Front@2x.png */; }; - 523897F715BDA9AC00498A53 /* TabNewMetal@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897F115BDA9AC00498A53 /* TabNewMetal@2x.png */; }; - 523897F815BDA9AC00498A53 /* TabNewMetalPressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897F215BDA9AC00498A53 /* TabNewMetalPressed@2x.png */; }; - 523897F915BDA9AC00498A53 /* TabNewMetalRollover@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897F315BDA9AC00498A53 /* TabNewMetalRollover@2x.png */; }; - 52A57C0F15BBA230003EC59C /* TabClose_Front.png in Resources */ = {isa = PBXBuildFile; fileRef = 52A57C0C15BBA230003EC59C /* TabClose_Front.png */; }; - 52A57C1015BBA230003EC59C /* TabClose_Front_Pressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 52A57C0D15BBA230003EC59C /* TabClose_Front_Pressed.png */; }; - 52A57C1115BBA230003EC59C /* TabClose_Front_Rollover.png in Resources */ = {isa = PBXBuildFile; fileRef = 52A57C0E15BBA230003EC59C /* TabClose_Front_Rollover.png */; }; - 52C0B9B415BDB7A9000C268F /* overflowImage@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 52C0B9B215BDB7A9000C268F /* overflowImage@2x.png */; }; - 52C0B9B515BDB7A9000C268F /* overflowImagePressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 52C0B9B315BDB7A9000C268F /* overflowImagePressed@2x.png */; }; - 52C268D015BDB72B0012FECA /* overflowImage.png in Resources */ = {isa = PBXBuildFile; fileRef = 52C268CE15BDB72B0012FECA /* overflowImage.png */; }; - 52C268D115BDB72B0012FECA /* overflowImagePressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 52C268CF15BDB72B0012FECA /* overflowImagePressed.png */; }; - 52FAFCCF1C30F4B500C6E613 /* TabNewYosemite.png in Resources */ = {isa = PBXBuildFile; fileRef = 52FAFCCD1C30F4B500C6E613 /* TabNewYosemite.png */; }; - 52FAFCD01C30F4B500C6E613 /* TabNewYosemite@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 52FAFCCE1C30F4B500C6E613 /* TabNewYosemite@2x.png */; }; - 52FAFCD31C30F4DF00C6E613 /* PSMYosemiteTabStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 52FAFCD11C30F4DF00C6E613 /* PSMYosemiteTabStyle.h */; }; - 52FAFCD41C30F4DF00C6E613 /* PSMYosemiteTabStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 52FAFCD21C30F4DF00C6E613 /* PSMYosemiteTabStyle.m */; }; - 546DEAF1067F63070098DCC4 /* PSMTabBarControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 0259C576FE90428111CA0C5A /* PSMTabBarControl.m */; }; - 546DEAF2067F630E0098DCC4 /* PSMTabBarControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0259C57AFE90428111CA0C5A /* PSMTabBarControl.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 90AD234F21A969C100CEF036 /* PSMMojaveTabStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 90AD234D21A969C100CEF036 /* PSMMojaveTabStyle.h */; }; - 90AD235021A969C100CEF036 /* PSMMojaveTabStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 90AD234E21A969C100CEF036 /* PSMMojaveTabStyle.m */; }; - 90DE16CC21A955EE004F0124 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 90DE16CB21A955EE004F0124 /* Media.xcassets */; }; - A2082A9009EAEB34009AC8BE /* PSMTabDragAssistant.h in Headers */ = {isa = PBXBuildFile; fileRef = A2082A8D09EAEB33009AC8BE /* PSMTabDragAssistant.h */; }; - A2082A9109EAEB34009AC8BE /* PSMTabDragAssistant.m in Sources */ = {isa = PBXBuildFile; fileRef = A2082A8E09EAEB33009AC8BE /* PSMTabDragAssistant.m */; }; - A2129BB209AEB58F00724E6C /* PSMProgressIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = A2129BAF09AEB58F00724E6C /* PSMProgressIndicator.h */; }; - A2129BB309AEB58F00724E6C /* PSMProgressIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = A2129BB009AEB58F00724E6C /* PSMProgressIndicator.m */; }; - A251BE850959A1B90058BC7F /* PSMOverflowPopUpButton.h in Headers */ = {isa = PBXBuildFile; fileRef = A251BE810959A1B90058BC7F /* PSMOverflowPopUpButton.h */; }; - A251BE860959A1B90058BC7F /* PSMOverflowPopUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A251BE820959A1B90058BC7F /* PSMOverflowPopUpButton.m */; }; - A251BE870959A1B90058BC7F /* PSMTabBarCell.h in Headers */ = {isa = PBXBuildFile; fileRef = A251BE830959A1B90058BC7F /* PSMTabBarCell.h */; }; - A251BE880959A1B90058BC7F /* PSMTabBarCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A251BE840959A1B90058BC7F /* PSMTabBarCell.m */; }; - A268E80409A9822A00E082AA /* AquaTabNew.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7F809A9822900E082AA /* AquaTabNew.png */; }; - A268E80509A9822A00E082AA /* AquaTabNewPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7F909A9822900E082AA /* AquaTabNewPressed.png */; }; - A268E80609A9822A00E082AA /* AquaTabNewRollover.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7FA09A9822900E082AA /* AquaTabNewRollover.png */; }; - A268E80709A9822A00E082AA /* TabNewMetal.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7FB09A9822900E082AA /* TabNewMetal.png */; }; - A268E80809A9822A00E082AA /* TabNewMetalPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7FC09A9822900E082AA /* TabNewMetalPressed.png */; }; - A268E80909A9822A00E082AA /* TabNewMetalRollover.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7FD09A9822900E082AA /* TabNewMetalRollover.png */; }; - A268EA6209A9831800E082AA /* PSMRolloverButton.h in Headers */ = {isa = PBXBuildFile; fileRef = A268EA5F09A9831800E082AA /* PSMRolloverButton.h */; }; - A268EA6309A9831800E082AA /* PSMRolloverButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A268EA6009A9831800E082AA /* PSMRolloverButton.m */; }; - A27E47850A28EE76007BA395 /* TabIcon.tif in Resources */ = {isa = PBXBuildFile; fileRef = A20822F00959F6AA00C5F5A4 /* TabIcon.tif */; }; - A27E47880A28EE7C007BA395 /* TabControlRep.tif in Resources */ = {isa = PBXBuildFile; fileRef = A20822EF0959F6AA00C5F5A4 /* TabControlRep.tif */; }; - A2C0D99509AF870000ED379C /* pi.png in Resources */ = {isa = PBXBuildFile; fileRef = A2C0D99309AF870000ED379C /* pi.png */; }; - A2D32EDC09A634C900EC8662 /* PSMTabStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D32EDA09A634C900EC8662 /* PSMTabStyle.h */; }; - A2D32EF709A63BF700EC8662 /* AquaTabClose_Front_Pressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF009A63BF700EC8662 /* AquaTabClose_Front_Pressed.tif */; }; - A2D32EF809A63BF700EC8662 /* AquaTabClose_Front_Rollover.tif in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF109A63BF700EC8662 /* AquaTabClose_Front_Rollover.tif */; }; - A2D32EF909A63BF700EC8662 /* AquaTabClose_Front.tif in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF209A63BF700EC8662 /* AquaTabClose_Front.tif */; }; - A2D32EFA09A63BF700EC8662 /* AquaTabsBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF309A63BF700EC8662 /* AquaTabsBackground.png */; }; - A2D32EFB09A63BF700EC8662 /* AquaTabsDown.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF409A63BF700EC8662 /* AquaTabsDown.png */; }; - A2D32EFC09A63BF700EC8662 /* AquaTabsSeparator.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF509A63BF700EC8662 /* AquaTabsSeparator.png */; }; - A2D32EFD09A63BF700EC8662 /* AquaTabsSeparatorDown.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF609A63BF700EC8662 /* AquaTabsSeparatorDown.png */; }; - A2D32F0009A63D7A00EC8662 /* PSMMetalTabStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D32EFE09A63D7A00EC8662 /* PSMMetalTabStyle.h */; }; - A2D32F0109A63D7A00EC8662 /* PSMMetalTabStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D32EFF09A63D7A00EC8662 /* PSMMetalTabStyle.m */; }; - A2D3317C09A68B7500EC8662 /* AquaTabsDownGraphite.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D3317A09A68B7500EC8662 /* AquaTabsDownGraphite.png */; }; - A2D3317D09A68B7500EC8662 /* AquaTabsDownNonKey.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D3317B09A68B7500EC8662 /* AquaTabsDownNonKey.png */; }; - A2D98B0A0A2B432C0064C6F8 /* PSMUnifiedTabStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D98B070A2B432C0064C6F8 /* PSMUnifiedTabStyle.h */; }; - A2D98B0B0A2B432C0064C6F8 /* PSMUnifiedTabStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D98B080A2B432C0064C6F8 /* PSMUnifiedTabStyle.m */; }; - A2D98B120A2B43FA0064C6F8 /* NSBezierPath_AMShading.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D98B0F0A2B43FA0064C6F8 /* NSBezierPath_AMShading.h */; }; - A2D98B130A2B43FA0064C6F8 /* NSBezierPath_AMShading.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D98B100A2B43FA0064C6F8 /* NSBezierPath_AMShading.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 53DF6904067E5B930090B5B0 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0259C573FE90428111CA0C5A /* Project object */; - proxyType = 1; - remoteGlobalIDString = 53DF68FC067E5B5A0090B5B0; - remoteInfo = PSMTabBarControlFramework; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 0259C576FE90428111CA0C5A /* PSMTabBarControl.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMTabBarControl.m; path = source/PSMTabBarControl.m; sourceTree = ""; }; - 0259C577FE90428111CA0C5A /* PSMTabBarControlInspector.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMTabBarControlInspector.m; path = source/PSMTabBarControlInspector.m; sourceTree = ""; }; - 0259C578FE90428111CA0C5A /* PSMTabBarControlPalette.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMTabBarControlPalette.m; path = source/PSMTabBarControlPalette.m; sourceTree = ""; }; - 0259C57AFE90428111CA0C5A /* PSMTabBarControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMTabBarControl.h; path = source/PSMTabBarControl.h; sourceTree = ""; }; - 0259C57BFE90428111CA0C5A /* PSMTabBarControlInspector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMTabBarControlInspector.h; path = source/PSMTabBarControlInspector.h; sourceTree = ""; }; - 0259C57CFE90428111CA0C5A /* PSMTabBarControlPalette.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMTabBarControlPalette.h; path = source/PSMTabBarControlPalette.h; sourceTree = ""; }; - 0259C57FFE90428111CA0C5A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/PSMTabBarControlInspector.nib; sourceTree = ""; }; - 0259C581FE90428111CA0C5A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/PSMTabBarControlPalette.nib; sourceTree = ""; }; - 0259C583FE90428111CA0C5A /* palette.table */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = palette.table; sourceTree = ""; }; - 13EB9DBD07DE0F1E00EB933A /* InterfaceBuilder.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = InterfaceBuilder.framework; path = /System/Library/Frameworks/InterfaceBuilder.framework; sourceTree = ""; }; - 13F8B88807B434F6008AE28D /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 13F8B88A07B434F6008AE28D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32DBCF980370C29C00C91783 /* PSMTabBarControl_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMTabBarControl_Prefix.pch; path = source/PSMTabBarControl_Prefix.pch; sourceTree = ""; }; - 523897EE15BDA9AC00498A53 /* TabClose_Front_Pressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabClose_Front_Pressed@2x.png"; path = "images/TabClose_Front_Pressed@2x.png"; sourceTree = ""; }; - 523897EF15BDA9AC00498A53 /* TabClose_Front_Rollover@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabClose_Front_Rollover@2x.png"; path = "images/TabClose_Front_Rollover@2x.png"; sourceTree = ""; }; - 523897F015BDA9AC00498A53 /* TabClose_Front@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabClose_Front@2x.png"; path = "images/TabClose_Front@2x.png"; sourceTree = ""; }; - 523897F115BDA9AC00498A53 /* TabNewMetal@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabNewMetal@2x.png"; path = "images/TabNewMetal@2x.png"; sourceTree = ""; }; - 523897F215BDA9AC00498A53 /* TabNewMetalPressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabNewMetalPressed@2x.png"; path = "images/TabNewMetalPressed@2x.png"; sourceTree = ""; }; - 523897F315BDA9AC00498A53 /* TabNewMetalRollover@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabNewMetalRollover@2x.png"; path = "images/TabNewMetalRollover@2x.png"; sourceTree = ""; }; - 52A57C0C15BBA230003EC59C /* TabClose_Front.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabClose_Front.png; path = images/TabClose_Front.png; sourceTree = ""; }; - 52A57C0D15BBA230003EC59C /* TabClose_Front_Pressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabClose_Front_Pressed.png; path = images/TabClose_Front_Pressed.png; sourceTree = ""; }; - 52A57C0E15BBA230003EC59C /* TabClose_Front_Rollover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabClose_Front_Rollover.png; path = images/TabClose_Front_Rollover.png; sourceTree = ""; }; - 52C0B9B215BDB7A9000C268F /* overflowImage@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "overflowImage@2x.png"; path = "images/overflowImage@2x.png"; sourceTree = ""; }; - 52C0B9B315BDB7A9000C268F /* overflowImagePressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "overflowImagePressed@2x.png"; path = "images/overflowImagePressed@2x.png"; sourceTree = ""; }; - 52C268CE15BDB72B0012FECA /* overflowImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = overflowImage.png; path = images/overflowImage.png; sourceTree = ""; }; - 52C268CF15BDB72B0012FECA /* overflowImagePressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = overflowImagePressed.png; path = images/overflowImagePressed.png; sourceTree = ""; }; - 52FAFCCD1C30F4B500C6E613 /* TabNewYosemite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabNewYosemite.png; path = images/TabNewYosemite.png; sourceTree = ""; }; - 52FAFCCE1C30F4B500C6E613 /* TabNewYosemite@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabNewYosemite@2x.png"; path = "images/TabNewYosemite@2x.png"; sourceTree = ""; }; - 52FAFCD11C30F4DF00C6E613 /* PSMYosemiteTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMYosemiteTabStyle.h; path = source/PSMYosemiteTabStyle.h; sourceTree = ""; }; - 52FAFCD21C30F4DF00C6E613 /* PSMYosemiteTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PSMYosemiteTabStyle.m; path = source/PSMYosemiteTabStyle.m; sourceTree = ""; }; - 53DF68FD067E5B5A0090B5B0 /* PSMTabBarControl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PSMTabBarControl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 53DF68FE067E5B5A0090B5B0 /* PSMTabBarControlFramework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PSMTabBarControlFramework-Info.plist"; sourceTree = ""; }; - 54D33B2806778E3300C9C163 /* PSMTabBarControl.ibclassdescription */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PSMTabBarControl.ibclassdescription; sourceTree = ""; }; - 8D1AC9730486D14A00FE50C9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1AC97B0486D23100FE50C9 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 90AD234D21A969C100CEF036 /* PSMMojaveTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMMojaveTabStyle.h; path = source/PSMMojaveTabStyle.h; sourceTree = ""; }; - 90AD234E21A969C100CEF036 /* PSMMojaveTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PSMMojaveTabStyle.m; path = source/PSMMojaveTabStyle.m; sourceTree = ""; }; - 90DE16CB21A955EE004F0124 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; - A2072A2409ABD88600304BCB /* Folder.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = Folder.tif; path = images/Folder.tif; sourceTree = ""; }; - A2072A2509ABD88600304BCB /* Globe.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = Globe.tiff; path = images/Globe.tiff; sourceTree = ""; }; - A2072B5C09AC1FA500304BCB /* Warning.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Warning.png; path = images/Warning.png; sourceTree = ""; }; - A20822EF0959F6AA00C5F5A4 /* TabControlRep.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = TabControlRep.tif; path = images/TabControlRep.tif; sourceTree = ""; }; - A20822F00959F6AA00C5F5A4 /* TabIcon.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = TabIcon.tif; path = images/TabIcon.tif; sourceTree = ""; }; - A2082A8D09EAEB33009AC8BE /* PSMTabDragAssistant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMTabDragAssistant.h; path = source/PSMTabDragAssistant.h; sourceTree = ""; }; - A2082A8E09EAEB33009AC8BE /* PSMTabDragAssistant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PSMTabDragAssistant.m; path = source/PSMTabDragAssistant.m; sourceTree = ""; wrapsLines = 0; }; - A2129BAF09AEB58F00724E6C /* PSMProgressIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMProgressIndicator.h; path = source/PSMProgressIndicator.h; sourceTree = ""; }; - A2129BB009AEB58F00724E6C /* PSMProgressIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PSMProgressIndicator.m; path = source/PSMProgressIndicator.m; sourceTree = ""; }; - A246FB040A2BD6F9005BDF7B /* PSMTabBarControlDoc.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html.documentation; name = PSMTabBarControlDoc.html; path = documentation/PSMTabBarControlDoc.html; sourceTree = ""; }; - A251BE810959A1B90058BC7F /* PSMOverflowPopUpButton.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = PSMOverflowPopUpButton.h; path = source/PSMOverflowPopUpButton.h; sourceTree = ""; }; - A251BE820959A1B90058BC7F /* PSMOverflowPopUpButton.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMOverflowPopUpButton.m; path = source/PSMOverflowPopUpButton.m; sourceTree = ""; }; - A251BE830959A1B90058BC7F /* PSMTabBarCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMTabBarCell.h; path = source/PSMTabBarCell.h; sourceTree = ""; }; - A251BE840959A1B90058BC7F /* PSMTabBarCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMTabBarCell.m; path = source/PSMTabBarCell.m; sourceTree = ""; }; - A251BE890959A1EA0058BC7F /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AppController.h; path = source/AppController.h; sourceTree = ""; }; - A251BE8A0959A1EA0058BC7F /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AppController.m; path = source/AppController.m; sourceTree = ""; }; - A251BE8B0959A1EA0058BC7F /* FakeModel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FakeModel.h; path = source/FakeModel.h; sourceTree = ""; }; - A251BE8C0959A1EA0058BC7F /* FakeModel.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FakeModel.m; path = source/FakeModel.m; sourceTree = ""; }; - A251BE8D0959A1EA0058BC7F /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = main.m; path = source/main.m; sourceTree = ""; }; - A251BE8F0959A23A0058BC7F /* 32x32cancel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 32x32cancel.png; path = images/32x32cancel.png; sourceTree = ""; }; - A251BE9B0959A2530058BC7F /* ReadMe.rtfd */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; path = ReadMe.rtfd; sourceTree = ""; }; - A251BEA20959BB5B0058BC7F /* TabBarControlDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TabBarControlDemo-Info.plist"; sourceTree = ""; }; - A251BEC30959BC0E0058BC7F /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = ""; }; - A268E7F809A9822900E082AA /* AquaTabNew.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabNew.png; path = images/AquaTabNew.png; sourceTree = ""; }; - A268E7F909A9822900E082AA /* AquaTabNewPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabNewPressed.png; path = images/AquaTabNewPressed.png; sourceTree = ""; }; - A268E7FA09A9822900E082AA /* AquaTabNewRollover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabNewRollover.png; path = images/AquaTabNewRollover.png; sourceTree = ""; }; - A268E7FB09A9822900E082AA /* TabNewMetal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabNewMetal.png; path = images/TabNewMetal.png; sourceTree = ""; }; - A268E7FC09A9822900E082AA /* TabNewMetalPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabNewMetalPressed.png; path = images/TabNewMetalPressed.png; sourceTree = ""; }; - A268E7FD09A9822900E082AA /* TabNewMetalRollover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabNewMetalRollover.png; path = images/TabNewMetalRollover.png; sourceTree = ""; }; - A268EA5F09A9831800E082AA /* PSMRolloverButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMRolloverButton.h; path = source/PSMRolloverButton.h; sourceTree = ""; }; - A268EA6009A9831800E082AA /* PSMRolloverButton.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMRolloverButton.m; path = source/PSMRolloverButton.m; sourceTree = ""; }; - A269361009A778770006911E /* 32x32_log.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = 32x32_log.tiff; path = images/32x32_log.tiff; sourceTree = ""; }; - A2A711BA09E5AE1E00D0089B /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Window.nib; sourceTree = ""; }; - A2A711BD09E5BF0500D0089B /* WindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WindowController.h; path = source/WindowController.h; sourceTree = ""; }; - A2A711BE09E5BF0500D0089B /* WindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WindowController.m; path = source/WindowController.m; sourceTree = ""; }; - A2C0D99309AF870000ED379C /* pi.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = pi.png; path = images/pi.png; sourceTree = ""; }; - A2D32EDA09A634C900EC8662 /* PSMTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMTabStyle.h; path = source/PSMTabStyle.h; sourceTree = ""; }; - A2D32EF009A63BF700EC8662 /* AquaTabClose_Front_Pressed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = AquaTabClose_Front_Pressed.tif; path = images/AquaTabClose_Front_Pressed.tif; sourceTree = ""; }; - A2D32EF109A63BF700EC8662 /* AquaTabClose_Front_Rollover.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = AquaTabClose_Front_Rollover.tif; path = images/AquaTabClose_Front_Rollover.tif; sourceTree = ""; }; - A2D32EF209A63BF700EC8662 /* AquaTabClose_Front.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = AquaTabClose_Front.tif; path = images/AquaTabClose_Front.tif; sourceTree = ""; }; - A2D32EF309A63BF700EC8662 /* AquaTabsBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsBackground.png; path = images/AquaTabsBackground.png; sourceTree = ""; }; - A2D32EF409A63BF700EC8662 /* AquaTabsDown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsDown.png; path = images/AquaTabsDown.png; sourceTree = ""; }; - A2D32EF509A63BF700EC8662 /* AquaTabsSeparator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsSeparator.png; path = images/AquaTabsSeparator.png; sourceTree = ""; }; - A2D32EF609A63BF700EC8662 /* AquaTabsSeparatorDown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsSeparatorDown.png; path = images/AquaTabsSeparatorDown.png; sourceTree = ""; }; - A2D32EFE09A63D7A00EC8662 /* PSMMetalTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMMetalTabStyle.h; path = source/PSMMetalTabStyle.h; sourceTree = ""; }; - A2D32EFF09A63D7A00EC8662 /* PSMMetalTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PSMMetalTabStyle.m; path = source/PSMMetalTabStyle.m; sourceTree = ""; }; - A2D3317A09A68B7500EC8662 /* AquaTabsDownGraphite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsDownGraphite.png; path = images/AquaTabsDownGraphite.png; sourceTree = ""; }; - A2D3317B09A68B7500EC8662 /* AquaTabsDownNonKey.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsDownNonKey.png; path = images/AquaTabsDownNonKey.png; sourceTree = ""; }; - A2D98B070A2B432C0064C6F8 /* PSMUnifiedTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMUnifiedTabStyle.h; path = source/PSMUnifiedTabStyle.h; sourceTree = ""; }; - A2D98B080A2B432C0064C6F8 /* PSMUnifiedTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMUnifiedTabStyle.m; path = source/PSMUnifiedTabStyle.m; sourceTree = ""; }; - A2D98B0F0A2B43FA0064C6F8 /* NSBezierPath_AMShading.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NSBezierPath_AMShading.h; path = source/NSBezierPath_AMShading.h; sourceTree = ""; }; - A2D98B100A2B43FA0064C6F8 /* NSBezierPath_AMShading.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = NSBezierPath_AMShading.m; path = source/NSBezierPath_AMShading.m; sourceTree = ""; }; - DD92D38A0106425D02CA0E72 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 53DF68FB067E5B5A0090B5B0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 13F8B89007B43554008AE28D /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0259C574FE90428111CA0C5A /* PSMTabBarControl */ = { - isa = PBXGroup; - children = ( - A251BE9B0959A2530058BC7F /* ReadMe.rtfd */, - A246FADE0A2BD446005BDF7B /* Documentation */, - 32DBCF9E0370C38000C91783 /* Palette */, - 54D33B2C06778E4400C9C163 /* Framework */, - A251BE590959A0550058BC7F /* Demo App */, - 0259C582FE90428111CA0C5A /* Resources */, - 1ED78706FE9D4A0611CA0C5A /* Products */, - 2E58F364FFB232C311CA0CBA /* Frameworks */, - ); - name = PSMTabBarControl; - sourceTree = ""; - }; - 0259C582FE90428111CA0C5A /* Resources */ = { - isa = PBXGroup; - children = ( - 90DE16CB21A955EE004F0124 /* Media.xcassets */, - A251BEC20959BC0E0058BC7F /* MainMenu.nib */, - A251BE8E0959A21A0058BC7F /* Images */, - 8D1AC9730486D14A00FE50C9 /* Info.plist */, - 53DF68FE067E5B5A0090B5B0 /* PSMTabBarControlFramework-Info.plist */, - A251BEA20959BB5B0058BC7F /* TabBarControlDemo-Info.plist */, - 8D1AC97F0486D23B00FE50C9 /* InfoPlist.strings */, - A2A711B909E5AE1E00D0089B /* Window.nib */, - ); - name = Resources; - sourceTree = ""; - }; - 131E8FE8067F80F40006E0CE /* Resources */ = { - isa = PBXGroup; - children = ( - A20822EF0959F6AA00C5F5A4 /* TabControlRep.tif */, - A20822F00959F6AA00C5F5A4 /* TabIcon.tif */, - 0259C57EFE90428111CA0C5A /* PSMTabBarControlInspector.nib */, - 0259C580FE90428111CA0C5A /* PSMTabBarControlPalette.nib */, - ); - name = Resources; - sourceTree = ""; - }; - 13F8B6FD07B43410008AE28D /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 13EB9DBD07DE0F1E00EB933A /* InterfaceBuilder.framework */, - DD92D38A0106425D02CA0E72 /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 13F8B70407B43425008AE28D /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 13F8B88807B434F6008AE28D /* AppKit.framework */, - 13F8B88A07B434F6008AE28D /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 1ED78706FE9D4A0611CA0C5A /* Products */ = { - isa = PBXGroup; - children = ( - 53DF68FD067E5B5A0090B5B0 /* PSMTabBarControl.framework */, - ); - name = Products; - sourceTree = ""; - }; - 2E58F364FFB232C311CA0CBA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 13F8B6FD07B43410008AE28D /* Linked Frameworks */, - 13F8B70407B43425008AE28D /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; - 32DBCF9E0370C38000C91783 /* Palette */ = { - isa = PBXGroup; - children = ( - 54D33B2406778DD400C9C163 /* Undo Support */, - 54D33B2506778DF000C9C163 /* Classes */, - 32DBCF9F0370C38200C91783 /* Other Sources */, - 131E8FE8067F80F40006E0CE /* Resources */, - 0259C583FE90428111CA0C5A /* palette.table */, - ); - name = Palette; - sourceTree = ""; - }; - 32DBCF9F0370C38200C91783 /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32DBCF980370C29C00C91783 /* PSMTabBarControl_Prefix.pch */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 54D33B2406778DD400C9C163 /* Undo Support */ = { - isa = PBXGroup; - children = ( - 54D33B2806778E3300C9C163 /* PSMTabBarControl.ibclassdescription */, - ); - name = "Undo Support"; - sourceTree = ""; - }; - 54D33B2506778DF000C9C163 /* Classes */ = { - isa = PBXGroup; - children = ( - 0259C57BFE90428111CA0C5A /* PSMTabBarControlInspector.h */, - 0259C577FE90428111CA0C5A /* PSMTabBarControlInspector.m */, - 0259C57CFE90428111CA0C5A /* PSMTabBarControlPalette.h */, - 0259C578FE90428111CA0C5A /* PSMTabBarControlPalette.m */, - ); - name = Classes; - sourceTree = ""; - }; - 54D33B2C06778E4400C9C163 /* Framework */ = { - isa = PBXGroup; - children = ( - 90AD234D21A969C100CEF036 /* PSMMojaveTabStyle.h */, - 90AD234E21A969C100CEF036 /* PSMMojaveTabStyle.m */, - 0259C57AFE90428111CA0C5A /* PSMTabBarControl.h */, - 0259C576FE90428111CA0C5A /* PSMTabBarControl.m */, - A251BE830959A1B90058BC7F /* PSMTabBarCell.h */, - A251BE840959A1B90058BC7F /* PSMTabBarCell.m */, - A2D32EDA09A634C900EC8662 /* PSMTabStyle.h */, - A2D32EFE09A63D7A00EC8662 /* PSMMetalTabStyle.h */, - A2D32EFF09A63D7A00EC8662 /* PSMMetalTabStyle.m */, - A2D98B070A2B432C0064C6F8 /* PSMUnifiedTabStyle.h */, - A2D98B080A2B432C0064C6F8 /* PSMUnifiedTabStyle.m */, - 52FAFCD11C30F4DF00C6E613 /* PSMYosemiteTabStyle.h */, - 52FAFCD21C30F4DF00C6E613 /* PSMYosemiteTabStyle.m */, - A268EA5F09A9831800E082AA /* PSMRolloverButton.h */, - A268EA6009A9831800E082AA /* PSMRolloverButton.m */, - A251BE810959A1B90058BC7F /* PSMOverflowPopUpButton.h */, - A251BE820959A1B90058BC7F /* PSMOverflowPopUpButton.m */, - A2129BAF09AEB58F00724E6C /* PSMProgressIndicator.h */, - A2129BB009AEB58F00724E6C /* PSMProgressIndicator.m */, - A2082A8D09EAEB33009AC8BE /* PSMTabDragAssistant.h */, - A2082A8E09EAEB33009AC8BE /* PSMTabDragAssistant.m */, - A2D98B0F0A2B43FA0064C6F8 /* NSBezierPath_AMShading.h */, - A2D98B100A2B43FA0064C6F8 /* NSBezierPath_AMShading.m */, - ); - name = Framework; - sourceTree = ""; - }; - A246FADE0A2BD446005BDF7B /* Documentation */ = { - isa = PBXGroup; - children = ( - A246FB040A2BD6F9005BDF7B /* PSMTabBarControlDoc.html */, - ); - name = Documentation; - sourceTree = ""; - }; - A251BE590959A0550058BC7F /* Demo App */ = { - isa = PBXGroup; - children = ( - A251BE890959A1EA0058BC7F /* AppController.h */, - A251BE8A0959A1EA0058BC7F /* AppController.m */, - A2A711BD09E5BF0500D0089B /* WindowController.h */, - A2A711BE09E5BF0500D0089B /* WindowController.m */, - A251BE8B0959A1EA0058BC7F /* FakeModel.h */, - A251BE8C0959A1EA0058BC7F /* FakeModel.m */, - A251BE8D0959A1EA0058BC7F /* main.m */, - ); - name = "Demo App"; - sourceTree = ""; - }; - A251BE8E0959A21A0058BC7F /* Images */ = { - isa = PBXGroup; - children = ( - A2C0D99309AF870000ED379C /* pi.png */, - A2072B5C09AC1FA500304BCB /* Warning.png */, - A2072A2409ABD88600304BCB /* Folder.tif */, - A2072A2509ABD88600304BCB /* Globe.tiff */, - A268E7F809A9822900E082AA /* AquaTabNew.png */, - A268E7F909A9822900E082AA /* AquaTabNewPressed.png */, - A268E7FA09A9822900E082AA /* AquaTabNewRollover.png */, - A268E7FB09A9822900E082AA /* TabNewMetal.png */, - 523897F115BDA9AC00498A53 /* TabNewMetal@2x.png */, - A268E7FC09A9822900E082AA /* TabNewMetalPressed.png */, - 523897F215BDA9AC00498A53 /* TabNewMetalPressed@2x.png */, - A268E7FD09A9822900E082AA /* TabNewMetalRollover.png */, - 523897F315BDA9AC00498A53 /* TabNewMetalRollover@2x.png */, - A269361009A778770006911E /* 32x32_log.tiff */, - A2D3317A09A68B7500EC8662 /* AquaTabsDownGraphite.png */, - A2D3317B09A68B7500EC8662 /* AquaTabsDownNonKey.png */, - A2D32EF009A63BF700EC8662 /* AquaTabClose_Front_Pressed.tif */, - A2D32EF109A63BF700EC8662 /* AquaTabClose_Front_Rollover.tif */, - A2D32EF209A63BF700EC8662 /* AquaTabClose_Front.tif */, - A2D32EF309A63BF700EC8662 /* AquaTabsBackground.png */, - A2D32EF409A63BF700EC8662 /* AquaTabsDown.png */, - A2D32EF509A63BF700EC8662 /* AquaTabsSeparator.png */, - A2D32EF609A63BF700EC8662 /* AquaTabsSeparatorDown.png */, - A251BE8F0959A23A0058BC7F /* 32x32cancel.png */, - 52C268CE15BDB72B0012FECA /* overflowImage.png */, - 52C0B9B215BDB7A9000C268F /* overflowImage@2x.png */, - 52C268CF15BDB72B0012FECA /* overflowImagePressed.png */, - 52C0B9B315BDB7A9000C268F /* overflowImagePressed@2x.png */, - 52A57C0C15BBA230003EC59C /* TabClose_Front.png */, - 523897F015BDA9AC00498A53 /* TabClose_Front@2x.png */, - 52A57C0D15BBA230003EC59C /* TabClose_Front_Pressed.png */, - 523897EE15BDA9AC00498A53 /* TabClose_Front_Pressed@2x.png */, - 52A57C0E15BBA230003EC59C /* TabClose_Front_Rollover.png */, - 523897EF15BDA9AC00498A53 /* TabClose_Front_Rollover@2x.png */, - 52FAFCCD1C30F4B500C6E613 /* TabNewYosemite.png */, - 52FAFCCE1C30F4B500C6E613 /* TabNewYosemite@2x.png */, - ); - name = Images; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 53DF68F8067E5B5A0090B5B0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 546DEAF2067F630E0098DCC4 /* PSMTabBarControl.h in Headers */, - A251BE850959A1B90058BC7F /* PSMOverflowPopUpButton.h in Headers */, - A251BE870959A1B90058BC7F /* PSMTabBarCell.h in Headers */, - 52FAFCD31C30F4DF00C6E613 /* PSMYosemiteTabStyle.h in Headers */, - A2D32EDC09A634C900EC8662 /* PSMTabStyle.h in Headers */, - A2D32F0009A63D7A00EC8662 /* PSMMetalTabStyle.h in Headers */, - A268EA6209A9831800E082AA /* PSMRolloverButton.h in Headers */, - A2129BB209AEB58F00724E6C /* PSMProgressIndicator.h in Headers */, - A2082A9009EAEB34009AC8BE /* PSMTabDragAssistant.h in Headers */, - A2D98B0A0A2B432C0064C6F8 /* PSMUnifiedTabStyle.h in Headers */, - A2D98B120A2B43FA0064C6F8 /* NSBezierPath_AMShading.h in Headers */, - 90AD234F21A969C100CEF036 /* PSMMojaveTabStyle.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 53DF68FC067E5B5A0090B5B0 /* PSMTabBarControlFramework */ = { - isa = PBXNativeTarget; - buildConfigurationList = C056397F08A954F8003078D8 /* Build configuration list for PBXNativeTarget "PSMTabBarControlFramework" */; - buildPhases = ( - 53DF68F8067E5B5A0090B5B0 /* Headers */, - 53DF68F9067E5B5A0090B5B0 /* Resources */, - 53DF68FA067E5B5A0090B5B0 /* Sources */, - 53DF68FB067E5B5A0090B5B0 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PSMTabBarControlFramework; - productName = PSMTabBarControlFramework; - productReference = 53DF68FD067E5B5A0090B5B0 /* PSMTabBarControl.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 0259C573FE90428111CA0C5A /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0710; - }; - buildConfigurationList = C056398B08A954F8003078D8 /* Build configuration list for PBXProject "PSMTabBarControl" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - en, - ); - mainGroup = 0259C574FE90428111CA0C5A /* PSMTabBarControl */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 53DF68FC067E5B5A0090B5B0 /* PSMTabBarControlFramework */, - 53DF6901067E5B8E0090B5B0 /* All */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 53DF68F9067E5B5A0090B5B0 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A2D32EF709A63BF700EC8662 /* AquaTabClose_Front_Pressed.tif in Resources */, - A2D32EF809A63BF700EC8662 /* AquaTabClose_Front_Rollover.tif in Resources */, - A2D32EF909A63BF700EC8662 /* AquaTabClose_Front.tif in Resources */, - A2D32EFA09A63BF700EC8662 /* AquaTabsBackground.png in Resources */, - A2D32EFB09A63BF700EC8662 /* AquaTabsDown.png in Resources */, - A2D32EFC09A63BF700EC8662 /* AquaTabsSeparator.png in Resources */, - A2D32EFD09A63BF700EC8662 /* AquaTabsSeparatorDown.png in Resources */, - A2D3317C09A68B7500EC8662 /* AquaTabsDownGraphite.png in Resources */, - A2D3317D09A68B7500EC8662 /* AquaTabsDownNonKey.png in Resources */, - A268E80409A9822A00E082AA /* AquaTabNew.png in Resources */, - A268E80509A9822A00E082AA /* AquaTabNewPressed.png in Resources */, - A268E80609A9822A00E082AA /* AquaTabNewRollover.png in Resources */, - A268E80709A9822A00E082AA /* TabNewMetal.png in Resources */, - A268E80809A9822A00E082AA /* TabNewMetalPressed.png in Resources */, - A268E80909A9822A00E082AA /* TabNewMetalRollover.png in Resources */, - A2C0D99509AF870000ED379C /* pi.png in Resources */, - A27E47850A28EE76007BA395 /* TabIcon.tif in Resources */, - A27E47880A28EE7C007BA395 /* TabControlRep.tif in Resources */, - 52A57C0F15BBA230003EC59C /* TabClose_Front.png in Resources */, - 52A57C1015BBA230003EC59C /* TabClose_Front_Pressed.png in Resources */, - 90DE16CC21A955EE004F0124 /* Media.xcassets in Resources */, - 52A57C1115BBA230003EC59C /* TabClose_Front_Rollover.png in Resources */, - 52FAFCCF1C30F4B500C6E613 /* TabNewYosemite.png in Resources */, - 523897F415BDA9AC00498A53 /* TabClose_Front_Pressed@2x.png in Resources */, - 523897F515BDA9AC00498A53 /* TabClose_Front_Rollover@2x.png in Resources */, - 52FAFCD01C30F4B500C6E613 /* TabNewYosemite@2x.png in Resources */, - 523897F615BDA9AC00498A53 /* TabClose_Front@2x.png in Resources */, - 523897F715BDA9AC00498A53 /* TabNewMetal@2x.png in Resources */, - 523897F815BDA9AC00498A53 /* TabNewMetalPressed@2x.png in Resources */, - 523897F915BDA9AC00498A53 /* TabNewMetalRollover@2x.png in Resources */, - 52C268D015BDB72B0012FECA /* overflowImage.png in Resources */, - 52C268D115BDB72B0012FECA /* overflowImagePressed.png in Resources */, - 52C0B9B415BDB7A9000C268F /* overflowImage@2x.png in Resources */, - 52C0B9B515BDB7A9000C268F /* overflowImagePressed@2x.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 53DF68FA067E5B5A0090B5B0 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 546DEAF1067F63070098DCC4 /* PSMTabBarControl.m in Sources */, - A251BE860959A1B90058BC7F /* PSMOverflowPopUpButton.m in Sources */, - A251BE880959A1B90058BC7F /* PSMTabBarCell.m in Sources */, - A2D32F0109A63D7A00EC8662 /* PSMMetalTabStyle.m in Sources */, - A268EA6309A9831800E082AA /* PSMRolloverButton.m in Sources */, - A2129BB309AEB58F00724E6C /* PSMProgressIndicator.m in Sources */, - 90AD235021A969C100CEF036 /* PSMMojaveTabStyle.m in Sources */, - A2082A9109EAEB34009AC8BE /* PSMTabDragAssistant.m in Sources */, - 52FAFCD41C30F4DF00C6E613 /* PSMYosemiteTabStyle.m in Sources */, - A2D98B0B0A2B432C0064C6F8 /* PSMUnifiedTabStyle.m in Sources */, - A2D98B130A2B43FA0064C6F8 /* NSBezierPath_AMShading.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 53DF6905067E5B930090B5B0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 53DF68FC067E5B5A0090B5B0 /* PSMTabBarControlFramework */; - targetProxy = 53DF6904067E5B930090B5B0 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 0259C57EFE90428111CA0C5A /* PSMTabBarControlInspector.nib */ = { - isa = PBXVariantGroup; - children = ( - 0259C57FFE90428111CA0C5A /* English */, - ); - name = PSMTabBarControlInspector.nib; - sourceTree = ""; - }; - 0259C580FE90428111CA0C5A /* PSMTabBarControlPalette.nib */ = { - isa = PBXVariantGroup; - children = ( - 0259C581FE90428111CA0C5A /* English */, - ); - name = PSMTabBarControlPalette.nib; - sourceTree = ""; - }; - 8D1AC97F0486D23B00FE50C9 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 8D1AC97B0486D23100FE50C9 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - A251BEC20959BC0E0058BC7F /* MainMenu.nib */ = { - isa = PBXVariantGroup; - children = ( - A251BEC30959BC0E0058BC7F /* English */, - ); - name = MainMenu.nib; - sourceTree = ""; - }; - A2A711B909E5AE1E00D0089B /* Window.nib */ = { - isa = PBXVariantGroup; - children = ( - A2A711BA09E5AE1E00D0089B /* English */, - ); - name = Window.nib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C056398008A954F8003078D8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = NO; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - GCC_VERSION = ""; - INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist"; - INSTALL_PATH = "@executable_path/../Frameworks"; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.positivespinmedia.PSMTabBarControlFramework; - PRODUCT_NAME = PSMTabBarControl; - SYMROOT = ../build; - ZERO_LINK = NO; - }; - name = Debug; - }; - C056398108A954F8003078D8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - GCC_VERSION = ""; - INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist"; - INSTALL_PATH = "@executable_path/../Frameworks"; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.positivespinmedia.PSMTabBarControlFramework; - PRODUCT_NAME = PSMTabBarControl; - SYMROOT = ../build; - }; - name = Release; - }; - C056398808A954F8003078D8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - PRODUCT_NAME = All; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - ZERO_LINK = YES; - }; - name = Debug; - }; - C056398908A954F8003078D8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - PRODUCT_NAME = All; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - }; - name = Release; - }; - C056398C08A954F8003078D8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ENABLE_TESTABILITY = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; - SYMROOT = ../build; - }; - name = Debug; - }; - C056398D08A954F8003078D8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; - SYMROOT = ../build; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C056397F08A954F8003078D8 /* Build configuration list for PBXNativeTarget "PSMTabBarControlFramework" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C056398008A954F8003078D8 /* Debug */, - C056398108A954F8003078D8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C056398708A954F8003078D8 /* Build configuration list for PBXAggregateTarget "All" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C056398808A954F8003078D8 /* Debug */, - C056398908A954F8003078D8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C056398B08A954F8003078D8 /* Build configuration list for PBXProject "PSMTabBarControl" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C056398C08A954F8003078D8 /* Debug */, - C056398D08A954F8003078D8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 0259C573FE90428111CA0C5A /* Project object */; -} diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControlFramework-Info.plist b/src/MacVim/PSMTabBarControl/PSMTabBarControlFramework-Info.plist deleted file mode 100644 index 3e49e9a9d0..0000000000 --- a/src/MacVim/PSMTabBarControl/PSMTabBarControlFramework-Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - PSMTabBarControl - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - PSM1 - CFBundleVersion - 1.1 - NSPrincipalClass - PSMTabBarControl - - diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControl_Prefix.pch b/src/MacVim/PSMTabBarControl/PSMTabBarControl_Prefix.pch deleted file mode 100644 index 65df9ffedb..0000000000 --- a/src/MacVim/PSMTabBarControl/PSMTabBarControl_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'PSMTabBarControl' target in the 'PSMTabBarControl' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/src/MacVim/PSMTabBarControl/ReadMe.rtfd/TXT.rtf b/src/MacVim/PSMTabBarControl/ReadMe.rtfd/TXT.rtf deleted file mode 100644 index acd9372a24..0000000000 --- a/src/MacVim/PSMTabBarControl/ReadMe.rtfd/TXT.rtf +++ /dev/null @@ -1,186 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf380 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; -\f3\fnil\fcharset77 Monaco;} -{\colortbl;\red255\green255\blue255;\red118\green15\blue80;\red0\green0\blue255;\red35\green110\blue37; -} -{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}} -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc\pardirnatural - -\f0\b\fs24 \cf0 \ -PSMTabBarControl (and related classes)\ - -\f1\b0 developed by John Pannell, Positive Spin Media\ -\ -as seen in the super-cool app...\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc\pardirnatural -\cf0 {{\NeXTGraphic startpage.gif \width7200 \height2820 -}�}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc\pardirnatural -\cf0 \ -\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -\cf0 This source code and all related materials are released under the BSD license, which is explained at the end of this document, along with some other legalese. I've made my best effort to make everything bug free, but please let me know of any bugs found or suggestions you have: johnp@positivespinmedia.com.\ -\ - -\f0\b Purpose -\f1\b0 \ -\ -PSMTabBarControl seeks to provide developers with a high-quality, easy to use GUI to manage an NSTabView (or subclasses) in a manner similar to Safari's tabbed browsing implementation. It attempts to add a few features as well. Here's what you get:\ -\ - -\f0\b The look: -\f1\b0 a control/cell architecture that draws the expected tab appearance below a toolbar or similar view. Included styles work consistently in Aqua, Metal, or customized metal variations by basing fills on the window's background color. Includes drawing of a close button, and rollover states for the close button and tab cell. Also provides pop-up button and menu when tabs overflow available space, and support for individual tab progress indicators, icons, and object counters. Tabs can be drawn sized to fit the string content of the label, or uniformly sized.\ -\ - -\f0\b The functionality: -\f1\b0 Close button removes tabs, click on a tab cell selects. Indicators start, stop, and hide if things are hooked up correctly.\ -\ - -\f0\b Extras: -\f1\b0 Supports multi-window drag-and-drop reordering of the tabs with aqua-licious animation.\ -\ - -\f0\b Files -\f1\b0 \ -\ -Your project will need the files in the "Framework" folder of the project. The actual framework packages these (and some images) up nicely for you, if desired. Please look over the "TabBarControlDemo" target of the source code project to see exactly what is needed to get everything to build. Building and playing with the demo is also a good way to get a feel for the features provided by these classes.\ -\ - -\f0\b Usage -\f1\b0 \ -\ -Simply drag a custom view object from the views palette in IB, read the PSMTabBarControl class into IB, and set the view's custom class to PSMTabBarControl. Then connect the control's tabview outlet to the tab view being controlled, and make the control the delegate of the tab view. You can also connect the control's "partner view" outlet to another view that will resize in response to the hide/show behavior of the control.\ -\ -Alternately, you can build the Palette subproject and add the built IB palette to Interface Builder. In this case, creating and configuring an instance is as easy and drag, drop, and a few clicks. A demo movie and the built palette are available in a separate download from my website: http://www.positivespinmedia.com/dev/PSMTabBarControl.html\ -\ - -\f2\i Please read the PSMTabBarControlDoc.html file in the documentation folder of this project. It provides an Apple-ish page describing the interface and usage of this object. -\f1\i0 \ -\ - -\f0\b Patterns of Use -\f1\b0 \ -\ -There are a few random notes I can think of for usage guidelines...\ -\ -- You may see a line between the toolbar and the control in your app; it is part of the toolbar. In Tiger, you can eliminate the appearance of this line:\ -\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f3\fs20 \cf0 \CocoaLigature0 SInt32 MacVersion;\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural -\cf2 if\cf0 (Gestalt(gestaltSystemVersion, &MacVersion) == noErr)\{\ - \cf2 if\cf0 (MacVersion >= \cf3 0x1040\cf0 )\{\ - \cf4 // this call is Tiger only\cf0 \ - [toolbar setShowsBaselineSeparator:\cf2 NO\cf0 ];\ - \}\ -\}\ -\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f1\fs24 \cf0 - In general, there is no reason for your app objects to communicate (outside of configuration) with the PSMTabBarControl at all. Changes made to the NSTabView instance programmatically should be directed at the NSTabView instance itself, and the control will update to reflect the changes made.\ -\ -- Your app might want to receive tab view delegate notifications in order to perform some actions. No problem, simply make the desired object the delegate of the PSMTabBarControl instance... it passes along all tab view notifications. Note that it uses these notifications to make changes itself - read the source code to make sure you aren't tripping over something.\ -\ -- The control creates bindings between each cell's progress indicator and the represented NSTabViewItem's identifier object, if it can. In my app design, I set an instance of NSObjectController as the NSTabViewItem's identifier, and then bind to the "isProcessing" key of the controller's content object. All of this can be seen in the source of the demo app...\ -\ -- The control can be set to hide itself when there is only a single tab, and can also be told to hide/show on demand. It can animate to appear and disappear, and will resize something to compensate for the missing window real estate. By default, it will resize the window, but you can also connect the "partnerView" outlet in IB to specify another view to resize to take up the missing space. Note that this takes some attention to sizing springs and wires to get right, and complex views may need a container view to achieve the desired effect.\ -\ -- The control can be configured to draw an attractive "Add Tab" button at the end of the tab cells. Unfortunately, the button is all looks and no brains - it has no idea what your app wants to do when adding a tab. If you configure your app to show the add tab button, you need to hook up the add tab button to the proper target with the proper selector. Something like this will do nicely in your app controller's awakeFromNib:\ -\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f3\fs20 \cf4 // hook up add tab button\cf0 \ -[[tabBar addTabButton] setTarget:\cf2 self\cf0 ];\ -[[tabBar addTabButton] setAction:\cf2 @selector\cf0 (addNewTab:)]; -\f1\fs24 \ -\ -- The tabs have some sizing options: You can specify the minimum width, maximum width, and optimum width, as well as spcifying if the tabs should size to fit their label or not. The sizing bahavior of the tabs is as follows: If "size to fit" is specified, then tabs will be generated to fit the label, but will never exceed the specified max or min widths. Once the end of the control is reached, the overflow menu will appear as tabs are added; the last tab will squeeze in if it can, or the remaining tabs will stretch to occupy the full control. If "size to fit" is not specified, then all successive tabs will appear at the optimum width. Once the end of the control is reached, adding new tabs will cause all tabs to shrink to accomodate, until the minumum width is reached, and then the overflow menu will be used; max width is ignored in this case. Hopefully that all makes sense :-)\ -\ -- PSMTabBarControl will load the existing tabs from the tabView outlet at startup. However, many of the advanced features (icon display, progress indicator, object count) rely on binding to a controller that is likely not set up in IB. Solution? Nuke the existing tabs in the NSTabView and add new ones, configured the way you like. The demo app does this in the awakeFromNib: method of the app controller.\ -\ -- As a design choice, I elected to keep a cell object around until its tab was closed, instead of "churning" cell objects in each update cycle. Each cell keeps its NSTabViewItem as its representedObject and maintains reference that way, rather than by any index. As a result of this, drag-and-drop reordering of tabs does not change the underlying NSTabView instance at all. All that to say: don't rely on numerical indices if communicating with both the control and the tab view - the indices may not correlate if the user moved some tabs around (and remember - you shouldn't need to communicate with the control anyway :-). The Shiira Project, from which I gained much insight and inspiration from for this UI element, elected to scrap and rebuild the array of cells each time through the update cycle, and rely on indices to correlate between cells and NSTabViewItems. I felt the representedObject route was cleaner, and preferred not to churn objects.\ -\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f0\b \cf0 Improvements? -\f1\b0 \ -\ -Pipe up if you think of something you'd like to see; here's my current list:\ -\ -- "Pop-up" tabs - like pop-up folders in the finder, in case you want to drag to a destination in another tab.\ -- Support for the -\f3\fs22 \CocoaLigature1 NSUnifiedTitleAndToolbarWindowMask -\f1\fs24 \CocoaLigature0 "unified" window appearance. (Help! I really searched around to try to make this work... the color pattern of the title and toolbar seem to be top secret! The new "unified" style is an excellent replication of a unified look, but isn't "built from" the unified appearance like the metal is.)\ -- During multi-window drag, having a "drag window/image" that shows the represented view getting moved to the other window.\ -- During multi-window drag, support for dragging out solo tabs to consolidate in another window, removing the source window in the process.\ -- Support vertical as well as horizontal alignment.\ -\ - -\f0\b Version History -\f1\b0 \ -\ -Version 1.3 (May 29, 2006)\ -- new feature: Unified tab style, compliments of Keith Blount\ -- new feature: allow multi-window drag config option (again from Keith).\ -- fixed bug: Palette installation/usage instructions were wrong.\ -- enhancement: exposed the -\f3\fs20 representedTabViewItems -\f1\fs24 method, which can be used to retrieve the order of the tabs as displayed in the control, since the underlying NSTabView does not get reordered during drag and drop rearrangement.\ -\ -Version 1.2 (April 20, 2006)\ -- new feature: multi-window drag and drop support.\ -- bug fixed: zombie issue with tabView:didCloseTabViewItem\ -- bugs fixed: some drawing issues around the progress indicators in tabs, and the add tab button.\ -- enhancement: the hide/show animation has been improved with less "flickering" of progress indicators during the hide and show.\ -\ -Version 1.1.2 (April 5, 2006)\ -- fixed bug: tabs of non-integer width resulted in occasional anti-aliased drawing issues of dividers between tabs in the Metal style (Thanks, Kent).\ -- added feature: delegate can now respond to -tabView:shouldCloseTabViewItem: and -tabView:willCloseTabViewItem:, and -tabView:didCloseTabViewItem: messages, so your app can take care of any needed setup/cleanup for these actions.\ -- fixed bug: tab close buttons now show down state when pressed down.\ -\ -Version 1.1.1 (March 16, 2006)\ -- fixed bug: Palette inspector would not reflect state of previously instantiated control. This has been fixed (Thanks, Guillaume).\ -- enhancement: Overflow button now highlights when mouse down (Thanks, Kent).\ -- fixed bug: when set to not close a solo tab, the close button would be hidden for the tab, but could still be closed if you clicked the tab in the right location. This has been fixed (Thanks, malcom).\ -\ -Version 1.1 (March 10, 2006)\ -- Bound the "title" of the cell to the "label" of the source tabview item. Just in case you wanted to change the label on the tab during the running of your application.\ -- PSMTabBarCell factored to support new tab "styles", or appearances in drawing. Now supported are the existing "Metal" style and a new "Aqua" style. Many thanks to David Smith, Seth Willits, and Chris Forsythe for their contributions!\ -- Control can be configured to "Hide for single tab", so it doesn't appear unless there are more than a single tab view present. Features animated show/hide behavior (that can be called anytime, and is called automatically in the case that a single tab exists). The show/hide behavior can also be set up to resize either the window (default) or a selected "partner view" to compensate for the lost height of the tab bar.\ -- Control can be configured for "Can close only tab" behavior. If set to NO, no close button will appear on a lone tab.\ -- Cells can be set to "size to fit", or given uniform min/max/optimum sizes.\ -- Added support for display of an icon and an object count, if the proper app design pattern is followed.\ -- Sweet animated drag-and-drop drawing!\ -- A few drawing bugs surrounding the progress indicators in cells were squished.\ -- New documentation, in case you found this read me a little pithy.\ -\ -Version 1.0 (December 2005)\ -Initial release of safari-like tab implementation.\ -\ - -\f0\b The standard disavowal of this beautiful mess -\f1\b0 \ -\ -I should note that portions of this source code were inspired by the Shiira project's implementation of Safari-style tabs. While I made some different design decisions, the drawing and some other aspects are only slight modifications of their excellent work. As such, I note their copyright under their BSD licence:\ -\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f3\fs20 \cf4 Portions of this software Copyright 2004 The Shiira Project. All rights reserved.\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f1\fs24 \cf0 Check them out at: http://hmdt-web.net/shiira/\ -\ -This source code is provided under BSD license, the conditions of which are listed below. I hope you'll make note somewhere in your about window or ReadMe stating the sweet coding goodness of Positive Spin Media and link to the fascinating and informative website at www.positivespinmedia.com\ -\ -\pard\pardeftab720\sa320\ql\qnatural -\cf0 \CocoaLigature1 Copyright (c) 2005, Positive Spin Media\uc0\u8232 All rights reserved.\ -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\ -\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural -\ls1\ilvl0\cf0 {\listtext \'a5 }Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\ -{\listtext \'a5 }Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\ -{\listtext \'a5 }Neither the name of Positive Spin Media nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\ - \ -\pard\pardeftab720\sa320\ql\qnatural -\cf0 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\CocoaLigature0 \ -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/ReadMe.rtfd/startpage.gif b/src/MacVim/PSMTabBarControl/ReadMe.rtfd/startpage.gif deleted file mode 100644 index 8707a77ab0af2648e9e13dd44e44982eaee9c85a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11246 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 N{Tml;OacJC{{wL3HY@-D diff --git a/src/MacVim/PSMTabBarControl/TabBarControlDemo-Info.plist b/src/MacVim/PSMTabBarControl/TabBarControlDemo-Info.plist deleted file mode 100644 index 673218b406..0000000000 --- a/src/MacVim/PSMTabBarControl/TabBarControlDemo-Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - com.positivespinmedia.TabBarControlDemo - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.1 - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/src/MacVim/PSMTabBarControl/documentation/PSMTabBarControlDoc.html b/src/MacVim/PSMTabBarControl/documentation/PSMTabBarControlDoc.html deleted file mode 100644 index fa8b99009a..0000000000 --- a/src/MacVim/PSMTabBarControl/documentation/PSMTabBarControlDoc.html +++ /dev/null @@ -1,301 +0,0 @@ - - - - - PSMTabBarControl - Safari-style Tabs (Objective-C) - - - - - - - - -

PSMTabBarControl

- - - -
Inherits from
Conforms to
Declared in
PSMTabBarControl.h
-

Class Description

- -

PSMTabBarControl provides a user interface for the management of tabbed views that has an appearance similar to Apple's Safari web browser.

-

Internally, PSMTabBarControl uses a custom cell class and supporting style objects to implement its user interface.

-

Currently, this object supports "Aqua" and "Metal" tab styles to present an appearance consistent with the rest of your application. Numerous configuration options exist to customize behavior, as outlined below. PSMTabBarControl instances require a few specific connections with other application objects to perform properly at runtime:

-
    -
  • The control's "tabView" outlet must be connected to the desired NSTabView instance in Interface Builder, or set programmatically with the setTabView: method.
  • -
  • The "delegate" outlet of the NSTabView being controlled must be connected to the instance of PSMTabBarControl, either programmatically or in IB.
  • -
  • Optionally, you may connect the control's "partnerView" outlet to a view that will be resized to compensate when PSMTabBarControl changes size due to hide/show behavior. If no connection is made, PSMTabBarControl will resize the window in response to hide/show messages.
  • -
-

A PSMTabBarControl instance should occupy the width of the window, and should be precisely 22 pixels in height. It should be resizable in width, but not height. It can be placed at the top or botton of the window (or anywhere in between, if desired).

-

Outside of configuring it, your application should have little interaction with this class. The presented tabs will change in conjunction with changes your application makes in the NSTabView being controlled.

- -

A Usage Pattern

- -

PSMTabBarControl becomes even more powerful if your application design matches an expected pattern: the control attempts to bind a number of tab attributes to the NSTabViewItem's identifier object if possible. These visible attributes include a progress indicator, an icon, and an object counter. Additionally, the control binds each tab's title to the label of the represented NSTabViewItem.

- -

Taking advantage of these features requires no glue code on your part, but it does require providing a particular object graph. Here's the basics...

- -
  • For each tab that is created, your application should have a model object that keeps the state of model attributes: isProcessing (a BOOL), objectCount (an int), and icon (an NSImage). You can pick and choose any number of these to support, or none, at your option. -
  • Your application should create an NSObjectController to control your model (the model object is the "content" of the NSObjectController instance). -
  • When you create new tabs (via the NSTabView interface), you should set the object controller instance to be the identifier object of the newly created NSTabViewItem object.
- -

The demo application included with this project illustrates a very quick way to accomplish these goals. If this pattern is followed, PSMTabBarControl will take care of the rest.

- - -

Methods by Task

-

Setting needed connections

-
– setTabView:

Specifies the instance of NSTabView to be controlled.

- -
– tabView

Returns the instance of NSTabView being controlled.

- -

Setting optional connections

-
– setPartnerView:

Specifies a view that will resize to compensate for control size changes in response to hide and show messages.

- -
– partnerView

Returns the instance of a view that will resize to compensate for control size changes in response to hide and show messages.

- -
– setDelegate:

Specifies an object that will receive delegate messages as passed through from the NSTabView instance.

- -
– delegate:

Returns the specified delegate object.

- -

Control configuration

-
– canCloseOnlyTab

Returns YES if the user is allowed to close a tab when it is the only tab left, NO otherwise.

- -
– setCanCloseOnlyTab:

Controls whether the receiver will present a close button for a single tab in a tab bar.

- -
– styleName

Returns the name of the current drawing style. "Aqua", "Metal", and "Unified" are the currently supported options.

- -
– setStyleNamed:

Specifies the style in which the tabs and control are drawn. "Aqua", "Metal", and "Unified" are the currently supported options.

- -
– hideForSingleTab

Returns YES if the control will hide if there is only one tab left, NO otherwise.

- -
– setHideForSingleTab:

Controls whether the receiver will hide when the user closes all but a single tab in a tab bar.

- -
– showAddTabButton

Returns YES if the control will display a small "add tab" button at the rightmost end of the tabs, NO otherwise.

- -
– setShowAddTabButton:

Controls whether the receiver will will display a small "add tab" button at the rightmost end of the tabs.

- -
– cellMinWidth

Returns the minimum width (in pixels) that a tab will be allowed to occupy.

- -
– setCellMinWidth:

Specifies the maximum width (in pixels) that a tab will be allowed to occupy.

- -
– cellMaxWidth

Returns the maximum width (in pixels) that a tab will be allowed to occupy.

- -
– setCellMaxWidth:

Specifies the maximum width (in pixels) that a tab will be allowed to occupy.

- -
– cellOptimumWidth

Returns the default width (in pixels) that a tab will be allowed to occupy when tabs are drawn with uniform size.

- -
– setCellMaxWidth:

Specifies the default width (in pixels) that a tab will be allowed to occupy when tabs are drawn with uniform size.

- -
– sizeCellsToFit

Returns YES if the control will make the tabs sized to fit the content of the tab, NO otherwise.

- -
– setSizeCellsToFit:

Controls whether the receiver will make the tabs sized to fit the content of the tab.

- -
– allowsDragBetweenWindows

Returns YES if the control allows a user to drag a tab to another instance of this control, NO otherwise.

- -
– setAllowsDragBetweenWindows:

Controls whether the receiver will allow a user to drag a tab to another instance of this control.

- -

Internal UI components

-
– addTabButton

Returns an instance of an NSButton subclass that is used to present the "add tab" button. If "showAddTabButton" is YES, developers must use this method to access the button and specify a target and action for the button.

- -
– overflowPopUpButton

Returns an instance of an NSPopUpButton subclass that is used to present the overflow menu (which shows when there are more tabs than can fit across the control).

- -
– representedTabViewItems

Returns an array of the NSTabViewItems represented by the tabs in the control. Useful if you want to archive the order of the tabs between runs of your program.

- -

Visibility

-
– hideTabBar:animate:

If desired, obejcts can tell the tab bar to hide (reduce in size to a single pixel line spanning the window) or show, and optionally whether to animate this effect or not.

- -

Instance Methods

- -

addTabButton

-

Returns an instance of an NSButton subclass that is used to present the "add tab" button. If "showAddTabButton" is YES, developers must use this method to access the button and specify a target and action for the button.

- (PSMRolloverButton *)addTabButton;

-
Discussion

If you have configured the control to show the add tab button, you must use this method to access the button and set the target and action for it. Example:

[[tabBar addTabButton] setTarget:self];
-[[tabBar addTabButton] setAction:@selector(addNewTab:)];

-
See Also
- -

allowsDragBetweenWindows

-

Returns YES if the control allows a user to drag a tab to another instance of this control, NO otherwise.

- (BOOL)allowsDragBetweenWindows

-
Discussion

The default is YES.

-
See Also
- -

canCloseOnlyTab

-

Returns YES if the receiver has been configured to allow users to close a single remaining tab.

- (BOOL)canCloseOnlyTab

-
Discussion

The default is NO.

-
See Also
- -

cellMaxWidth

-

Returns the maximum width (in pixels) that a tab will be allowed to occupy.

- (int)cellMaxWidth

-
Discussion

The cellMaxWidth value applies to both uniformly sized tabs, and tabs that are sized to fit. No tab will be drawn wider than the specified value.

-
See Also
- -

cellMinWidth

-

Returns the minimum width (in pixels) that a tab will be allowed to occupy.

- (int)cellMinWidth

-
Discussion

The cellMinWidth value applies only to uniformly sized tabs. No tab will be drawn smaller than the specified value. Size-to-fit tabs ignore this value, and are made just small enough to fit their content.

-
See Also
- -

cellOptimumWidth

-

Returns the width (in pixels) that a tab will be made to occupy if the tabs are uniformly sized.

- (int)cellOptimumWidth

-
Discussion

The cellOptimumWidth value applies only to uniformly sized tabs. All tabs will be drawn at the specified value. Size-to-fit tabs ignore this value, and are made just small enough to fit their content.

-
See Also
- -

delegate

-

Returns the object that will be sent passed-through NSTabView delegate messages.

- (id)delegate

-
See Also
- -

hideForSingleTab

-

Returns YES if the receiver has been configured to hide if there is a single remaining tab.

- (BOOL)hideForSingleTab

-
Discussion

The default is NO.

-
See Also
- -

hideTabBar:animate:

-

If desired, obejcts can tell the tab bar to hide (reduce in size to a single pixel line spanning the window) or show, and optionally whether to animate this effect or not.

- (void)hideTabBar:(BOOL)hide animate:(BOOL)animate

-
Discussion

If hide is YES the control will shrink to a single pixel line spanning the window; otherwise the control will expand to its normal appearance. If animate is YES, the shrinking and expanding will happen in a visible animation; otherwise the transition will be instant. There is no effect if the control is already in the specified state.

- -

overflowPopUpButton

-

Returns an instance of an NSPopUpButton subclass that is used to present the overflow menu.

- (PSMOverflowPopUpButton *)overflowPopUpButton;

-
Discussion

This method could be used to modify the button or menu if desired.

- -

partnerView

-

Returns the object that will be resized to compensate for the changing size of the control during hide/show behavior.

- (id)partnerView

-
Discussion

If a partnerView has not been specified, the window will be resized during hide/show.

-
See Also
- -

representedTabViewItems

-

Returns an array of NSTabViewItems, ordered according to the display order of the tabs in the control.

- (NSMutableArray *)representedTabViewItems;

-
Discussion

This method could be used archive the order of the tabs between application runs. When the user reorders tabs via drag and drop, the represented NSTabView does not change order.

- -

setAllowsDragBetweenWindows

-

If set to YES, the receiver is configured to allow users to drag a tab to an instance of PSMTabBarControl in another window.

- (void)setAllowsDragBetweenWindows:(BOOL)value

-
Discussion

The default is YES.

-
See Also
- -

setCanCloseOnlyTab:

-

If set to YES, the receiver is configured to allow users to close a single remaining tab.

- (void)setCanCloseOnlyTab:(BOOL)value

-
Discussion

The default is NO.

-
See Also
- -

setCellMaxWidth:

-

Specifies the maximum width (in pixels) that a tab will be allowed to occupy.

- (void)setCellMaxWidth:(int)value

-
Discussion

No tab will be drawn any wider than the specified value.

-
See Also
- -

setCellMinWidth:

-

Specifies the minimum width (in pixels) that a tab will be allowed to occupy.

- (void)setCellMinWidth:(int)value

-
Discussion

No tab will be drawn any smaller than the specified value. This value is ignored when drawing in size-to-fit; tabs are made just small enough to fit their content.

-
See Also
- -

setCellOptimumWidth:

-

Specifies the width (in pixels) that a tab will occupy when tabs are uniformly sized.

- (void)setCellOptimumWidth:(int)value

-
Discussion

This value is ignored when drawing in size-to-fit; tabs are made just small enough to fit their content.

-
See Also
- -

setDelegate:

-

Specifies an object that will receive delegate messages as passed through from the NSTabView instance.

- (void)setDelegate:(id)object

-
See Also
- -

setHideForSingleTab:

-

If set to YES, the receiver is configured to hide when there is a single remaining tab.

- (void)setHideForSingleTab:(BOOL)value

-
Discussion

The default is NO.

-
See Also
- -

setPartnerView:

-

Specifies a view that will resize to compensate for control size changes in response to hide and show messages.

- (void)setPartnerView:(id)view

-
Discussion

if nil, the control will resize the window in response to hide/show messages.

-
See Also
- -

setStyleNamed:

-

Specifies the style in which the tabs and control are drawn.

- (void)setStyleNamed:(NSString *)name

-
Discussion

"Aqua" and "Metal" are the currently supported options.

-
See Also
- -

setShowAddTabButton:

-

Controls whether the receiver will will display a small "add tab" button at the rightmost end of the tabs.

- (void)setShowAddTabButton:(BOOL)value

-
Discussion

Default is NO.

-
See Also
- -

setSizeCellsToFit:

-

Controls whether the receiver will make the tabs sized to fit the content of the tab.

- (void)setSizeCellsToFit:(BOOL)value

-
Discussion

Default is NO.

-
See Also
- -

setTabView:

-

Specifies the instance of NSTabView to be controlled.

- (void)setTabView:(NSTabView *)view

-
Discussion

This class will not function properly without this outlet being set.

-
See Also
- -

sizeCellsToFit

-

Returns YES if the control will make the tabs sized to fit the content of the tab, NO otherwise.

-

Discussion

The default is NO.

-
See Also
- -

styleName:

-

Returns the name of the current drawing style.

- (NSString *)styleName

-
Discussion

"Aqua" and "Metal" are the currently supported options.

-
See Also
- -

tabView:

-

Returns the instance of NSTabView being controlled.

- (NSTabView *)tabView

-
Discussion

This class will not function properly if this object is nil.

-
See Also
- -

Delegate Methods

- -

You application controller can keep track of activity from the tab view and the user via the following delegate methods.

- -

tabView:shouldCloseTabViewItem:

-

Sent when a user clicks the close button on a tab.

- (BOOL)tabView:(NSTabView *)tabView shouldCloseTabViewItem:(NSTabViewItem *)tabViewItem

-
Discussion

If you return NO, the tab will not be closed. Please make sure to alert the user as to why with a sheet or dialog.

- -

tabView:willCloseTabViewItem:

-

Sent when tab is about to be closed.

- (void)tabView:(NSTabView *)tabView willCloseTabViewItem:(NSTabViewItem *)tabViewItem

-
Discussion

This presents you with an opportunity to clean up the application objects/events/sessions represented by the tab.

- -

tabView:didCloseTabViewItem:

-

Sent after a tab has been closed.

- (void)tabView:(NSTabView *)tabView didCloseTabViewItem:(NSTabViewItem *)tabViewItem

-
Discussion

This presents you with an opportunity to clean up the application objects/events/sessions represented by the tab. Don't go trying to modify the tabViewItem - it is about to be released, and has already been removed from the tabView!

- -

tabView:didSelectTabViewItem:

-

Informs the delegate that tabView has selected tabViewItem.

- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem

- -

tabView:shouldSelectTabViewItem:

-

Invoked just before tabViewItem in tabView is selected.

- (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem

-
Discussion

The delegate can return NO to prevent selection of specific tabs.

- -

tabView:willSelectTabViewItem:

-

Informs the delegate that tabView is about to select tabViewItem.

- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem

- -

tabViewDidChangeNumberOfTabViewItems:

-

Informs the delegate that the number of tab view items in tabView has changed.

- (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)tabView

- - - - - - \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/documentation/frameset_styles.css b/src/MacVim/PSMTabBarControl/documentation/frameset_styles.css deleted file mode 100644 index 298e192a89..0000000000 --- a/src/MacVim/PSMTabBarControl/documentation/frameset_styles.css +++ /dev/null @@ -1,943 +0,0 @@ -/* link classes */ -A:link { COLOR: #0000FF; TEXT-DECORATION: none; } -A:link:hover { COLOR: #FF6600; TEXT-DECORATION: underline; } -A:active { COLOR: #FF6600; TEXT-DECORATION: underline; } - -/* apple.com site does not explicitly define visited link properties, but we do here */ -A:visited { COLOR: #0000AA; TEXT-DECORATION: none; } -A:visited:hover { COLOR: #FF6600; TEXT-DECORATION: underline; } - -/* used to convert otherCodeCharacters to code, thus saving character space in HTML for smaller file sizes */ -tt { - FONT-SIZE: 11px; FONT-FAMILY: monaco, courier, monospace; } - -/* redefine preformated text and code blocks */ -PRE { - FONT-SIZE: 11px; FONT-FAMILY: monaco, courier, monospace; margin-top: 5px; margin-bottom: 10px;} -CODE { - FONT-SIZE: 11px; FONT-FAMILY: monaco, courier, monospace; } - - -/* JavaScript toc frame */ -.jtoc_closed { background-color: #e9e9e9; } -.jtoc_open { background-color: #FFFFFF; padding-bottom: 10px; } -.jtoc_open_top_line {border-top: 1px solid #CCC; background-color: #fff; padding-bottom: 10px;} -.jtoc_open_bottom_line {border-bottom: 1px solid #CCC; background-color: #fff; padding-bottom: 10px;} -.jtoc_open_both_lines {border-bottom: 1px solid #CCC; border-top: 1px solid #CCC; background-color: #fff; padding-bottom: 10px;} - -/* frameset: toc frame */ -.toc_contents_text { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-weight: bold; padding-top: 4px 0; - color: #0000FF; -} -.toc_contents_text_open { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; - background: #FFFFFF; color: #0000FF; -} -.low_level_text { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 11px; padding: 4px 5px 4px 5px - color: #0000FF; -} - -#toc_contents_title { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 16px; color: #FFFFFF; font-weight: bold; -} -.toc_contents_heading { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-weight: bold; -} - -/* Special TOC heading for Help books only */ -.toc_contents_help_heading { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 14px; color: #330099; font-weight: bold; -} - -/* frameset: toc frame styles WEB AS. used for any document that uses the disclosure model for TOC like conceptural and procedural C documents*/ -#toc { - padding: 0 0 0 0; -} - -#toc p.download { - padding: 5px 10px; - margin: 0; - font-weight: normal; font-size: 11px; -} - -#toc_PDFbottomborder { - padding-top: 5px; - border-bottom: 1px solid #CCC; -} - - -#toc h2 { - margin: 0; - padding: 10px; - font-size: 15px; font-weight: bold; - border-bottom: 0px solid; -} - -#toc h3 { - margin: 6px 5px 0 10px; - font-size: 13px; font-weight: bold; color: black; -} - -#toc h4 { - font-size: 11px; font-weight: bold; color: black; - margin: -5px 0px 0 14px; -} - -#toc_staticbox { - padding: 0 0 0 0; - border: 1px solid #919699; - background: #e9e9e9; -} - -#toc ul { - list-style: none outside; - margin-left: 20px; margin-bottom: -2px; - padding: 0px; -} - -#toc ul ul{ - list-style: none outside; - margin-left: 10px; margin-bottom: -2px; - padding: 0px; -} - -#toc li a { - margin-left: 5px; - display: block; - padding: 0px 5px 0px 5px; -} - -#toc li a.location { - font-weight: bold; color: #000; - text-decoration: none; -} - -#toc li{ - font-weight: normal; font-size: 11px; - padding: 0px 5px 0px 0px; - list-style-type: none; background: url(https://github.com/Images/bullet.gif) no-repeat 0px .5em; - } - -#toc li li a { - margin-left: 0px; -} - - -#toc ul ul li { - background: url(https://github.com/Images/dash.gif) no-repeat 0px .6em; -} - -#toc ul ul ul li { - background: url(https://github.com/Images/sm_bullet.gif) no-repeat 0px .5em; -} - -#toc li.open { - border-top: 1px solid #CCC; border-bottom: 1px solid #CCC; background-color: #fff; -} - -#toc .open ul { - background-color: #fff; -} - -li img { - margin-left: 0px; -} -/*#toc li.open { background: #FFF;}*/ - - -/* frameset: toc frame styles WEB AS. used for any document that uses the static model for TOC topics documents*/ - -#topicstoc { - padding: 0px 0px 0px; -} - - -#topicstoc p.download { - border-bottom: 1px solid #CCC; - padding: 5px 10px; - margin: 0px; - font-weight: normal; font-size: 11px; -} - -#topicstoc h2 { - margin: 0; - padding: 10px; - font-size: 15px; font-weight: bold; - border-bottom: 0px solid; -} - -#topicstoc h3 { - margin: 6px 5px 0 10px; - font-size: 13px; font-weight: bold; color: black; -} - -#topicstoc h4 { - font-size: 11px; font-weight: bold; color: black; - margin: 2px 0px 0px 14px; -} - -#topicstoc ul { - list-style: none outside; - margin-left: 13px; margin-bottom: -2px; - padding: 0px; -} - - -#topicstoc ul ul{ - list-style: none outside; - margin-left: 10px; margin-bottom: -2px; - padding: 0px; -} - -#topicstoc li{ - font-weight: normal; font-size: 12px; - padding: 0px 5px 2px 10px; - list-style-type: none; background: url(https://github.com/Images/bullet.gif) no-repeat 0px .5em; -} - -#topicstoc li.intro { - font-weight: normal; - padding: 0px 0px; - list-style-type: none; background: none; -} - -#topicstoc li a { - display: block; - padding: 0px 5px 0px 0px; -} - -#topicstoc li a.location { - font-weight: bold; color: #000; - text-decoration: none; -} - -#topicstoc li.intro a { - margin-left: -5px; - display: block; -} - - -img.toplevel { float: left; } - - - -/* frameset: content frame */ -BODY { - margin-top: 0; - color: #000; - font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } - -/* frameset: H1,H2,H3,H4,H5,Head for code voice */ - -h1 { - margin-top: 1em; - margin-bottom: 25px; - font: bold 30px lucida grande, geneva, helvetica, arial, sans-serif; - color: #000; - } -h2 { - margin-top: 2.5em; - font-size: 24px; - color: #000; - padding-bottom: 2px; border-bottom: 1px solid black; - } -h3 { - margin-top: 2em; - margin-bottom: .5em; - font-size: 19px; - color: #000; - } -h3.tight { - margin-top: 3em; - margin-bottom: -.25em; - font-size: 19px; - color: #000; - } -h4 { - margin-top: 2em; - margin-bottom: .5em; - font-size: 15px; - color: #000; - } -h5 { - margin: 20 0 0 0; - padding: 0; - font-size: 13px; - color: #000; - } -.mach4{ - margin-top: 40; - margin-bottom: 0; - padding-top: 0; - font: bold 16px lucida grande, geneva, helvetica, arial, sans-serif; - color: #000; - } -.mach5{ - margin: 30 0 -9 0; - font: bold 13px lucida grande, geneva, helvetica, arial, sans-serif; - color: #000; - } -h5.tight{ - margin: 1.5em 0 2px 0; - font: bold 13px lucida grande, geneva, helvetica, arial, sans-serif; - color: #000; - } - - -.code_head{ - FONT-SIZE: 18px; FONT-FAMILY: monaco, courier, monospace; font-weight: bold; -} -p { - margin-top: 0px; margin-bottom: 10px; font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } -p.spaceabove { - margin-top: 13px; margin-bottom: 10px; font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } -p.spaceabovemethod { - font: 11px monaco, courier, monospace; margin-top: 13px; margin-bottom: 10px; -} -h3.tight + p { - margin-top: 13px; margin-bottom: 10px; font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } -h3.tight + p.spaceabovemethod { - font: 11px monaco, courier, monospace; margin-top: 13px; margin-bottom: 10px; -} -.content_text{ - margin-top: 0px; margin-bottom: 10px; font: 12px lucida grande, geneva, helvetica, arial, sans-serif; -} -p.blockquote{ - padding-left: 50pt; - padding-right: 50pt; - } -ul.availability { - list-style-type: none; - margin: 0 0 -10px 0; - } -.availability li { - margin: 2px 0 0 -6px; - } - -/* frameset: content frame bold style for text*/ -b{ - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-weight: bold; -} - -/* Used for text that is sligtly larger than bold text like lables and captions*/ -.content_text_label{ - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; -} - -/* frameset: content frame italic style for text*/ -i{ - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-style: italic; -} - -/* Used for reference heads in ProcedualC and AppleScript Language*/ -.content_ref_head{ - font-family: lucida grande, geneva, helvetica, arial, sans-serif; - font-size: 16px; font-weight: bold; margin-top: 50px; padding-bottom: 4px; border-bottom: 1px solid black - } - -.content_ref_head_code{ - font-family: monaco, courier, monospace; - font-size: 16px; font-weight: bold; margin-top: 50px; padding-bottom: 4px; border-bottom: 1px solid black - } - -/* frameset: page title */ -.page_title{ - font-family: lucida grande, geneva, helvetica, arial, sans-serif; - font-size: 34px; - font-weight: bold; - color: #000000; - padding-top: 10px; - } - -/* frameset: Unordered List */ - -ul.spaceabove { - list-style: square outside; - margin: 0 0 0 30px; - padding: 7 0 12px 6px; - } - -ul { - list-style: square outside; - margin: 0 0 0 30px; - padding: 0 0 12px 6px; - } - -li { - margin-top: 7px; - } - - -li p { - margin-top: 8px; - } - -ul ul { - list-style: circle outside; - margin: 6 0 0 30px; - padding: 0 0 12px 6px; - } -ul.3head { - list-style: square outside; - margin: 0 0 0 20px; - padding: 0 0 0px 0px; - } - - -/* alternate mappings for 2nd level bulleted list that are still in testing phase*/ -.nested li { - list-style-image: url(https://github.com/Images/openbullet.gif); - list-style-position: outside; - } - -ul.nested { - list-style: none; - margin: 6 0 0 30px; - } - -ol { - list-style-type: decimal; - list-style-position: outside; - margin: 0 0 0 30px; - padding: 0 0 12px 6px; - } - -ol ol { - list-style-type: lower-alpha; - list-style-position: outside; - margin: 7 0 0 30px; - padding: 0 0 12px 10px; - } - -ul.simple-spaceabove { - list-style-type: none; - margin: 5 0 0 20px; - } -.simple-spaceabove li { - margin-top: 1px; - } - -ul.simple { - list-style-type: none; - margin: 0 0 0 30px; - } -.simple li { - margin-top: -1px; - } - -dl.table-display { - clear: both; - width: auto; - margin: 0; - padding: 0px; - } - -.table-display dt { - width: 8em; - float: left; - margin: 0 0 0 0; - padding: .1em; - } - -/* commented backslash hack for mac-ie5 \*/ -dt { clear: both; } - - -.table-display dd { - float: left; - width: 80%; - margin: 0 0 0 0; - padding: .1em; - display: block; - } - -.clear { - clear: both; - } -dl.termdef { - margin-top: 0px; - margin-bottom: 10px; } -.termdef dt { - margin-top: 0px; } -.termdef dd { - margin-left: 15px; - margin-top: 1px; - margin-bottom: 6px; } -.termdef p{ - margin-left: 15px; - margin-top: -1px; - margin-bottom: 6px; } -h3.tight + dl.termdef { - margin-top: 13px; - margin-bottom: 10px; } - -/* frameset: list items */ -/* Everything in a list item is wrapped in an element now. */ -/* First para in a list item should be inline, others should be block. */ -li>p { display: inline } -li>p+p { display: block } - - -/* frameset: Index styles for docs */ -/* frameset: Index styles for alpah listing */ -.index_alpa{ - font-size: 18px; padding-bottom: 5px; margin: 25px 0 15px; border-bottom: 1px solid #91969C; } - -/* frameset: Index styles for singal and page range entries */ -.libindex{ -font-size: 12px; padding: 0 3px; background-color: #FFFFFF; margin: 0 3px; } - - - -/* frameset: mini navigation style (Hide/Show TOC & next/prev) */ -.mini_nav_text { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; - font-size: 9px; - font-weight: normal; -} - -.breadcrumb { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; - font-size: 10px; - font-weight: normal; - margin-left: 10px; - margin-top: 8px; -} - -/* ADC header/footer mappings for Getting Started */ -/* header */ -#adcnavheader td { - font: 10px lucida grande, geneva, helvetica, arial, sans-serif; - } - -#adcnavheader input { - margin: 0 3px 0 0; - padding: 0; - } - -#adcnavheader .textpadding { - padding-top: 2px; - vertical-align: middle; - } - -#adcnavheader .searchbutton { - border: 0; - } - -#adcnavheader h6 { - margin: 0; - padding: 0; - font: normal 12px lucida grande, geneva, helvetica, arial, sans-serif; - color: #000; -} - -#adcnavheader form { - margin: 0; -} - - -/* footer */ -#footer td, #footer p { - font-size: 10px; - } - - -/* Getting Started styles */ - -/* font definitions */ - -/* keep ".gettingstarted pre, code" above ".gettingstarted h1" below otherwise, -the main h1 tag above will be used instead of".gettingstarted h1" */ -.gettingstarted pre, code { - font: 11px Monaco, Courier, monospace; - } - -/* Added this style since the ADC template was trying to do this with a graphic (Note: their h2 -attached to the image tag is only used by search engines; their h2 does not function if the -graphic is missing).--DA */ -.gettingstarted h2 { - margin: 0; - margin-bottom: 15px; - padding: 0px; - font: bold 32px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - color: #000; - } - -.gettingstarted h3 { - margin: 0 0 5px 0; - padding: 0px; - font: bold 16px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - color: #000; - } - -.gettingstarted p + .gettingstarted h3 { - margin-top: 20px; - } - -.gettingstarted ol + .gettingstarted h3 { - margin-top: 20px; - } - -.gettingstarted ul + .gettingstarted h3 { - margin-top: 20px; - } - -.gettingstarted h4 { - margin: 0px; - padding: 0px; - font: bold 12px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - color: #000; - } - -.gettingstarted h4 + .gettingstarted table { - margin-top: 10px; - } - -.gettingstarted p { - margin-top: 0; - margin-bottom: 10px; - padding: 0; - font: 12px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - color: #000; - } - -.gettingstarted th { - font-weight: bold; - text-align: left; - } - - -/* list definitions */ -.gettingstarted ul { - font: 12px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - padding-left: 10px; - margin-top: 0; - margin-left: 10px; - margin-bottom: 10px; - list-style-type: none; - } - -.gettingstarted li { - margin-top: 3px; - } - - -.gettingstarted ul li { - list-style: square outside; - margin: 0 0 0 30px; - padding: 0 0 4px 0; - } - -.gettingstarted ul ul { - margin-left: 20px; - } - -.gettingstarted ol { - font: 12px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - margin-top: 0; - margin-left: 1.5em; - margin-bottom: 10px; - padding-left: 1.5em; - } - -.gettingstarted ul.inline, .gettingstarted ol.inline, .gettingstarted p.inline { - margin-top: -7px; - } - -/* table styles */ -caption.tablecaption { - margin-bottom: 5px; - text-align: left; -} -.sourcecodebox { - border: 1px solid #c7cfd5; - background: #f1f5f9; - margin: 20px 0; - } - -div.tableholder { - margin-top: 20px; - margin-bottom: 20px; - } - -p.tableholder { - margin-bottom: 7px; - font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } - -.graybox { - border-top: 1px solid #919699; - border-left: 1px solid #919699; - } - -.graybox th { - padding: 4px 8px 4px 8px; - background: #E2E2E2; - font-size: 12px; - border-bottom: 1px solid #919699; - border-right: 1px solid #919699; - } -.graybox th p { - font-weight: bold; - margin-bottom: 0px; - } - -.graybox td { - padding: 8px; - font-size: 12px; - text-align: left; - vertical-align: top; - border-bottom: 1px solid #919699; - border-right: 1px solid #919699; - } -.graybox td p { - margin-bottom: 0px; - } -.graybox td p + p { - margin-top: 5px; - } -.graybox td p + p + p { - margin-top: 5px; - } - - -/* footnote definitions */ -.footnote h4, .footnote p { - color: #76797C; - font-size: 11px; - } - -.gettingstarted .footnote { - font-size: 11px; - color: #76797C; - } - - -.notebox { - border: 1px solid #a1a5a9; - background-color: #f7f7f7; - margin: 20px 0; - padding: 0px 8px 1px 9px; - text-align: left; - } -.notebox p { - font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - margin-top: 7px; - margin-bottom: 0px; - } -.importantbox { - border: 1px solid #111; - background-color: #e8e8e8; - margin: 20px 0; - padding: 0px 8px 1px 9px; - text-align: left; - } -.importantbox p { - font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - margin-top: 7px; - margin-bottom: 0px; - } -.warningbox { - border: 1px solid #000; - background-color: #fff; - margin: 20px 0; - padding: 8px; - text-align: left; - } -.warningicon { - background-color: transparent; - padding-right: 10px; - float: left; - } -.warningbox p { - border-style: none; - font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - margin: -8px 0 -8px 30px; - } -div.codesample { - margin: 20px 0; - } -.codesample pre { - font-size: 11px; - font-family: monaco, courier, monospace; - margin: -1px 4px -3px 6px; - white-space: pre; - } -.codesample span { - margin-right: 8px; - float: right; - } -p.codesample { - margin-top: 20px; margin-bottom: -15px; font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } - - -/* Controller Layer Bindings styles */ - -.class_binding_block { - } - -.binding_category_block { - margin-left: 1em - } - -.binding_category_name { - font-size: 24px; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-weight: bold; line-height: 35px; padding-bottom: 1px; border-top: 2px solid black - } - -.binding_block { - margin-left: 2em - } - -.binding_name { - font-size: 18px; font-family: monaco, courier, monospace; font-weight: 400; margin-top: 10px; margin-bottom: 12px; border-bottom: 1px solid #69f - } - -.bindings_tablehead { font-size: 14px; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-weight: bold; position: relative; top: -5px; margin-left: -20px - } - -.placeholder_options_block { - margin-left: 2em - } - -.availabilityList { - border: none; - margin-top: 5px; - margin-bottom: 0px; - font-size: 12px; - text-align: left; - } - -.availabilityItem { - margin-top: -15px; - margin-bottom: 15px; - padding-left: 78px; - } - - -.metadata_attributes_name { - font-size: 24px; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-weight: bold; padding-top: 5px; margin-bottom: -10px; border-top: 2px solid black - } - -.metadata_attribute_name { - font-size: 18px; font-family: monaco, courier, monospace; font-weight: 400; margin-top: 10px; padding-bottom: 2px; - } - - -/* Spec Sheet Info Box */ -/* Used in AppKit Obj-C, Appkit Java, Foundation Obj-C, and Foundation Java References */ - -.spec_sheet_info_box { margin-left: 1em } - -/* This builds a table */ -.specbox { - border-top: 1px solid #919699; - border-left: 1px solid #919699; - border-right: 1px solid #919699; - margin-bottom: 10px; - } - -.specbox td { - padding: 8px; - font-size: 12px; - text-align: left; - vertical-align: top; - border-bottom: 1px solid #919699; - } - -/* This alternates colors in up to six table rows (light blue for odd, white for even)*/ - -.specbox tr { - background: #F0F5F9; -} - -.specbox tr + tr { - background: #FFFFFF; -} - -.specbox tr + tr + tr { - background: #F0F5F9; -} - -.specbox tr + tr + tr + tr { - background: #FFFFFF; -} - -.specbox tr + tr + tr +tr + tr { - background: #F0F5F9; -} - -.specbox tr + tr + tr + tr + tr + tr { - background: #FFFFFF; -} - -/* informal protocol subtitling */ - -.protocol_subtitle { - margin-top: -25px; - margin-bottom: 25px; - font-size: 13px; -} - -/* HeaderDoc headings */ - -.hd_tocAccess { - margin-left: 16px; - margin-top: 3px; - display: block; - font-weight: bold; -} -.hd_tocAccessSpace { - display: block; - font-size: 8px; -} - -.hd_tocGroup { - margin-left: 8px; - margin-top: 5px; - display: block; - font-style: italic; -} -.hd_tocGroupSpace { - display: block; - font-size: 8px; -} - -/* "Collection page" mappings */ - -.forums { margin-bottom: 5px;} -.forums b, -.forums a:link, -.forums a:visited { color: #017; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 11px; font-weight: bold; line-height: 13px;} -.forums a:hover { color: #00F; text-decoration: underline; font-weight: bold;} -.collection { margin-bottom: 5px;} -.collection h3, -.collection a:link, -.collection a:visited { font-size: 13px; color: #76797C; padding-bottom: 2px; border-bottom: 1px dotted #a1a5a9; margin-bottom: 0px; margin-right: 3px;} -.collection a:hover { color: #00F; text-decoration: underline; font-weight: bold;} - -.collection_title { width: 100%; - background-color: #7E91A4; - padding: 15px; - padding-right: 15px; - padding-bottom: 2px; - padding-left: 15px; - } - -.collection_title a:link, -.collection_title a:visited { color: #E8F3FD; } - -h1.collections { - margin-top: 0px; - margin-bottom: 25px; - font: bold 30px lucida grande, geneva, helvetica, arial, sans-serif; - color: #ffffff; - text-align: center; } - - \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/images/32x32_log.tiff b/src/MacVim/PSMTabBarControl/images/32x32_log.tiff deleted file mode 100644 index 86cdfb51116ccf04b04114327380fff707a24bac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20328 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 OMpmprX|x{M<^Kl-Vhvyb diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabNew.png b/src/MacVim/PSMTabBarControl/images/AquaTabNew.png deleted file mode 100644 index 843b3c386d52b0b487cca15df6d207890bc9a666..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3139 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 diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabNewRollover.png b/src/MacVim/PSMTabBarControl/images/AquaTabNewRollover.png deleted file mode 100644 index f7285117956f4356eb19b4ed8edc7f99a95a9841..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3147 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 diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabsBackground.png b/src/MacVim/PSMTabBarControl/images/AquaTabsBackground.png deleted file mode 100644 index 456ca6172d9e6ec3a6f46078b5c6cdbb898012d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3091 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 diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabsDown.png b/src/MacVim/PSMTabBarControl/images/AquaTabsDown.png deleted file mode 100644 index 2db28ae1f4a58288922f7abeb7da69e6a14dd28b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2901 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 VF0>PS{}KQI002ovPDHLkV1ldzb_@Uj diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabsDownNonKey.png b/src/MacVim/PSMTabBarControl/images/AquaTabsDownNonKey.png deleted file mode 100644 index 34a57ff6396a34b6ec6ab983d16e788ad1a4eceb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 787 zcmV+u1MK{XP)KLZ*U+a;PZ6DwmS#U-~Zwqe!V{P^5NQ_9g-#oEmo*;xPb(iB&l8cre(mz}OV*eH{#TR|kW=R}lIJ?{~DG)Bo+4 zAbf;><^G%f96osg?Z>_^0LZWiQ~(8dnuN(GaAFtKB$Sef@py224*@uu&M1l$ljTHK zt?-}2?DT>;$ABYkFINIi10NQgY%ySKzHl{Q!_CYMd)nDtz_zCj@7`&ZDgj?_Tv3NQ zoq`guZlp5--{|Itvka>|)OY)H!ydhn&X4p{g@8$uK|w(xhKx*tEGiZMzX2RyhVO^s z`Kt2n`O3XNJ@AZM9zd#V-*(!~mM6{HcE^xXUDNJ)h7*-?mUba3#bh}F@C(a=tFsg9 z>D&MS00d`2O+f$v*z5Hi6siCK03c&XQcVB=ZYKZ$bFTmZ^``&;g(d(1Z?6CV=e_^{ zG3)>U7w#KILV^GQ08~jtK~#9!l+U3Nz%UF$(WtSrKgt!Bw%gg%z9b8%z@NSo5azra z3uZ<^B7#F^a#(8>Veef8036(%!qt9~F$Ra;I|o%QE<~iZK>0@<R|DNig)WpGT%PfAtr%uP&B4N6T+sVqF1Y6Da>+0(@_q~cc6Jj>!|{(JaZG%Q-e|yQz{EjrrH1%&GK|{45_%4G|McP&4IyirNl2r z7JD iYe34jRB<{qFfs(35dFs3=&}LmN(N6?KbLh*2~7Yrom!Lt diff --git a/src/MacVim/PSMTabBarControl/images/Folder.tif b/src/MacVim/PSMTabBarControl/images/Folder.tif deleted file mode 100644 index 4d4cc0bbceafa936043573af09417be64d097b1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 926 zcmebEWzb?^V7k%3pb%i8BF4+!;*=P$BgIUXzk?yk@qtOmG>0C|(2v`HuCrOi;or}+Y?(XADyh*pJ0ENuig9abN70CP5-Z#o)&#m z2?^>r;v_onbGg<1H{Vuge!GxkasOHHA;B{$@>8!fbtn81*s{a^ez^JHYj4Zy?q!@e zU;OvZhf4dKzG=Vzx@}FgKkw-}`OmqApnVs*uC4y#mh7>Oaps08iZXp3333tQ!o4T{ zXKXcE^{TE+8HU4N1SSx?xXs~(O+HCtvUEe-`__y*RbQ|>;?bY4>iUibUaI3&Wjs^cb);~w1Mkv}Zx|aMczCt(Cogzb(zk?@tA6sbl@GaP z++Y3)lRkd%m%o(z#&7O3-A{gTl4$?<$9{&uiXX9am%rHNKAruChBEK76HJT@2}^}+ z`r0ebSoWuXfw=pt9#aV%B*r04CAX|_DC=b-jz`(&M3Ka*6Fp9y%nHU(w;q3E_QVc*7 qKrWR0gSr3%lm-AXOkSS= diff --git a/src/MacVim/PSMTabBarControl/images/Globe.tiff b/src/MacVim/PSMTabBarControl/images/Globe.tiff deleted file mode 100644 index 3c893505eb64071e676a67591d5712682e7fee55..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17104 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 diff --git a/src/MacVim/PSMTabBarControl/images/TabClose_Front.png b/src/MacVim/PSMTabBarControl/images/TabClose_Front.png deleted file mode 100644 index 5277930420a296a974726a25b6e62872534933e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 518 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 diff --git a/src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed.png b/src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed.png deleted file mode 100644 index 3c2328b9a1967128bb6a820c1fc8fe8d77f23d07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 542 zcmV+(0^$9MP)clE1IgP!z|%_qBz#UQ#Xr@uk`(Li1uJkZ9Npd2bLF z78l~*;N+j;w~a36q!Kl%dT1AzB&9M1tjJq_Q@X0uNyrH?Y1jAfdp2>_eTW)p_tRTM?<2qCZH zIQ~okutK5mj8b~V7)#?nn$PEpD2m>W$K#huu~@8AN}n>u(#>Y`p|0!7Y&Kf~K)GDL zU9DEV>2x|j9*^g#RO-8$%jGVU$z&P;gb<sy4~*MPN(yHG#cfX%cYq} zB=!-9RRY1%<1YMOS?b^Vv``?Gqz z{-)7rye6mDxHB9M>%CsD*6;Uk20>t*n3t7Gy=8SYXDPe000ZXJpe@j=cnE` g0G|MS1h52v-$Jpob2%F;#{d8T07*qoM6N<$g0lnm5&!@I diff --git a/src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed@2x.png b/src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed@2x.png deleted file mode 100644 index e4d539f7195d7a395a15f0d0f8d33a6cac318144..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4114 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 Y1F+7kQ!BPYCjbBd07*qoM6N<$f>8{}e*gdg diff --git a/src/MacVim/PSMTabBarControl/images/TabControlRep.tif b/src/MacVim/PSMTabBarControl/images/TabControlRep.tif deleted file mode 100644 index 6ad0f4042a2a716d62a0480d2432d3cdb2280df7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29768 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 diff --git a/src/MacVim/PSMTabBarControl/images/TabNewMetal.png b/src/MacVim/PSMTabBarControl/images/TabNewMetal.png deleted file mode 100644 index 5b8301845a2397fd3335f7c3c6a55e716833032c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3137 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 bkIw@DtN)X%NLHKy00000NkvXXu0mjf9LMoo diff --git a/src/MacVim/PSMTabBarControl/images/TabNewMetal@2x.png b/src/MacVim/PSMTabBarControl/images/TabNewMetal@2x.png deleted file mode 100644 index aab821b3cce23925fb797a6dd60f9f71c116b7d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3886 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 Z;y>Aq+yrj!JEH&q002ovPDHLkV1fam63qYr diff --git a/src/MacVim/PSMTabBarControl/images/TabNewMetalRollover.png b/src/MacVim/PSMTabBarControl/images/TabNewMetalRollover.png deleted file mode 100644 index 083f00ae7d148c15f24dbf2c302fb57fa25d0ed1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3146 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 diff --git a/src/MacVim/PSMTabBarControl/images/TabNewYosemite.png b/src/MacVim/PSMTabBarControl/images/TabNewYosemite.png deleted file mode 100644 index a85cf213698f87976898815e21193f3a1aedfaab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1459 zcmeAS@N?(olHy`uVBq!ia0vp^)*#Hm1|*NFe%cJA7>k44ofy`glX(f`a29w(7Bet# z3xhBt!>lxV%QuQiw3xKK_7;Gx6fXv*~l0=1y+?>2( zs|s5sunH?68zii+qySb@l5MLL;TxdfoL`ixV5(=LXP{)qrJ$f-Qm! zW>zZ9CC0jjhPs9ZA%><_#uiq_#z@*BYLIk;0>vsaD7830rxX+?cIHMl`WS-f8vKhg zQ-RS7)&TS*Z`V%QLU8y?@)Hhc9-)qm7l_Gup!*oUfc0pZrH|Z%w0=ubABQ zY?fmNRmU1%v2EUI6n4ysXOFw%`h3gwugQ@e|Mt|sKb(`fzd}`T=e@rf0HJ1x^*?~(^Pgg&e IbxsLQ09eWNx&QzG diff --git a/src/MacVim/PSMTabBarControl/images/TabNewYosemite@2x.png b/src/MacVim/PSMTabBarControl/images/TabNewYosemite@2x.png deleted file mode 100644 index 9f2b024011f76c61c7cdc2a548b740d7ddc79a27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4338 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 RbliH7pbSqMl;}H0{09N-k0}5E diff --git a/src/MacVim/PSMTabBarControl/images/Warning.png b/src/MacVim/PSMTabBarControl/images/Warning.png deleted file mode 100644 index c847e492e06ead1bf815738d63d141d6176677f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3412 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 diff --git a/src/MacVim/PSMTabBarControl/images/overflowImage@2x.png b/src/MacVim/PSMTabBarControl/images/overflowImage@2x.png deleted file mode 100644 index c92c1740c84281195b2b065f22e59b629b2f6d12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4028 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 KMNUMnLSTY}k9acx diff --git a/src/MacVim/PSMTabBarControl/images/pi.png b/src/MacVim/PSMTabBarControl/images/pi.png deleted file mode 100644 index e3ff0794522a06aec1be119a0eb0a8815fa7321e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3396 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 - - - - - Class PSMTabBarControlPalette - - - NibFile PSMTabBarControlPalette - - - Icon TabIcon.tif - - - ToolTips PSMTabBarControl - - - ExportClasses - - PSMTabBarControl - PSMTabBarCell - PSMAquaTabStyle - PSMMetalTabStyle - PSMRolloverButton - PSMProgressIndcator - PSMOverflowPopUpButton - - - - ExportImages - - TabControlRep.tif - TabIcon.tif - - - - ExportSounds - - - - - diff --git a/src/MacVim/PSMTabBarControl/source/AppController.h b/src/MacVim/PSMTabBarControl/source/AppController.h deleted file mode 100644 index 532e91da64..0000000000 --- a/src/MacVim/PSMTabBarControl/source/AppController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// AppController.h -// PSMTabBarControl -// -// Created by John Pannell on 12/19/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import - -@interface AppController : NSObject { - -} - -- (IBAction)newWindow:(id)sender; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/AppController.m b/src/MacVim/PSMTabBarControl/source/AppController.m deleted file mode 100644 index 16dfd30c44..0000000000 --- a/src/MacVim/PSMTabBarControl/source/AppController.m +++ /dev/null @@ -1,30 +0,0 @@ -// -// AppController.m -// TabBarControl -// -// Created by John Pannell on 12/19/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import "AppController.h" -#import "WindowController.h" - -@implementation AppController - -- (void)awakeFromNib -{ - [self newWindow:self]; - [self newWindow:self]; - NSRect frontFrame = [[NSApp keyWindow] frame]; - frontFrame.origin.x += 400; - [[NSApp keyWindow] setFrame:frontFrame display:YES]; -} - -- (IBAction)newWindow:(id)sender -{ - // put up a window - WindowController *newWindow = [[WindowController alloc] initWithWindowNibName:@"Window"]; - [newWindow showWindow:self]; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/FakeModel.h b/src/MacVim/PSMTabBarControl/source/FakeModel.h deleted file mode 100644 index aeece3f530..0000000000 --- a/src/MacVim/PSMTabBarControl/source/FakeModel.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// FakeModel.h -// TabBarControl -// -// Created by John Pannell on 12/19/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import - - -@interface FakeModel : NSObject { - BOOL _isProcessing; - NSImage *_icon; - NSString *_iconName; - NSObjectController *controller; - int _objectCount; -} - -// creation/destruction -- (id)init; - -// accessors -- (BOOL)isProcessing; -- (void)setIsProcessing:(BOOL)value; -- (NSImage *)icon; -- (void)setIcon:(NSImage *)icon; -- (NSString *)iconName; -- (void)setIconName:(NSString *)iconName; -- (int)objectCount; -- (void)setObjectCount:(int)value; -- (NSObjectController *)controller; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/FakeModel.m b/src/MacVim/PSMTabBarControl/source/FakeModel.m deleted file mode 100644 index dee72ec085..0000000000 --- a/src/MacVim/PSMTabBarControl/source/FakeModel.m +++ /dev/null @@ -1,77 +0,0 @@ -// -// FakeModel.m -// TabBarControl -// -// Created by John Pannell on 12/19/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import "FakeModel.h" - - -@implementation FakeModel - -- (id)init -{ - if(self == [super init]){ - _isProcessing = YES; - _icon = nil; - _iconName = nil; - _objectCount = 2; - controller = [[NSObjectController alloc] initWithContent:self]; - } - return self; -} - - -// accessors -- (BOOL)isProcessing -{ - return _isProcessing; -} - -- (void)setIsProcessing:(BOOL)value -{ - _isProcessing = value; -} - -- (NSImage *)icon -{ - return _icon; -} - -- (void)setIcon:(NSImage *)icon -{ - [icon retain]; - [_icon release]; - _icon = icon; -} - -- (NSString *)iconName -{ - return _iconName; -} - -- (void)setIconName:(NSString *)iconName -{ - [iconName retain]; - [_iconName release]; - _iconName = iconName; -} - -- (int)objectCount -{ - return _objectCount; -} - -- (void)setObjectCount:(int)value -{ - _objectCount = value; -} - -- (NSObjectController *)controller -{ - return controller; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.h b/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.h deleted file mode 100644 index 9c6c335fbe..0000000000 --- a/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// NSBezierPath_AMShading.h -// ------------------------ -// -// Created by Andreas on 2005-06-01. -// Copyright 2005 Andreas Mayer. All rights reserved. -// -// based on http://www.cocoadev.com/index.pl?GradientFill - - -#import - - -@interface NSBezierPath (AMShading) - -- (void)customHorizontalFillWithCallbacks:(CGFunctionCallbacks)functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor; - -- (void)linearGradientFillWithStartColor:(NSColor *)startColor endColor:(NSColor *)endColor; - -- (void)bilinearGradientFillWithOuterColor:(NSColor *)outerColor innerColor:(NSColor *)innerColor; - - -@end diff --git a/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.m b/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.m deleted file mode 100644 index ed80e76beb..0000000000 --- a/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.m +++ /dev/null @@ -1,178 +0,0 @@ -// -// NSBezierPath_AMShading.m -// ------------------------ -// -// Created by Andreas on 2005-06-01. -// Copyright 2005 Andreas Mayer. All rights reserved. -// - -#import "NSBezierPath_AMShading.h" - -// CGFloat was introduced in OS X 10.5 -#ifndef CGFLOAT_DEFINED - typedef float CGFloat; -# define CGFLOAT_MIN FLT_MIN -# define CGFLOAT_MAX FLT_MAX -# define CGFLOAT_IS_DOUBLE 0 -# define CGFLOAT_DEFINED 1 -#endif - - -@implementation NSBezierPath (AMShading) - -static void linearShadedColor(void *info, const CGFloat *in, CGFloat *out) -{ - CGFloat *colors = info; - *out++ = colors[0] + *in * colors[8]; - *out++ = colors[1] + *in * colors[9]; - *out++ = colors[2] + *in * colors[10]; - *out++ = colors[3] + *in * colors[11]; -} - -static void bilinearShadedColor(void *info, const CGFloat *in, CGFloat *out) -{ - CGFloat *colors = info; - CGFloat factor = (*in)*2.0; - if (*in > 0.5) { - factor = 2-factor; - } - *out++ = colors[0] + factor * colors[8]; - *out++ = colors[1] + factor * colors[9]; - *out++ = colors[2] + factor * colors[10]; - *out++ = colors[3] + factor * colors[11]; -} - -- (void)linearGradientFillWithStartColor:(NSColor *)startColor endColor:(NSColor *)endColor -{ - /* - CGColorSpaceRef colorspace; - CGShadingRef shading; - CGPoint startPoint = {0, 0}; - CGPoint endPoint = {0, 0}; - CGFunctionRef function; - CGFloat colors[12]; // pointer to color values - - // get my context - CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; - - NSColor *deviceDependentStartColor = [startColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]; - NSColor *deviceDependentEndColor = [endColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]; - - // set up colors for gradient - colors[0] = [deviceDependentStartColor redComponent]; - colors[1] = [deviceDependentStartColor greenComponent]; - colors[2] = [deviceDependentStartColor blueComponent]; - colors[3] = [deviceDependentStartColor alphaComponent]; - - colors[4] = [deviceDependentEndColor redComponent]; - colors[5] = [deviceDependentEndColor greenComponent]; - colors[6] = [deviceDependentEndColor blueComponent]; - colors[7] = [deviceDependentEndColor alphaComponent]; - - // difference between start and end color for each color components - colors[8] = (colors[4]-colors[0]); - colors[9] = (colors[5]-colors[1]); - colors[10] = (colors[6]-colors[2]); - colors[11] = (colors[7]-colors[3]); - - // draw gradient - colorspace = CGColorSpaceCreateDeviceRGB(); - - size_t components = 1 + CGColorSpaceGetNumberOfComponents(colorspace); - static const CGFloat domain[2] = {0.0, 1.0}; - static const CGFloat range[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1}; - static const CGFunctionCallbacks callbacks = {0, &shadedColor, NULL}; - - // Create a CGFunctionRef that describes a function taking 1 input and kChannelsPerColor outputs. - function = CGFunctionCreate(colors, 1, domain, components, range, &callbacks); - - startPoint.x=0; - startPoint.y=[self bounds].origin.y; - endPoint.x=0; - endPoint.y=NSMaxY([self bounds]); - - shading = CGShadingCreateAxial(colorspace, startPoint, endPoint, function, NO, NO); - - CGContextSaveGState(currentContext); - [self addClip]; - CGContextDrawShading(currentContext, shading); - CGContextRestoreGState(currentContext); - - CGShadingRelease(shading); - CGFunctionRelease(function); - CGColorSpaceRelease(colorspace); - */ - - static const CGFunctionCallbacks callbacks = {0, &linearShadedColor, NULL}; - - [self customHorizontalFillWithCallbacks:callbacks firstColor:startColor secondColor:endColor]; -}; - -- (void)bilinearGradientFillWithOuterColor:(NSColor *)outerColor innerColor:(NSColor *)innerColor -{ - static const CGFunctionCallbacks callbacks = {0, &bilinearShadedColor, NULL}; - - [self customHorizontalFillWithCallbacks:callbacks firstColor:innerColor secondColor:outerColor]; -} - -- (void)customHorizontalFillWithCallbacks:(CGFunctionCallbacks)functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor -{ - CGColorSpaceRef colorspace; - CGShadingRef shading; - CGPoint startPoint = {0, 0}; - CGPoint endPoint = {0, 0}; - CGFunctionRef function; - CGFloat colors[12]; // pointer to color values - - // get my context - CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; - - NSColor *deviceDependentFirstColor = [firstColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]; - NSColor *deviceDependentSecondColor = [secondColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]; - - // set up colors for gradient - colors[0] = [deviceDependentFirstColor redComponent]; - colors[1] = [deviceDependentFirstColor greenComponent]; - colors[2] = [deviceDependentFirstColor blueComponent]; - colors[3] = [deviceDependentFirstColor alphaComponent]; - - colors[4] = [deviceDependentSecondColor redComponent]; - colors[5] = [deviceDependentSecondColor greenComponent]; - colors[6] = [deviceDependentSecondColor blueComponent]; - colors[7] = [deviceDependentSecondColor alphaComponent]; - - // difference between start and end color for each color components - colors[8] = (colors[4]-colors[0]); - colors[9] = (colors[5]-colors[1]); - colors[10] = (colors[6]-colors[2]); - colors[11] = (colors[7]-colors[3]); - - // draw gradient - colorspace = CGColorSpaceCreateDeviceRGB(); - size_t components = 1 + CGColorSpaceGetNumberOfComponents(colorspace); - static const CGFloat domain[2] = {0.0, 1.0}; - static const CGFloat range[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1}; - //static const CGFunctionCallbacks callbacks = {0, &bilinearShadedColor, NULL}; - - // Create a CGFunctionRef that describes a function taking 1 input and kChannelsPerColor outputs. - function = CGFunctionCreate(colors, 1, domain, components, range, &functionCallbacks); - - startPoint.x=0; - startPoint.y=[self bounds].origin.y; - endPoint.x=0; - endPoint.y=NSMaxY([self bounds]); - - shading = CGShadingCreateAxial(colorspace, startPoint, endPoint, function, NO, NO); - - CGContextSaveGState(currentContext); - [self addClip]; - CGContextDrawShading(currentContext, shading); - CGContextRestoreGState(currentContext); - - CGShadingRelease(shading); - CGFunctionRelease(function); - CGColorSpaceRelease(colorspace); -} - - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.h b/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.h deleted file mode 100644 index 20bf7e0bfd..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// PSMMetalTabStyle.h -// PSMTabBarControl -// -// Created by John Pannell on 2/17/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import -#import "PSMTabStyle.h" - -@interface PSMMetalTabStyle : NSObject { - NSImage *metalCloseButton; - NSImage *metalCloseButtonDown; - NSImage *metalCloseButtonOver; - NSImage *_addTabButtonImage; - NSImage *_addTabButtonPressedImage; - NSImage *_addTabButtonRolloverImage; - NSMutableParagraphStyle *truncatingTailParagraphStyle; - NSMutableParagraphStyle *centeredParagraphStyle; -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; - -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m deleted file mode 100644 index fc1c5fae89..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m +++ /dev/null @@ -1,531 +0,0 @@ -// -// PSMMetalTabStyle.m -// PSMTabBarControl -// -// Created by John Pannell on 2/17/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import "PSMMetalTabStyle.h" -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" - -#define kPSMMetalObjectCounterRadius 7.0 -#define kPSMMetalCounterMinWidth 20 - -// NSDrawWindowBackground() is broken for borderless windows, see -// http://lists.apple.com/archives/cocoa-dev/2006/Feb/msg00130.html -void MyNSDrawWindowBackground(NSRect rect) -{ - [[NSColor controlColor] set]; - NSRectFill( rect ); -} - -@implementation PSMMetalTabStyle - -- (NSString *)name -{ - return @"Metal"; -} - -#pragma mark - -#pragma mark Creation/Destruction - -- (id) init -{ - //NSLog(@"PSMMetalTabStyle init"); - - if((self = [super init])) - { - - metalCloseButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front"]]; - //NSLog(@"metalCloseButton=%@ path=%@", metalCloseButton, - // [[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front"]); - metalCloseButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front_Pressed"]]; - metalCloseButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetal"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetalPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetalRollover"]]; - } - return self; -} - -- (void)dealloc -{ - [metalCloseButton release]; - [metalCloseButtonDown release]; - [metalCloseButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - - [truncatingTailParagraphStyle release]; - [centeredParagraphStyle release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Control Specific - -- (float)leftMarginForTabBarControl -{ - return 10.0f; -} - -- (float)rightMarginForTabBarControl -{ - return 24.0f; -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect) closeButtonRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [metalCloseButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 2.0; - - if([cell state] == NSOnState){ - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - result.origin.x += [metalCloseButton size].width + kPSMTabBarCellPadding; - - if([cell state] == NSOnState){ - result.origin.y += 1; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell state] == NSOnState){ - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - float countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMMetalObjectCounterRadius - 6.0); - if(countWidth < kPSMMetalCounterMinWidth) - countWidth = kPSMMetalCounterMinWidth; - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMMetalObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - - return result; -} - - -- (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [metalCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [metalCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSNumberFormatter *nf = [[[NSNumberFormatter alloc] init] autorelease]; - [nf setLocalizesFormat:YES]; - [nf setFormat:@"0"]; - [nf setHasThousandSeparators:YES]; - NSString *contents = [nf stringFromNumber:[NSNumber numberWithInt:[cell count]]]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[fm convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor whiteColor] colorWithAlphaComponent:0.85] range:range]; - - return attrStr; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString *contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[NSFont boldSystemFontOfSize:11.0] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor textColor] colorWithAlphaComponent:0.75] range:range]; - - // Add shadow attribute - NSShadow* shadow; - shadow = [[[NSShadow alloc] init] autorelease]; - float shadowAlpha; - if(([cell state] == NSOnState) || [cell isHighlighted]){ - shadowAlpha = 0.8; - } else { - shadowAlpha = 0.5; - } - [shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:shadowAlpha]]; - [shadow setShadowOffset:NSMakeSize(0, -1)]; - [shadow setShadowBlurRadius:1.0]; - [attrStr addAttribute:NSShadowAttributeName value:shadow range:range]; - - // Paragraph Style for Truncating Long Text - if (!truncatingTailParagraphStyle) { - truncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [truncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; - [truncatingTailParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:truncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - NSColor * lineColor = nil; - NSBezierPath* bezier = [NSBezierPath bezierPath]; - lineColor = [NSColor darkGrayColor]; - - if ([cell state] == NSOnState) { - // selected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height-2.5); - aRect.size.height -= 0.5; - - // background - MyNSDrawWindowBackground(aRect); - - aRect.size.height+=0.5; - - // frame - aRect.origin.x += 0.5; - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y+aRect.size.height-1.5)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+1.5, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width-1.5, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y+aRect.size.height-1.5)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y)]; - if([[cell controlView] frame].size.height < 2){ - // special case of hidden control; need line across top of cell - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y+0.5)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y+0.5)]; - } - [bezier stroke]; - } else { - - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - aRect.origin.y += 0.5; - aRect.origin.x += 1.5; - aRect.size.width -= 1; - - // rollover - if ([cell isHighlighted]) { - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositingOperationSourceAtop); - } - - aRect.origin.x -= 1; - aRect.size.width += 1; - - // frame - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y)]; - if(!([cell tabState] & PSMTab_RightIsSelectedMask)){ - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y + aRect.size.height)]; - } - [bezier stroke]; - } - - [self drawInteriorWithTabCell:cell inView:[cell controlView]]; -} - - - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - float labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage * closeButton = nil; - - closeButton = metalCloseButton; - if ([cell closeButtonOver]) closeButton = metalCloseButtonOver; - if ([cell closeButtonPressed]) closeButton = metalCloseButtonDown; - - closeButtonSize = [closeButton size]; - [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; - } - -#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best. - // icon - if([cell hasIcon]){ - NSRect iconRect = [self iconRectForTabCell:cell]; - NSImage *icon = [[[[cell representedObject] identifier] content] icon]; - if ([controlView isFlipped]) { - iconRect.origin.y = cellFrame.size.height - iconRect.origin.y; - } - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0]; - - // scoot label over - labelPosition += iconRect.size.width + kPSMTabBarCellPadding; - } -#endif - - // object counter - if([cell count] > 0){ - [[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - if([cell state] == NSOnState) - myRect.origin.y -= 1.0; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - labelRect.size.height = cellFrame.size.height; - labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if([cell state] == NSOnState){ - labelRect.origin.y -= 1; - } - - if(![[cell indicator] isHidden]) - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - - if([cell count] > 0) - labelRect.size.width -= ([self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding); - - // label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - MyNSDrawWindowBackground(rect); - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; - NSRectFillUsingOperation(rect, NSCompositingOperationSourceAtop); - [[NSColor darkGrayColor] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,rect.origin.y+0.5) toPoint:NSMakePoint(rect.origin.x+rect.size.width,rect.origin.y+0.5)]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,rect.origin.y+rect.size.height-0.5) toPoint:NSMakePoint(rect.origin.x+rect.size.width,rect.origin.y+rect.size.height-0.5)]; - - // no tab view == not connected - if(![bar tabView]){ - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [centeredParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - if(![cell isInOverflowMenu]){ - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - //[super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:metalCloseButton forKey:@"metalCloseButton"]; - [aCoder encodeObject:metalCloseButtonDown forKey:@"metalCloseButtonDown"]; - [aCoder encodeObject:metalCloseButtonOver forKey:@"metalCloseButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - // self = [super initWithCoder:aDecoder]; - //if (self) { - if ([aDecoder allowsKeyedCoding]) { - metalCloseButton = [[aDecoder decodeObjectForKey:@"metalCloseButton"] retain]; - metalCloseButtonDown = [[aDecoder decodeObjectForKey:@"metalCloseButtonDown"] retain]; - metalCloseButtonOver = [[aDecoder decodeObjectForKey:@"metalCloseButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - } - //} - return self; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.h b/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.h deleted file mode 100644 index 9151648d94..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// PSMMojaveTabStyle.h -// PSMTabBarControl -// -// This file is copied from PSMYosemiteTabStyle to allow for modifications to -// adapt to Mojave-specific functionality such as Dark Mode without needing to -// pollute the implementation of Yosemite tab style. -// -// - -#if defined(MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 -#define HAS_MOJAVE_TAB_STYLE 1 - -#import -#import "PSMTabStyle.h" - -@interface PSMMojaveTabStyle : NSObject { - NSImage *closeButton; - NSImage *closeButtonDown; - NSImage *closeButtonOver; - NSImage *closeButtonOverDark; - NSImage *_addTabButtonImage; - NSMutableParagraphStyle *truncatingTailParagraphStyle; - NSMutableParagraphStyle *centeredParagraphStyle; -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; - -- (void)styleAddTabButton:(PSMRolloverButton *)addTabButton; - -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - -@end -#endif diff --git a/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.m deleted file mode 100644 index 3c9e59a3fa..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.m +++ /dev/null @@ -1,573 +0,0 @@ -// -// PSMMojaveTabStyle.m -// PSMTabBarControl -// -// This file is copied from PSMYosemiteTabStyle to allow for modifications to -// adapt to Mojave-specific functionality such as Dark Mode without needing to -// pollute the implementation of Yosemite tab style. -// -// - -#import "PSMMojaveTabStyle.h" - -#import "PSMRolloverButton.h" - -#if HAS_MOJAVE_TAB_STYLE - -#define kPSMMetalObjectCounterRadius 7.0 -#define kPSMMetalCounterMinWidth 20 - -void MojaveNSDrawWindowBackground(NSRect rect, NSColor *color) -{ - [color set]; - NSRectFill( rect ); -} - -@implementation PSMMojaveTabStyle - -- (void)dealloc -{ - [closeButton release]; - [closeButtonDown release]; - [closeButtonOver release]; - [closeButtonOverDark release]; - [_addTabButtonImage release]; - - [truncatingTailParagraphStyle release]; - [centeredParagraphStyle release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Initializers - -- (id)init -{ - self = [super init]; - if (!self) return nil; - - closeButton = [[self createCloseButtonImage:16.0 color:[NSColor secondaryLabelColor] backgroundColor:nil] retain]; - closeButtonDown = [[self createCloseButtonImage:16.0 color:[NSColor secondaryLabelColor] backgroundColor:[NSColor grayColor]] retain]; - closeButtonOver = [[self createCloseButtonImage:16.0 color:[NSColor secondaryLabelColor] backgroundColor:[NSColor grayColor]] retain]; - closeButtonOverDark = [[self createCloseButtonImage:16.0 color:[NSColor secondaryLabelColor] backgroundColor:[NSColor darkGrayColor]] retain]; - - _addTabButtonImage = [[NSImage imageNamed:NSImageNameAddTemplate] retain]; - - return self; -} - -- (NSString *)name -{ - return @"Mojave"; -} - -#pragma mark - -#pragma mark Control Specific - -- (float)leftMarginForTabBarControl -{ - return -1.0f; -} - -- (float)rightMarginForTabBarControl -{ - return 24.0f; -} - -#pragma mark - -#pragma mark Add Tab Button - -- (void)styleAddTabButton:(PSMRolloverButton *)addTabButton -{ - NSImage *newButtonImage = [self addTabButtonImage]; - if (newButtonImage) { - [addTabButton setUsualImage:newButtonImage]; - [addTabButton setAlternateImage:newButtonImage]; - [addTabButton setRolloverImage:newButtonImage]; - } - [addTabButton setButtonType:NSMomentaryLightButton]; -} - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonImage;; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonImage; -} - -- (NSColor *)backgroundColor:(PSMTabBarCell *)cell isKeyWindow:(BOOL)isKeyWindow isSelected:(BOOL)isSelected -{ - NSColor *backgroundColor; - - BOOL isHighlight = [cell isHighlighted]; - - if (@available(macos 10.13, *)) { - if (isKeyWindow) { - if (isSelected) { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundActiveSelected" bundle:[PSMTabBarControl bundle]]; - } else if (isHighlight) { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundActiveHighlight" bundle:[PSMTabBarControl bundle]]; - } else { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundActive" bundle:[PSMTabBarControl bundle]]; - } - } else { - if (isSelected) { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundInactiveSelected" bundle:[PSMTabBarControl bundle]]; - } else if (isHighlight) { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundInactiveHighlight" bundle:[PSMTabBarControl bundle]]; - } else { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundInactive" bundle:[PSMTabBarControl bundle]]; - } - } - } - - return backgroundColor; -} - -- (NSColor *)borderColor:(BOOL)isKeyWindow -{ - if (@available(macos 10.13, *)) { - if (isKeyWindow) { - return [NSColor colorNamed:@"MojaveTabBorderActive" bundle:[PSMTabBarControl bundle]]; - } else { - return [NSColor colorNamed:@"MojaveTabBorderInactive" bundle:[PSMTabBarControl bundle]]; - } - } - else { - return nil; - } -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect) closeButtonRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [closeButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = (cellFrame.size.height - result.size.height) / 2; - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - result.origin.x += [closeButton size].width + kPSMTabBarCellPadding; - - if([cell state] == NSControlStateValueOn){ - result.origin.y += 1; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell state] == NSControlStateValueOn){ - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - float countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMMetalObjectCounterRadius - 6.0); - if(countWidth < kPSMMetalCounterMinWidth) - countWidth = kPSMMetalCounterMinWidth; - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMMetalObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - - return result; -} - - -- (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [closeButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [closeButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSNumberFormatter *nf = [[[NSNumberFormatter alloc] init] autorelease]; - [nf setLocalizesFormat:YES]; - [nf setFormat:@"0"]; - [nf setHasThousandSeparators:YES]; - NSString *contents = [nf stringFromNumber:[NSNumber numberWithInt:[cell count]]]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[fm convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor whiteColor] colorWithAlphaComponent:0.85] range:range]; - - return attrStr; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString *contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - - PSMTabBarControl *bar = (PSMTabBarControl *)cell.controlView; - BOOL isKeyWindow = [bar.window isKeyWindow]; - - CGFloat textAlpha; - if ([cell state] == NSControlStateValueOn) { - textAlpha = (isKeyWindow) ? 1.0f : 0.5f; - } else { - textAlpha = (isKeyWindow) ? 0.5f : 0.25f; - } - NSColor *textColor = [[NSColor textColor] colorWithAlphaComponent:textAlpha]; - - [attrStr addAttribute:NSForegroundColorAttributeName value:textColor range:range]; - - // Paragraph Style for Truncating Long Text - if (!truncatingTailParagraphStyle) { - truncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [truncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingHead]; - [truncatingTailParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:truncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - PSMTabBarControl *bar = (PSMTabBarControl *)cell.controlView; - BOOL isKeyWindow = [bar.window isKeyWindow]; - - NSRect cellFrame = [cell frame]; - NSColor * lineColor = nil; - NSBezierPath* bezier = [NSBezierPath bezierPath]; - lineColor = [self borderColor:isKeyWindow]; - - if ([cell state] == NSControlStateValueOn) { - // selected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - - // background - MojaveNSDrawWindowBackground(aRect, [self backgroundColor:cell isKeyWindow:isKeyWindow isSelected:YES]); - - aRect.size.height -= 1.0f; - aRect.origin.y += 0.5f; - // frame - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y+aRect.size.height)]; - [bezier stroke]; - } else { - - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - - aRect.origin.x += 0.5; - - // background - MojaveNSDrawWindowBackground(aRect, [self backgroundColor:cell isKeyWindow:isKeyWindow isSelected:NO]); - - // frame - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y)]; - if(!([cell tabState] & PSMTab_RightIsSelectedMask)){ - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y + aRect.size.height)]; - } - [bezier stroke]; - } - - [self drawInteriorWithTabCell:cell inView:[cell controlView]]; -} - -- (NSImage *)createCloseButtonImage:(CGFloat)size color:(NSColor *)color backgroundColor:(NSColor *)backgroundColor -{ - NSImage *result = [NSImage imageWithSize:NSMakeSize(size,size) flipped:YES drawingHandler:^BOOL(NSRect dstRect) { - if (backgroundColor) { - NSBezierPath *bezier = [NSBezierPath bezierPathWithRoundedRect:dstRect - xRadius:2.0 - yRadius:2.0]; - [backgroundColor set]; - [bezier fill]; - } - - NSBezierPath *bezier = NSBezierPath.bezierPath; - - [color set]; - [bezier moveToPoint:NSMakePoint(NSMinX(dstRect)+4.5, NSMinY(dstRect)+4.5)]; - [bezier lineToPoint:NSMakePoint(NSMaxX(dstRect)-4.5, NSMaxY(dstRect)-4.5)]; - [bezier moveToPoint:NSMakePoint(NSMaxX(dstRect)-4.5, NSMinY(dstRect)+4.5)]; - [bezier lineToPoint:NSMakePoint(NSMinX(dstRect)+4.5, NSMaxY(dstRect)-4.5)]; - [bezier stroke]; - - return YES; - }]; - - return result; -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - float labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage *button = nil; - - if ([cell isHighlighted]) { - button = closeButton; - } - if ([cell closeButtonOver]) { - if (@available(macos 10.14, *)) { - NSAppearanceName appearanceName = [controlView.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameAccessibilityHighContrastAqua, NSAppearanceNameDarkAqua, NSAppearanceNameAccessibilityHighContrastDarkAqua]]; - - if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua] || [appearanceName isEqualToString:NSAppearanceNameAccessibilityHighContrastDarkAqua]) { - button = closeButtonOverDark; - } else { - button = closeButtonOver; - } - } - } - if ([cell closeButtonPressed]) button = closeButtonDown; - - closeButtonSize = [button size]; - [button drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil]; - } - - // object counter - if([cell count] > 0){ - [[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - labelRect.size.height = cellFrame.size.height; - labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - - if([cell count] > 0) - labelRect.size.width -= ([self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding); - - // label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - BOOL isKeyWindow = [bar.window isKeyWindow]; - MojaveNSDrawWindowBackground(rect, [self backgroundColor:nil isKeyWindow:isKeyWindow isSelected:NO]); - - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.0] set]; - NSRectFillUsingOperation(rect, NSCompositingOperationSourceAtop); - [[self borderColor:isKeyWindow] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,rect.origin.y+0.5) toPoint:NSMakePoint(rect.origin.x+rect.size.width,rect.origin.y+0.5)]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,rect.origin.y+rect.size.height-0.5) toPoint:NSMakePoint(rect.origin.x+rect.size.width,rect.origin.y+rect.size.height-0.5)]; - - // no tab view == not connected - if(![bar tabView]){ - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [centeredParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - if(![cell isInOverflowMenu]){ - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:closeButton forKey:@"metalCloseButton"]; - [aCoder encodeObject:closeButtonDown forKey:@"metalCloseButtonDown"]; - [aCoder encodeObject:closeButtonOver forKey:@"metalCloseButtonOver"]; - [aCoder encodeObject:closeButtonOverDark forKey:@"metalCloseButtonOverDark"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - if ([aDecoder allowsKeyedCoding]) { - closeButton = [[aDecoder decodeObjectForKey:@"metalCloseButton"] retain]; - closeButtonDown = [[aDecoder decodeObjectForKey:@"metalCloseButtonDown"] retain]; - closeButtonOver = [[aDecoder decodeObjectForKey:@"metalCloseButtonOver"] retain]; - closeButtonOverDark = [[aDecoder decodeObjectForKey:@"metalCloseButtonOverDark"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - } - - return self; -} - -@end - -#endif diff --git a/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.h b/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.h deleted file mode 100644 index 1ee16bdcb2..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// PSMOverflowPopUpButton.h -// PSMTabBarControl -// -// Created by John Pannell on 11/4/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import - - -@interface PSMOverflowPopUpButton : NSPopUpButton { - NSImage *_PSMTabBarOverflowPopUpImage; - NSImage *_PSMTabBarOverflowDownPopUpImage; - BOOL _down; -} - -// archiving -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.m b/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.m deleted file mode 100644 index 2b36b745e2..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.m +++ /dev/null @@ -1,90 +0,0 @@ -// -// PSMOverflowPopUpButton.m -// PSMTabBarControl -// -// Created by John Pannell on 11/4/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import "PSMOverflowPopUpButton.h" -#import "PSMTabBarControl.h" - -@implementation PSMOverflowPopUpButton - -- (id)initWithFrame:(NSRect)frameRect pullsDown:(BOOL)flag -{ - self=[super initWithFrame:frameRect pullsDown:YES]; - if (self) { - [self setBezelStyle:NSRegularSquareBezelStyle]; - [self setBordered:NO]; - [self setTitle:@""]; - [self setPreferredEdge:NSMaxXEdge]; - _PSMTabBarOverflowPopUpImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"overflowImage"]]; - _PSMTabBarOverflowDownPopUpImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"overflowImagePressed"]]; - } - return self; -} - -- (void)dealloc -{ - [_PSMTabBarOverflowPopUpImage release]; - [_PSMTabBarOverflowDownPopUpImage release]; - [super dealloc]; -} - -- (void)drawRect:(NSRect)rect -{ - if(_PSMTabBarOverflowPopUpImage == nil){ - [super drawRect:rect]; - return; - } - - NSImage *image = (_down) ? _PSMTabBarOverflowDownPopUpImage : _PSMTabBarOverflowPopUpImage; - NSSize imageSize = [image size]; - NSRect bounds = [self bounds]; - NSPoint drawPoint = NSMakePoint(NSMidX(bounds) - (imageSize.width * 0.5f), - NSMidY(bounds) - (imageSize.height * 0.5f)); - [image drawAtPoint:drawPoint - fromRect:NSZeroRect - operation:NSCompositingOperationSourceOver - fraction:1.0f]; -} - -- (void)mouseDown:(NSEvent *)event -{ - _down = YES; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationReceived:) name:NSMenuDidEndTrackingNotification object:[self menu]]; - [self setNeedsDisplay:YES]; - [super mouseDown:event]; -} - -- (void)notificationReceived:(NSNotification *)notification -{ - _down = NO; - [self setNeedsDisplay:YES]; - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:_PSMTabBarOverflowPopUpImage forKey:@"PSMTabBarOverflowPopUpImage"]; - [aCoder encodeObject:_PSMTabBarOverflowDownPopUpImage forKey:@"PSMTabBarOverflowDownPopUpImage"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self) { - if ([aDecoder allowsKeyedCoding]) { - _PSMTabBarOverflowPopUpImage = [[aDecoder decodeObjectForKey:@"PSMTabBarOverflowPopUpImage"] retain]; - _PSMTabBarOverflowDownPopUpImage = [[aDecoder decodeObjectForKey:@"PSMTabBarOverflowDownPopUpImage"] retain]; - } - } - return self; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.h b/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.h deleted file mode 100644 index 8f56bd73ae..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// PSMProgressIndicator.h -// PSMTabBarControl -// -// Created by John Pannell on 2/23/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import -#import "PSMTabBarControl.h" - - -@interface PSMProgressIndicator : NSProgressIndicator { - -} - -@end - -@interface PSMTabBarControl (LayoutPlease) - -- (void)update; - -@end \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.m b/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.m deleted file mode 100644 index d3046d518a..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.m +++ /dev/null @@ -1,20 +0,0 @@ -// -// PSMProgressIndicator.m -// PSMTabBarControl -// -// Created by John Pannell on 2/23/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import "PSMProgressIndicator.h" - -@implementation PSMProgressIndicator - -// overrides to make tab bar control re-layout things if status changes -- (void)setHidden:(BOOL)flag -{ - [super setHidden:flag]; - [(PSMTabBarControl *)[self superview] update]; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.h b/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.h deleted file mode 100644 index d78b47c272..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// PSMOverflowPopUpButton.h -// NetScrape -// -// Created by John Pannell on 8/4/04. -// Copyright 2004 Positive Spin Media. All rights reserved. -// - -#import - -@interface PSMRolloverButton : NSButton -{ - NSImage *_rolloverImage; - NSImage *_usualImage; - NSTrackingRectTag _myTrackingRectTag; -} - -// the regular image -- (void)setUsualImage:(NSImage *)newImage; -- (NSImage *)usualImage; - -// the rollover image -- (void)setRolloverImage:(NSImage *)newImage; -- (NSImage *)rolloverImage; - -// tracking rect for mouse events -- (void)addTrackingRect; -- (void)removeTrackingRect; -@end \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.m b/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.m deleted file mode 100644 index bf390efc0c..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.m +++ /dev/null @@ -1,117 +0,0 @@ -// -// PSMOverflowPopUpButton.m -// NetScrape -// -// Created by John Pannell on 8/4/04. -// Copyright 2004 Positive Spin Media. All rights reserved. -// - -#import "PSMRolloverButton.h" - -@implementation PSMRolloverButton - -- (void)dealloc -{ - [_usualImage release]; - [_rolloverImage release]; - - [super dealloc]; -} - -// the regular image -- (void)setUsualImage:(NSImage *)newImage -{ - [newImage retain]; - [_usualImage release]; - _usualImage = newImage; - [self setImage:_usualImage]; -} - -- (NSImage *)usualImage -{ - return _usualImage; -} - -- (void)setRolloverImage:(NSImage *)newImage -{ - [newImage retain]; - [_rolloverImage release]; - _rolloverImage = newImage; -} - -- (NSImage *)rolloverImage -{ - return _rolloverImage; -} - -- (void)addTrackingRect -{ - // assign a tracking rect to watch for mouse enter/exit - _myTrackingRectTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO]; -} - -- (void)removeTrackingRect -{ - if (_myTrackingRectTag != 0) - [self removeTrackingRect:_myTrackingRectTag]; - _myTrackingRectTag = 0; -} - -// override for rollover effect -- (void)mouseEntered:(NSEvent *)theEvent; -{ - // set rollover image - [self setImage:_rolloverImage]; - [self setNeedsDisplay]; - [[self superview] setNeedsDisplay:YES]; // eliminates a drawing artifact -} - -- (void)mouseExited:(NSEvent *)theEvent; -{ - // restore usual image - [self setImage:_usualImage]; - [self setNeedsDisplay]; - [[self superview] setNeedsDisplay:YES]; // eliminates a drawing artifact -} - -- (void)mouseDown:(NSEvent *)theEvent -{ - // eliminates drawing artifact - [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:[self superview] argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; - [super mouseDown:theEvent]; -} - -- (void)resetCursorRects -{ - // called when the button rect has been changed - [self removeTrackingRect]; - [self addTrackingRect]; - [[self superview] setNeedsDisplay:YES]; // eliminates a drawing artifact -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:_rolloverImage forKey:@"rolloverImage"]; - [aCoder encodeObject:_usualImage forKey:@"usualImage"]; - [aCoder encodeInteger:_myTrackingRectTag forKey:@"myTrackingRectTag"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self) { - if ([aDecoder allowsKeyedCoding]) { - _rolloverImage = [[aDecoder decodeObjectForKey:@"rolloverImage"] retain]; - _usualImage = [[aDecoder decodeObjectForKey:@"usualImage"] retain]; - _myTrackingRectTag = [aDecoder decodeIntegerForKey:@"myTrackingRectTag"]; - } - } - return self; -} - - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.h b/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.h deleted file mode 100644 index 4c28ffc831..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.h +++ /dev/null @@ -1,105 +0,0 @@ -// -// PSMTabBarCell.h -// PSMTabBarControl -// -// Created by John Pannell on 10/13/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import -#import "PSMTabBarControl.h" - -@class PSMTabBarControl; -@class PSMProgressIndicator; - -@interface PSMTabBarCell : NSActionCell { - // sizing - NSRect _frame; - NSSize _stringSize; - int _currentStep; - BOOL _isPlaceholder; - - // state - int _tabState; - NSTrackingRectTag _closeButtonTrackingTag; // left side tracking, if dragging - NSTrackingRectTag _cellTrackingTag; // right side tracking, if dragging - BOOL _closeButtonOver; - BOOL _closeButtonPressed; - PSMProgressIndicator *_indicator; - BOOL _isInOverflowMenu; - BOOL _hasCloseButton; - BOOL _isCloseButtonSuppressed; - BOOL _hasIcon; - int _count; - NSString *_toolTip; -} - -@property(assign) PSMTabBarControl* controlView; - -// creation/destruction -- (id)initWithControlView:(PSMTabBarControl *)controlView; -- (id)initPlaceholderWithFrame:(NSRect)frame expanded:(BOOL)value inControlView:(PSMTabBarControl *)controlView; -- (void)dealloc; - -// accessors -- (NSTrackingRectTag)closeButtonTrackingTag; -- (void)setCloseButtonTrackingTag:(NSTrackingRectTag)tag; -- (NSTrackingRectTag)cellTrackingTag; -- (void)setCellTrackingTag:(NSTrackingRectTag)tag; -- (float)width; -- (NSRect)frame; -- (void)setFrame:(NSRect)rect; -- (void)setStringValue:(NSString *)aString; -- (NSSize)stringSize; -- (NSAttributedString *)attributedStringValue; -- (int)tabState; -- (void)setTabState:(int)state; -- (NSProgressIndicator *)indicator; -- (BOOL)isInOverflowMenu; -- (void)setIsInOverflowMenu:(BOOL)value; -- (BOOL)closeButtonPressed; -- (void)setCloseButtonPressed:(BOOL)value; -- (BOOL)closeButtonOver; -- (void)setCloseButtonOver:(BOOL)value; -- (BOOL)hasCloseButton; -- (void)setHasCloseButton:(BOOL)set; -- (void)setCloseButtonSuppressed:(BOOL)suppress; -- (BOOL)isCloseButtonSuppressed; -- (BOOL)hasIcon; -- (void)setHasIcon:(BOOL)value; -- (int)count; -- (void)setCount:(int)value; -- (BOOL)isPlaceholder; -- (void)setIsPlaceholder:(BOOL)value; -- (int)currentStep; -- (void)setCurrentStep:(int)value; -- (NSString *)toolTip; -- (void)setToolTip:(NSString *)tip; - -// component attributes -- (NSRect)indicatorRectForFrame:(NSRect)cellFrame; -- (NSRect)closeButtonRectForFrame:(NSRect)cellFrame; -- (float)minimumWidthOfCell; -- (float)desiredWidthOfCell; - -// drawing -- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - -// tracking the mouse -- (void)mouseEntered:(NSEvent *)theEvent; -- (void)mouseExited:(NSEvent *)theEvent; - -// drag support -- (NSImage*)dragImageForRect:(NSRect)cellFrame; - -// archiving -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - -@end - -@interface PSMTabBarControl (CellAccessors) - -- (id)psmTabStyle; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.m b/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.m deleted file mode 100644 index d85d895d7f..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.m +++ /dev/null @@ -1,404 +0,0 @@ -// -// PSMTabBarCell.m -// PSMTabBarControl -// -// Created by John Pannell on 10/13/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" -#import "PSMTabStyle.h" -#import "PSMProgressIndicator.h" -#import "PSMTabDragAssistant.h" - - -@implementation PSMTabBarCell -@dynamic controlView; - -#pragma mark - -#pragma mark Creation/Destruction -- (id)initWithControlView:(PSMTabBarControl *)controlView -{ - self = [super init]; - if(self){ - self.controlView = controlView; - _closeButtonTrackingTag = 0; - _cellTrackingTag = 0; - _closeButtonOver = NO; - _closeButtonPressed = NO; - _indicator = [[PSMProgressIndicator alloc] initWithFrame:NSMakeRect(0.0,0.0,kPSMTabBarIndicatorWidth,kPSMTabBarIndicatorWidth)]; - [_indicator setStyle:NSProgressIndicatorSpinningStyle]; - [_indicator setAutoresizingMask:NSViewMinYMargin]; - _hasCloseButton = YES; - _isCloseButtonSuppressed = NO; - _count = 0; - _isPlaceholder = NO; - } - return self; -} - -- (id)initPlaceholderWithFrame:(NSRect)frame expanded:(BOOL)value inControlView:(PSMTabBarControl *)controlView -{ - self = [super init]; - if(self){ - self.controlView = controlView; - _isPlaceholder = YES; - if(!value) - frame.size.width = 0.0; - [self setFrame:frame]; - _closeButtonTrackingTag = 0; - _cellTrackingTag = 0; - _closeButtonOver = NO; - _closeButtonPressed = NO; - _indicator = nil; - _hasCloseButton = YES; - _isCloseButtonSuppressed = NO; - _count = 0; - - if(value){ - [self setCurrentStep:(kPSMTabDragAnimationSteps - 1)]; - } else { - [self setCurrentStep:0]; - } - - } - - return self; -} - -- (void)dealloc -{ - [_indicator release]; - [_toolTip release]; - [super dealloc]; -} - -#pragma mark - -#pragma mark Accessors - -- (NSTrackingRectTag)closeButtonTrackingTag -{ - return _closeButtonTrackingTag; -} - -- (void)setCloseButtonTrackingTag:(NSTrackingRectTag)tag -{ - _closeButtonTrackingTag = tag; -} - -- (NSTrackingRectTag)cellTrackingTag -{ - return _cellTrackingTag; -} - -- (void)setCellTrackingTag:(NSTrackingRectTag)tag -{ - _cellTrackingTag = tag; -} - -- (float)width -{ - return _frame.size.width; -} - -- (NSRect)frame -{ - return _frame; -} - -- (void)setFrame:(NSRect)rect -{ - _frame = rect; -} - -- (void)setStringValue:(NSString *)aString -{ - [super setStringValue:aString]; - _stringSize = [[self attributedStringValue] size]; - // need to redisplay now - binding observation was too quick. - [self.controlView update]; -} - -- (NSSize)stringSize -{ - return _stringSize; -} - -- (NSAttributedString *)attributedStringValue -{ - return [[self.controlView psmTabStyle] attributedStringValueForTabCell:self]; -} - -- (int)tabState -{ - return _tabState; -} - -- (void)setTabState:(int)state -{ - _tabState = state; -} - -- (NSProgressIndicator *)indicator -{ - return _indicator; -} - -- (BOOL)isInOverflowMenu -{ - return _isInOverflowMenu; -} - -- (void)setIsInOverflowMenu:(BOOL)value -{ - _isInOverflowMenu = value; -} - -- (BOOL)closeButtonPressed -{ - return _closeButtonPressed; -} - -- (void)setCloseButtonPressed:(BOOL)value -{ - _closeButtonPressed = value; -} - -- (BOOL)closeButtonOver -{ - return _closeButtonOver; -} - -- (void)setCloseButtonOver:(BOOL)value -{ - _closeButtonOver = value; -} - -- (BOOL)hasCloseButton -{ - return _hasCloseButton; -} - -- (void)setHasCloseButton:(BOOL)set; -{ - _hasCloseButton = set; -} - -- (void)setCloseButtonSuppressed:(BOOL)suppress; -{ - _isCloseButtonSuppressed = suppress; -} - -- (BOOL)isCloseButtonSuppressed; -{ - return _isCloseButtonSuppressed; -} - -- (BOOL)hasIcon -{ - return _hasIcon; -} - -- (void)setHasIcon:(BOOL)value -{ - _hasIcon = value; - [self.controlView update]; // binding notice is too fast -} - -- (int)count -{ - return _count; -} - -- (void)setCount:(int)value -{ - _count = value; - [self.controlView update]; // binding notice is too fast -} - -- (BOOL)isPlaceholder -{ - return _isPlaceholder; -} - -- (void)setIsPlaceholder:(BOOL)value; -{ - _isPlaceholder = value; -} - -- (int)currentStep -{ - return _currentStep; -} - -- (void)setCurrentStep:(int)value -{ - if(value < 0) - value = 0; - - if(value > (kPSMTabDragAnimationSteps - 1)) - value = (kPSMTabDragAnimationSteps - 1); - - _currentStep = value; -} - -- (NSString *)toolTip -{ - return _toolTip; -} - -- (void)setToolTip:(NSString *)tip -{ - if (tip != _toolTip) { - [_toolTip release]; - _toolTip = [tip copy]; - } -} - -#pragma mark - -#pragma mark Component Attributes - -- (NSRect)indicatorRectForFrame:(NSRect)cellFrame -{ - return [[self.controlView psmTabStyle] indicatorRectForTabCell:self]; -} - -- (NSRect)closeButtonRectForFrame:(NSRect)cellFrame -{ - return [[self.controlView psmTabStyle] closeButtonRectForTabCell:self]; -} - -- (float)minimumWidthOfCell -{ - return [[self.controlView psmTabStyle] minimumWidthOfTabCell:self]; -} - -- (float)desiredWidthOfCell -{ - return [[self.controlView psmTabStyle] desiredWidthOfTabCell:self]; -} - -#pragma mark - -#pragma mark Drawing - -- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView -{ - if(_isPlaceholder){ - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; - NSRectFillUsingOperation(cellFrame, NSCompositingOperationSourceAtop); - return; - } - - [[self.controlView psmTabStyle] drawTabCell:self]; -} - -#pragma mark - -#pragma mark Tracking - -- (void)mouseEntered:(NSEvent *)theEvent -{ - // check for which tag - if([theEvent trackingNumber] == _closeButtonTrackingTag){ - _closeButtonOver = YES; - } - if([theEvent trackingNumber] == _cellTrackingTag){ - [self setHighlighted:YES]; - } - [self.controlView setNeedsDisplay]; -} - -- (void)mouseExited:(NSEvent *)theEvent -{ - // check for which tag - if([theEvent trackingNumber] == _closeButtonTrackingTag){ - _closeButtonOver = NO; - } - if([theEvent trackingNumber] == _cellTrackingTag){ - [self setHighlighted:NO]; - } - [self.controlView setNeedsDisplay]; -} - -#pragma mark - -#pragma mark Drag Support - -- (NSImage*)dragImageForRect:(NSRect)cellFrame -{ - if(([self state] == NSOnState) && ([[self.controlView styleName] isEqualToString:@"Metal"])) - cellFrame.size.width += 1.0; - [self.controlView lockFocus]; - - NSBitmapImageRep *rep = [[self controlView] bitmapImageRepForCachingDisplayInRect:cellFrame]; - [[self controlView] cacheDisplayInRect:cellFrame toBitmapImageRep:rep]; - - [self.controlView unlockFocus]; - NSImage *image = [[[NSImage alloc] initWithSize:[rep size]] autorelease]; - [image addRepresentation:rep]; - NSImage *returnImage = [[[NSImage alloc] initWithSize:[rep size]] autorelease]; - [returnImage lockFocus]; - [image drawAtPoint:NSMakePoint(0.0, 0.0) fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:0.7]; - [returnImage unlockFocus]; - if(![[self indicator] isHidden]){ - NSImage *pi = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"pi"]]; - [returnImage lockFocus]; - NSPoint indicatorPoint = NSMakePoint([self frame].size.width - MARGIN_X - kPSMTabBarIndicatorWidth, MARGIN_Y); - if(([self state] == NSOnState) && ([[self.controlView styleName] isEqualToString:@"Metal"])) - indicatorPoint.y += 1.0; - [pi drawAtPoint:indicatorPoint fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:0.7]; - [returnImage unlockFocus]; - [pi release]; - } - return returnImage; -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeRect:_frame forKey:@"frame"]; - [aCoder encodeSize:_stringSize forKey:@"stringSize"]; - [aCoder encodeInt:_currentStep forKey:@"currentStep"]; - [aCoder encodeBool:_isPlaceholder forKey:@"isPlaceholder"]; - [aCoder encodeInt:_tabState forKey:@"tabState"]; - [aCoder encodeInteger:_closeButtonTrackingTag forKey:@"closeButtonTrackingTag"]; - [aCoder encodeInteger:_cellTrackingTag forKey:@"cellTrackingTag"]; - [aCoder encodeBool:_closeButtonOver forKey:@"closeButtonOver"]; - [aCoder encodeBool:_closeButtonPressed forKey:@"closeButtonPressed"]; - [aCoder encodeObject:_indicator forKey:@"indicator"]; - [aCoder encodeBool:_isInOverflowMenu forKey:@"isInOverflowMenu"]; - [aCoder encodeBool:_hasCloseButton forKey:@"hasCloseButton"]; - [aCoder encodeBool:_isCloseButtonSuppressed forKey:@"isCloseButtonSuppressed"]; - [aCoder encodeBool:_hasIcon forKey:@"hasIcon"]; - [aCoder encodeInt:_count forKey:@"count"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self) { - if ([aDecoder allowsKeyedCoding]) { - _frame = [aDecoder decodeRectForKey:@"frame"]; - NSLog(@"decoding cell"); - _stringSize = [aDecoder decodeSizeForKey:@"stringSize"]; - _currentStep = [aDecoder decodeIntForKey:@"currentStep"]; - _isPlaceholder = [aDecoder decodeBoolForKey:@"isPlaceholder"]; - _tabState = [aDecoder decodeIntForKey:@"tabState"]; - _closeButtonTrackingTag = [aDecoder decodeIntegerForKey:@"closeButtonTrackingTag"]; - _cellTrackingTag = [aDecoder decodeIntegerForKey:@"cellTrackingTag"]; - _closeButtonOver = [aDecoder decodeBoolForKey:@"closeButtonOver"]; - _closeButtonPressed = [aDecoder decodeBoolForKey:@"closeButtonPressed"]; - _indicator = [[aDecoder decodeObjectForKey:@"indicator"] retain]; - _isInOverflowMenu = [aDecoder decodeBoolForKey:@"isInOverflowMenu"]; - _hasCloseButton = [aDecoder decodeBoolForKey:@"hasCloseButton"]; - _isCloseButtonSuppressed = [aDecoder decodeBoolForKey:@"isCloseButtonSuppressed"]; - _hasIcon = [aDecoder decodeBoolForKey:@"hasIcon"]; - _count = [aDecoder decodeIntForKey:@"count"]; - } - } - return self; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h deleted file mode 100644 index 4b320f4c8d..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h +++ /dev/null @@ -1,155 +0,0 @@ -// -// PSMTabBarControl.h -// PSMTabBarControl -// -// Created by John Pannell on 10/13/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -/* - This view provides a control interface to manage a regular NSTabView. It looks and works like the tabbed browsing interface of many popular browsers. - */ - -#import - -#if !defined(MAC_OS_X_VERSION_10_12) || \ - MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 -# define NSCompositingOperationSourceOver NSCompositeSourceOver -# define NSCompositingOperationSourceAtop NSCompositeSourceAtop -# define NSTextAlignmentCenter NSCenterTextAlignment -#endif -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 -# define kPSMTabBarControlHeight 25 -#else -# define kPSMTabBarControlHeight 22 -#endif -// internal cell border -#define MARGIN_X 6 -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 -# define MARGIN_Y 5 -#else -# define MARGIN_Y 3 -#endif -// padding between objects -#define kPSMTabBarCellPadding 4 -// fixed size objects -#define kPSMMinimumTitleWidth 30 -#define kPSMTabBarIndicatorWidth 16.0 -#define kPSMTabBarIconWidth 16.0 -#define kPSMHideAnimationSteps 2.0 - -@class PSMOverflowPopUpButton; -@class PSMRolloverButton; -@class PSMTabBarCell; -@protocol PSMTabStyle; - -enum { - PSMTab_SelectedMask = 1 << 1, - PSMTab_LeftIsSelectedMask = 1 << 2, - PSMTab_RightIsSelectedMask = 1 << 3, - PSMTab_PositionLeftMask = 1 << 4, - PSMTab_PositionMiddleMask = 1 << 5, - PSMTab_PositionRightMask = 1 << 6, - PSMTab_PositionSingleMask = 1 << 7 -}; - -@interface PSMTabBarControl : NSControl -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060) - // 10.6 has turned delegate messages into formal protocols - -#endif -{ - - // control basics - NSMutableArray *_cells; // the cells that draw the tabs - IBOutlet NSTabView *tabView; // the tab view being navigated - PSMOverflowPopUpButton *_overflowPopUpButton; // for too many tabs - PSMRolloverButton *_addTabButton; - - // drawing style - id style; - BOOL _canCloseOnlyTab; - BOOL _hideForSingleTab; - BOOL _showAddTabButton; - BOOL _sizeCellsToFit; - - // cell width - int _cellMinWidth; - int _cellMaxWidth; - int _cellOptimumWidth; - - // animation for hide/show - int _currentStep; - BOOL _isHidden; - BOOL _hideIndicators; - IBOutlet id partnerView; // gets resized when hide/show - BOOL _awakenedFromNib; - - // drag and drop - NSEvent *_lastMouseDownEvent; // keep this for dragging reference - BOOL _allowsDragBetweenWindows; - BOOL _delegateHandlingDrag; - NSDragOperation _delegateInitialDragOperation; - - // MVC help - IBOutlet id delegate; -} - -// control characteristics -+ (NSBundle *)bundle; - -// control configuration -- (BOOL)canCloseOnlyTab; -- (void)setCanCloseOnlyTab:(BOOL)value; -- (NSString *)styleName; -- (void)setStyleNamed:(NSString *)name; -- (BOOL)hideForSingleTab; -- (void)setHideForSingleTab:(BOOL)value; -- (BOOL)showAddTabButton; -- (void)setShowAddTabButton:(BOOL)value; -- (int)cellMinWidth; -- (void)setCellMinWidth:(int)value; -- (int)cellMaxWidth; -- (void)setCellMaxWidth:(int)value; -- (int)cellOptimumWidth; -- (void)setCellOptimumWidth:(int)value; -- (BOOL)sizeCellsToFit; -- (void)setSizeCellsToFit:(BOOL)value; -- (BOOL)allowsDragBetweenWindows; -- (void)setAllowsDragBetweenWindows:(BOOL)flag; - -// tool tips -- (void)setToolTip:(NSString *)value forTabViewItem:(NSTabViewItem *)tvi; - -// accessors -- (NSTabView *)tabView; -- (void)setTabView:(NSTabView *)view; -- (id)delegate; -- (void)setDelegate:(id)object; -- (id)partnerView; -- (void)setPartnerView:(id)view; - -// the buttons -- (PSMRolloverButton *)addTabButton; -- (PSMOverflowPopUpButton *)overflowPopUpButton; -- (NSMutableArray *)representedTabViewItems; - -// special effects -- (void)hideTabBar:(BOOL)hide animate:(BOOL)animate; - -@end - - -@interface NSObject (TabBarControlDelegateMethods) -- (BOOL)tabView:(NSTabView *)aTabView shouldCloseTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)aTabView willCloseTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)aTabView didCloseTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)aTabView didDragTabViewItem:(NSTabViewItem *)tabViewItem toIndex:(int)idx; - -- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingEntered:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingUpdated:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -- (void)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingExited:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl prepareForDragOperation:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl performDragOperation:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -- (void)tabBarControl:(PSMTabBarControl *)theTabBarControl concludeDragOperation:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m deleted file mode 100644 index 0fc60bf491..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m +++ /dev/null @@ -1,1492 +0,0 @@ -// -// PSMTabBarControl.m -// PSMTabBarControl -// -// Created by John Pannell on 10/13/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import "PSMTabBarControl.h" -#import "PSMTabBarCell.h" -#import "PSMOverflowPopUpButton.h" -#import "PSMRolloverButton.h" -#import "PSMTabStyle.h" -#import "PSMMetalTabStyle.h" -#import "PSMMojaveTabStyle.h" -#import "PSMUnifiedTabStyle.h" -#import "PSMYosemiteTabStyle.h" -#import "PSMTabDragAssistant.h" - -@interface PSMTabBarControl (Private) -// characteristics -- (float)availableCellWidth; -- (NSRect)genericCellRect; - - // constructor/destructor -- (void)initAddedProperties; -- (void)dealloc; - - // accessors -- (NSEvent *)lastMouseDownEvent; -- (void)setLastMouseDownEvent:(NSEvent *)event; - - // contents -- (void)addTabViewItem:(NSTabViewItem *)item; -- (void)removeTabForCell:(PSMTabBarCell *)cell; - - // draw -- (void)update; - - // actions -- (void)overflowMenuAction:(id)sender; -- (void)closeTabClick:(id)sender; -- (void)tabClick:(id)sender; -- (void)tabNothing:(id)sender; -- (void)frameDidChange:(NSNotification *)notification; -- (void)windowDidMove:(NSNotification *)aNotification; -- (void)windowStatusDidChange:(NSNotification *)notification; - - // NSTabView delegate -- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem; -- (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)tabView; - - // archiving -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - - // convenience -- (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame; -- (NSUInteger)indexOfCellAtPoint:(NSPoint)point; -- (NSUInteger)indexOfCellAtPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame; -- (PSMTabBarCell *)lastVisibleTab; -- (int)numberOfVisibleTabs; - -@end - -@implementation PSMTabBarControl -#pragma mark - -#pragma mark Characteristics -+ (NSBundle *)bundle; -{ - static NSBundle *bundle = nil; - if (!bundle) bundle = [NSBundle bundleForClass:[PSMTabBarControl class]]; - return bundle; -} - -- (float)availableCellWidth -{ - float width = [self frame].size.width; - width = width - [style leftMarginForTabBarControl] - [style rightMarginForTabBarControl]; - return width; -} - -- (NSRect)genericCellRect -{ - NSRect aRect=[self frame]; - aRect.origin.x = [style leftMarginForTabBarControl]; - aRect.origin.y = 0.0; - aRect.size.width = [self availableCellWidth]; - aRect.size.height = kPSMTabBarControlHeight; - return aRect; -} - -#pragma mark - -#pragma mark Constructor/destructor - -- (void)initAddedProperties -{ - _cells = [[NSMutableArray alloc] initWithCapacity:10]; - - // default config - _allowsDragBetweenWindows = YES; - _delegateHandlingDrag = NO; - _canCloseOnlyTab = NO; - _showAddTabButton = NO; - _hideForSingleTab = NO; - _sizeCellsToFit = NO; - _isHidden = NO; - _hideIndicators = NO; - _awakenedFromNib = NO; - _cellMinWidth = 100; - _cellMaxWidth = 280; - _cellOptimumWidth = 130; - style = [[PSMMetalTabStyle alloc] init]; - - // the overflow button/menu - NSRect overflowButtonRect = NSMakeRect([self frame].size.width - [style rightMarginForTabBarControl] + 1, 0, [style rightMarginForTabBarControl] - 1, [self frame].size.height); - _overflowPopUpButton = [[PSMOverflowPopUpButton alloc] initWithFrame:overflowButtonRect pullsDown:YES]; - if(_overflowPopUpButton){ - // configure - [_overflowPopUpButton setAutoresizingMask:NSViewNotSizable|NSViewMinXMargin]; - } - - // new tab button - NSRect addTabButtonRect = NSMakeRect([self frame].size.width - [style rightMarginForTabBarControl] + 1, 3.0, 16.0, 16.0); - _addTabButton = [[PSMRolloverButton alloc] initWithFrame:addTabButtonRect]; - if(_addTabButton){ - NSImage *newButtonImage = [style addTabButtonImage]; - if(newButtonImage) - [_addTabButton setUsualImage:newButtonImage]; - newButtonImage = [style addTabButtonPressedImage]; - if(newButtonImage) - [_addTabButton setAlternateImage:newButtonImage]; - newButtonImage = [style addTabButtonRolloverImage]; - if(newButtonImage) - [_addTabButton setRolloverImage:newButtonImage]; - [_addTabButton setTitle:@""]; - [_addTabButton setImagePosition:NSImageOnly]; - [_addTabButton setButtonType:NSMomentaryChangeButton]; - [_addTabButton setBordered:NO]; - [_addTabButton setBezelStyle:NSShadowlessSquareBezelStyle]; - if(_showAddTabButton){ - [_addTabButton setHidden:NO]; - } else { - [_addTabButton setHidden:YES]; - } - [_addTabButton setNeedsDisplay:YES]; - } - -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 140000 - [self setClipsToBounds:YES]; -#endif -} - -- (id)initWithFrame:(NSRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - // Initialization - [self initAddedProperties]; - [self registerForDraggedTypes:[NSArray arrayWithObjects: @"PSMTabBarControlItemPBType", nil]]; - } - [self setTarget:self]; - return self; -} - -- (void)dealloc -{ - [_overflowPopUpButton release]; - [_cells release]; - [tabView release]; - [_addTabButton release]; - [partnerView release]; - [_lastMouseDownEvent release]; - [style release]; - [delegate release]; - - [self unregisterDraggedTypes]; - - [super dealloc]; -} - -- (void)awakeFromNib -{ - // build cells from existing tab view items - NSArray *existingItems = [tabView tabViewItems]; - NSEnumerator *e = [existingItems objectEnumerator]; - NSTabViewItem *item; - while(item = [e nextObject]){ - if(![[self representedTabViewItems] containsObject:item]) - [self addTabViewItem:item]; - } - - // resize - [self setPostsFrameChangedNotifications:YES]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(frameDidChange:) name:NSViewFrameDidChangeNotification object:self]; - - // window status - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowStatusDidChange:) name:NSWindowDidBecomeKeyNotification object:[self window]]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowStatusDidChange:) name:NSWindowDidResignKeyNotification object:[self window]]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:[self window]]; -} - - -#pragma mark - -#pragma mark Accessors - -- (NSMutableArray *)cells -{ - return _cells; -} - -- (NSEvent *)lastMouseDownEvent -{ - return _lastMouseDownEvent; -} - -- (void)setLastMouseDownEvent:(NSEvent *)event -{ - [event retain]; - [_lastMouseDownEvent release]; - _lastMouseDownEvent = event; -} - -- (id)delegate -{ - return delegate; -} - -- (void)setDelegate:(id)object -{ - [object retain]; - [delegate release]; - delegate = object; -} - -- (NSTabView *)tabView -{ - return tabView; -} - -- (void)setTabView:(NSTabView *)view -{ - [view retain]; - [tabView release]; - tabView = view; -} - -- (id)psmTabStyle -{ - return style; -} - -- (NSString *)styleName -{ - return [style name]; -} - -- (void)setStyleNamed:(NSString *)name -{ - [style release]; - if([name isEqualToString:@"Unified"]){ - style = [[PSMUnifiedTabStyle alloc] init]; - } else if([name isEqualToString:@"Yosemite"]){ - style = [[PSMYosemiteTabStyle alloc] init]; -#if HAS_MOJAVE_TAB_STYLE - } else if([name isEqualToString:@"Mojave"]){ - style = [[PSMMojaveTabStyle alloc] init]; -#endif - } else { - style = [[PSMMetalTabStyle alloc] init]; - } - - // restyle add tab button - if(_addTabButton){ - if ([style respondsToSelector:@selector(styleAddTabButton:)]) { - [style performSelector:@selector(styleAddTabButton:) withObject:_addTabButton]; - } else { - NSImage *newButtonImage = [style addTabButtonImage]; - if(newButtonImage) - [_addTabButton setUsualImage:newButtonImage]; - newButtonImage = [style addTabButtonPressedImage]; - if(newButtonImage) - [_addTabButton setAlternateImage:newButtonImage]; - newButtonImage = [style addTabButtonRolloverImage]; - if(newButtonImage) - [_addTabButton setRolloverImage:newButtonImage]; - } - } - - [self update]; -} - -- (BOOL)canCloseOnlyTab -{ - return _canCloseOnlyTab; -} - -- (void)setCanCloseOnlyTab:(BOOL)value -{ - _canCloseOnlyTab = value; - if ([_cells count] == 1) { - [self update]; - } -} - -- (BOOL)allowsDragBetweenWindows -{ - return _allowsDragBetweenWindows; -} - -- (void)setAllowsDragBetweenWindows:(BOOL)flag -{ - _allowsDragBetweenWindows = flag; -} - -- (BOOL)hideForSingleTab -{ - return _hideForSingleTab; -} - -- (void)setHideForSingleTab:(BOOL)value -{ - _hideForSingleTab = value; - [self update]; -} - -- (BOOL)showAddTabButton -{ - return _showAddTabButton; -} - -- (void)setShowAddTabButton:(BOOL)value -{ - _showAddTabButton = value; - [self update]; -} - -- (int)cellMinWidth -{ - return _cellMinWidth; -} - -- (void)setCellMinWidth:(int)value -{ - _cellMinWidth = value; - [self update]; -} - -- (int)cellMaxWidth -{ - return _cellMaxWidth; -} - -- (void)setCellMaxWidth:(int)value -{ - _cellMaxWidth = value; - [self update]; -} - -- (int)cellOptimumWidth -{ - return _cellOptimumWidth; -} - -- (void)setCellOptimumWidth:(int)value -{ - _cellOptimumWidth = value; - [self update]; -} - -- (BOOL)sizeCellsToFit -{ - return _sizeCellsToFit; -} - -- (void)setSizeCellsToFit:(BOOL)value -{ - _sizeCellsToFit = value; - [self update]; -} - -- (PSMRolloverButton *)addTabButton -{ - return _addTabButton; -} - -- (PSMOverflowPopUpButton *)overflowPopUpButton -{ - return _overflowPopUpButton; -} - -#pragma mark - -#pragma mark Tool tips - -- (void)setToolTip:(NSString *)value forTabViewItem:(NSTabViewItem *)tvi -{ - NSUInteger i, cellCount = [_cells count]; - for (i = 0; i < cellCount; i++) { - PSMTabBarCell *cell = [_cells objectAtIndex:i]; - if ([cell representedObject] == tvi) - [cell setToolTip:value]; - } - - [self update]; -} - - -#pragma mark - -#pragma mark Functionality -- (void)addTabViewItem:(NSTabViewItem *)item -{ - // create cell - PSMTabBarCell *cell = [[PSMTabBarCell alloc] initWithControlView:self]; - [cell setRepresentedObject:item]; - // bind the indicator to the represented object's status (if it exists) - [[cell indicator] setHidden:YES]; - if([item identifier] != nil){ - if([[item identifier] respondsToSelector:@selector(content)]){ - if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(isProcessing)]){ - NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary]; - [bindingOptions setObject:NSNegateBooleanTransformerName forKey:@"NSValueTransformerName"]; - [[cell indicator] bind:@"animate" toObject:[item identifier] withKeyPath:@"selection.isProcessing" options:nil]; - [[cell indicator] bind:@"hidden" toObject:[item identifier] withKeyPath:@"selection.isProcessing" options:bindingOptions]; - [[item identifier] addObserver:self forKeyPath:@"selection.isProcessing" options:0 context:nil]; - } - } - } - - // bind for the existence of an icon - [cell setHasIcon:NO]; - if([item identifier] != nil){ - if([[item identifier] respondsToSelector:@selector(content)]){ - if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(icon)]){ - NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary]; - [bindingOptions setObject:NSIsNotNilTransformerName forKey:@"NSValueTransformerName"]; - [cell bind:@"hasIcon" toObject:[item identifier] withKeyPath:@"selection.icon" options:bindingOptions]; - [[item identifier] addObserver:self forKeyPath:@"selection.icon" options:0 context:nil]; - } - } - } - - // bind for the existence of a counter - [cell setCount:0]; - if([item identifier] != nil){ - if([[item identifier] respondsToSelector:@selector(content)]){ - if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(objectCount)]){ - [cell bind:@"count" toObject:[item identifier] withKeyPath:@"selection.objectCount" options:nil]; - [[item identifier] addObserver:self forKeyPath:@"selection.objectCount" options:0 context:nil]; - } - } - } - - // bind my string value to the label on the represented tab - [cell bind:@"title" toObject:item withKeyPath:@"label" options:nil]; - - // add to collection - [_cells addObject:cell]; - [cell release]; - if([_cells count] == [tabView numberOfTabViewItems]){ - [self update]; // don't update unless all are accounted for! - } -} - -- (void)removeTabForCell:(PSMTabBarCell *)cell -{ - // unbind - [[cell indicator] unbind:@"animate"]; - [[cell indicator] unbind:@"hidden"]; - [cell unbind:@"hasIcon"]; - [cell unbind:@"title"]; - [cell unbind:@"count"]; - - // remove indicator - if([[self subviews] containsObject:[cell indicator]]){ - [[cell indicator] removeFromSuperview]; - } - // remove tracking - [[NSNotificationCenter defaultCenter] removeObserver:cell]; - if([cell closeButtonTrackingTag] != 0){ - [self removeTrackingRect:[cell closeButtonTrackingTag]]; - [cell setCloseButtonTrackingTag:0]; - } - if([cell cellTrackingTag] != 0){ - [self removeTrackingRect:[cell cellTrackingTag]]; - [cell setCellTrackingTag:0]; - } - - // pull from collection - [_cells removeObject:cell]; - - [self update]; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ - // the progress indicator, label, icon, or count has changed - must redraw - [self update]; -} - -#pragma mark - -#pragma mark Hide/Show - -- (void)hideTabBar:(BOOL)hide animate:(BOOL)animate -{ - if(!_awakenedFromNib) - return; - if(_isHidden && hide) - return; - if(!_isHidden && !hide) - return; - - [[self subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)]; - _hideIndicators = YES; - - NSTimer *animationTimer; - _isHidden = hide; - _currentStep = 0; - if(!animate) - _currentStep = (int)kPSMHideAnimationSteps; - - float partnerOriginalHeight, partnerOriginalY, myOriginalHeight, myOriginalY, partnerTargetHeight, partnerTargetY, myTargetHeight, myTargetY; - - // current (original) values - myOriginalHeight = [self frame].size.height; - myOriginalY = [self frame].origin.y; - if(partnerView){ - partnerOriginalHeight = [partnerView frame].size.height; - partnerOriginalY = [partnerView frame].origin.y; - } else { - partnerOriginalHeight = [[self window] frame].size.height; - partnerOriginalY = [[self window] frame].origin.y; - } - - // target values for partner - if(partnerView){ - // above or below me? - if((myOriginalY - 22) > partnerOriginalY){ - // partner is below me - if(_isHidden){ - // I'm shrinking - myTargetY = myOriginalY + 21; - myTargetHeight = myOriginalHeight - 21; - partnerTargetY = partnerOriginalY; - partnerTargetHeight = partnerOriginalHeight + 21; - } else { - // I'm growing - myTargetY = myOriginalY - 21; - myTargetHeight = myOriginalHeight + 21; - partnerTargetY = partnerOriginalY; - partnerTargetHeight = partnerOriginalHeight - 21; - } - } else { - // partner is above me - if(_isHidden){ - // I'm shrinking - myTargetY = myOriginalY; - myTargetHeight = myOriginalHeight - 21; - partnerTargetY = partnerOriginalY - 21; - partnerTargetHeight = partnerOriginalHeight + 21; - } else { - // I'm growing - myTargetY = myOriginalY; - myTargetHeight = myOriginalHeight + 21; - partnerTargetY = partnerOriginalY + 21; - partnerTargetHeight = partnerOriginalHeight - 21; - } - } - } else { - // for window movement - if(_isHidden){ - // I'm shrinking - myTargetY = myOriginalY; - myTargetHeight = myOriginalHeight - 21; - partnerTargetY = partnerOriginalY + 21; - partnerTargetHeight = partnerOriginalHeight - 21; - } else { - // I'm growing - myTargetY = myOriginalY; - myTargetHeight = myOriginalHeight + 21; - partnerTargetY = partnerOriginalY - 21; - partnerTargetHeight = partnerOriginalHeight + 21; - } - } - - NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:myOriginalY], @"myOriginalY", [NSNumber numberWithFloat:partnerOriginalY], @"partnerOriginalY", [NSNumber numberWithFloat:myOriginalHeight], @"myOriginalHeight", [NSNumber numberWithFloat:partnerOriginalHeight], @"partnerOriginalHeight", [NSNumber numberWithFloat:myTargetY], @"myTargetY", [NSNumber numberWithFloat:partnerTargetY], @"partnerTargetY", [NSNumber numberWithFloat:myTargetHeight], @"myTargetHeight", [NSNumber numberWithFloat:partnerTargetHeight], @"partnerTargetHeight", nil]; - animationTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0/20.0) target:self selector:@selector(animateShowHide:) userInfo:userInfo repeats:YES]; -} - -- (void)animateShowHide:(NSTimer *)timer -{ - // moves the frame of the tab bar and window (or partner view) linearly to hide or show the tab bar - NSRect myFrame = [self frame]; - float myCurrentY = ([[[timer userInfo] objectForKey:@"myOriginalY"] floatValue] + (([[[timer userInfo] objectForKey:@"myTargetY"] floatValue] - [[[timer userInfo] objectForKey:@"myOriginalY"] floatValue]) * (_currentStep/kPSMHideAnimationSteps))); - float myCurrentHeight = ([[[timer userInfo] objectForKey:@"myOriginalHeight"] floatValue] + (([[[timer userInfo] objectForKey:@"myTargetHeight"] floatValue] - [[[timer userInfo] objectForKey:@"myOriginalHeight"] floatValue]) * (_currentStep/kPSMHideAnimationSteps))); - float partnerCurrentY = ([[[timer userInfo] objectForKey:@"partnerOriginalY"] floatValue] + (([[[timer userInfo] objectForKey:@"partnerTargetY"] floatValue] - [[[timer userInfo] objectForKey:@"partnerOriginalY"] floatValue]) * (_currentStep/kPSMHideAnimationSteps))); - float partnerCurrentHeight = ([[[timer userInfo] objectForKey:@"partnerOriginalHeight"] floatValue] + (([[[timer userInfo] objectForKey:@"partnerTargetHeight"] floatValue] - [[[timer userInfo] objectForKey:@"partnerOriginalHeight"] floatValue]) * (_currentStep/kPSMHideAnimationSteps))); - - NSRect myNewFrame = NSMakeRect(myFrame.origin.x, myCurrentY, myFrame.size.width, myCurrentHeight); - - if(partnerView){ - // resize self and view - [partnerView setFrame:NSMakeRect([partnerView frame].origin.x, partnerCurrentY, [partnerView frame].size.width, partnerCurrentHeight)]; - [partnerView setNeedsDisplay:YES]; - [self setFrame:myNewFrame]; - } else { - // resize self and window - [[self window] setFrame:NSMakeRect([[self window] frame].origin.x, partnerCurrentY, [[self window] frame].size.width, partnerCurrentHeight) display:YES]; - [self setFrame:myNewFrame]; - } - - // next - _currentStep++; - if(_currentStep == kPSMHideAnimationSteps + 1){ - [timer invalidate]; - [self viewDidEndLiveResize]; - _hideIndicators = NO; - [self update]; - } - [[self window] display]; -} - -- (id)partnerView -{ - return partnerView; -} - -- (void)setPartnerView:(id)view -{ - [partnerView release]; - [view retain]; - partnerView = view; -} - -#pragma mark - -#pragma mark Drawing - -- (BOOL)isFlipped -{ - return YES; -} - -- (void)drawRect:(NSRect)rect -{ - [style drawTabBar:self inRect:rect]; -} - -- (void)update -{ - // abandon hope, all ye who enter here :-) - // this method handles all of the cell layout, and is called when something changes to require the refresh. This method is not called during drag and drop; see the PSMTabDragAssistant's calculateDragAnimationForTabBar: method, which does layout in that case. - - // make sure all of our tabs are accounted for before updating - if ([tabView numberOfTabViewItems] != [_cells count]) { - return; - } - - // hide/show? (these return if already in desired state) - if((_hideForSingleTab) && ([_cells count] <= 1)){ - [self hideTabBar:YES animate:YES]; - } else { - [self hideTabBar:NO animate:YES]; - } - - // size all cells appropriately and create tracking rects - // nuke old tracking rects - unsigned i, cellCount = (unsigned)[_cells count]; - for(i = 0; i < cellCount; i++){ - id cell = [_cells objectAtIndex:i]; - [[NSNotificationCenter defaultCenter] removeObserver:cell]; - if([cell closeButtonTrackingTag] != 0){ - [self removeTrackingRect:[cell closeButtonTrackingTag]]; - [cell setCloseButtonTrackingTag:0]; - } - if([cell cellTrackingTag] != 0){ - [self removeTrackingRect:[cell cellTrackingTag]]; - [cell setCellTrackingTag:0]; - } - } - - // nuke old tool tips - [self removeAllToolTips]; - - // calculate number of cells to fit in control and cell widths - float availableWidth = [self availableCellWidth]; - NSMutableArray *newWidths = [NSMutableArray arrayWithCapacity:cellCount]; - int numberOfVisibleCells = 1; - float totalOccupiedWidth = 0.0; - NSMenu *overflowMenu = nil; - for(i = 0; i < cellCount; i++){ - PSMTabBarCell *cell = [_cells objectAtIndex:i]; - float width; - - // supress close button? - if (cellCount == 1 && [self canCloseOnlyTab] == NO) { - [cell setCloseButtonSuppressed:YES]; - } else { - [cell setCloseButtonSuppressed:NO]; - } - - // Determine cell width - if(_sizeCellsToFit){ - width = [cell desiredWidthOfCell]; - if (width > _cellMaxWidth) { - width = _cellMaxWidth; - } - } else { - width = _cellOptimumWidth; - } - - // too much? - totalOccupiedWidth += width; - if (totalOccupiedWidth >= availableWidth) { - numberOfVisibleCells = i; - if(_sizeCellsToFit){ - int neededWidth = width - (totalOccupiedWidth - availableWidth); - // can I squeeze it in without violating min cell width? - int widthIfAllMin = (numberOfVisibleCells + 1) * _cellMinWidth; - - if ((width + widthIfAllMin) <= availableWidth) { - // squeeze - distribute needed sacrifice among all cells - int q; - for(q = (i - 1); q >= 0; q--){ - int desiredReduction = (int)neededWidth/(q+1); - if(([[newWidths objectAtIndex:q] floatValue] - desiredReduction) < _cellMinWidth){ - int actualReduction = (int)[[newWidths objectAtIndex:q] floatValue] - _cellMinWidth; - [newWidths replaceObjectAtIndex:q withObject:[NSNumber numberWithFloat:_cellMinWidth]]; - neededWidth -= actualReduction; - } else { - int newCellWidth = (int)[[newWidths objectAtIndex:q] floatValue] - desiredReduction; - [newWidths replaceObjectAtIndex:q withObject:[NSNumber numberWithFloat:newCellWidth]]; - neededWidth -= desiredReduction; - } - } - // one cell left! - int thisWidth = width - neededWidth; - [newWidths addObject:[NSNumber numberWithFloat:thisWidth]]; - numberOfVisibleCells++; - } else { - // stretch - distribute leftover room among cells - int leftoverWidth = availableWidth - totalOccupiedWidth + width; - int q; - for(q = (i - 1); q >= 0; q--){ - int desiredAddition = (int)leftoverWidth/(q+1); - int newCellWidth = (int)[[newWidths objectAtIndex:q] floatValue] + desiredAddition; - [newWidths replaceObjectAtIndex:q withObject:[NSNumber numberWithFloat:newCellWidth]]; - leftoverWidth -= desiredAddition; - } - } - break; // done assigning widths; remaining cells go in overflow menu - } else { - int revisedWidth = availableWidth/(i + 1); - if(revisedWidth >= _cellMinWidth){ - int q; - totalOccupiedWidth = 0; - for(q = 0; q < [newWidths count]; q++){ - [newWidths replaceObjectAtIndex:q withObject:[NSNumber numberWithFloat:revisedWidth]]; - totalOccupiedWidth += revisedWidth; - } - // just squeezed this one in... - [newWidths addObject:[NSNumber numberWithFloat:revisedWidth]]; - totalOccupiedWidth += revisedWidth; - numberOfVisibleCells++; - } else { - // couldn't fit that last one... - break; - } - } - } else { - numberOfVisibleCells = cellCount; - [newWidths addObject:[NSNumber numberWithFloat:width]]; - } - } - - // Set up cells with frames and rects - NSRect cellRect = [self genericCellRect]; - for(i = 0; i < cellCount; i++){ - PSMTabBarCell *cell = [_cells objectAtIndex:i]; - NSTabViewItem *tvi = [cell representedObject]; - int tabState = 0; - if (i < numberOfVisibleCells) { - // set cell frame - cellRect.size.width = [[newWidths objectAtIndex:i] floatValue]; - [cell setFrame:cellRect]; - NSTrackingRectTag tag; - - // close button tracking rect - if ([cell hasCloseButton]) { - tag = [self addTrackingRect:[cell closeButtonRectForFrame:cellRect] owner:cell userData:nil assumeInside:NO]; - [cell setCloseButtonTrackingTag:tag]; - } - - // entire tab tracking rect - tag = [self addTrackingRect:cellRect owner:cell userData:nil assumeInside:NO]; - [cell setCellTrackingTag:tag]; - [cell setEnabled:YES]; - - // add tool tip - NSString *tt = [cell toolTip]; - if (tt && [tt length] > 0) - [self addToolTipRect:cellRect owner:tt userData:NULL]; - - // selected? set tab states... - if([tvi isEqualTo:[tabView selectedTabViewItem]]){ - [cell setState:NSOnState]; - tabState |= PSMTab_SelectedMask; - // previous cell - if(i > 0){ - [[_cells objectAtIndex:i-1] setTabState:([(PSMTabBarCell *)[_cells objectAtIndex:i-1] tabState] | PSMTab_RightIsSelectedMask)]; - } - // next cell - see below - } else { - [cell setState:NSOffState]; - // see if prev cell was selected - if(i > 0){ - if([[_cells objectAtIndex:i-1] state] == NSOnState){ - tabState |= PSMTab_LeftIsSelectedMask; - } - } - } - // more tab states - if(cellCount == 1){ - tabState |= PSMTab_PositionLeftMask | PSMTab_PositionRightMask | PSMTab_PositionSingleMask; - } else if(i == 0){ - tabState |= PSMTab_PositionLeftMask; - } else if(i-1 == cellCount){ - tabState |= PSMTab_PositionRightMask; - } - [cell setTabState:tabState]; - [cell setIsInOverflowMenu:NO]; - - // indicator - if(![[cell indicator] isHidden] && !_hideIndicators){ - [[cell indicator] setFrame:[cell indicatorRectForFrame:cellRect]]; - if(![[self subviews] containsObject:[cell indicator]]){ - [self addSubview:[cell indicator]]; - [[cell indicator] startAnimation:self]; - } - } - - // next... - cellRect.origin.x += [[newWidths objectAtIndex:i] floatValue]; - - } else { - // set up menu items - NSMenuItem *menuItem; - if(overflowMenu == nil){ - overflowMenu = [[[NSMenu alloc] initWithTitle:@"TITLE"] autorelease]; - [overflowMenu insertItemWithTitle:@"FIRST" action:nil keyEquivalent:@"" atIndex:0]; // Because the overflowPupUpButton is a pull down menu - } - menuItem = [[[NSMenuItem alloc] initWithTitle:[[cell attributedStringValue] string] action:@selector(overflowMenuAction:) keyEquivalent:@""] autorelease]; - [menuItem setTarget:self]; - [menuItem setRepresentedObject:tvi]; - [cell setIsInOverflowMenu:YES]; - [[cell indicator] removeFromSuperview]; - if ([tvi isEqualTo:[tabView selectedTabViewItem]]) - [menuItem setState:NSOnState]; - if([cell hasIcon]) - [menuItem setImage:[[[tvi identifier] content] icon]]; - if([cell count] > 0) - [menuItem setTitle:[[menuItem title] stringByAppendingFormat:@" (%d)",[cell count]]]; - [overflowMenu addItem:menuItem]; - } - } - - - // Overflow menu - cellRect.origin.y = 0; - cellRect.size.height = kPSMTabBarControlHeight; - cellRect.size.width = [style rightMarginForTabBarControl]; - if (overflowMenu) { - cellRect.origin.x = [self frame].size.width - [style rightMarginForTabBarControl] + 1; - if(![[self subviews] containsObject:_overflowPopUpButton]){ - [self addSubview:_overflowPopUpButton]; - } - [_overflowPopUpButton setFrame:cellRect]; - [_overflowPopUpButton setMenu:overflowMenu]; - if ([_overflowPopUpButton isHidden]) [_overflowPopUpButton setHidden:NO]; - } else { - if (![_overflowPopUpButton isHidden]) [_overflowPopUpButton setHidden:YES]; - } - - // add tab button - if(!overflowMenu && _showAddTabButton){ - if(![[self subviews] containsObject:_addTabButton]) - [self addSubview:_addTabButton]; - if([_addTabButton isHidden] && _showAddTabButton) - [_addTabButton setHidden:NO]; - cellRect.size = [_addTabButton frame].size; - cellRect.origin.y = MARGIN_Y; - cellRect.origin.x += 2; - [_addTabButton setImage:[style addTabButtonImage]]; - [_addTabButton setFrame:cellRect]; - [_addTabButton setNeedsDisplay:YES]; - } else { - [_addTabButton setHidden:YES]; - [_addTabButton setNeedsDisplay:YES]; - } - - [self setNeedsDisplay:YES]; -} - -#pragma mark - -#pragma mark Mouse Tracking - -- (BOOL)mouseDownCanMoveWindow -{ - return NO; -} - -- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent -{ - return YES; -} - -- (void)mouseDown:(NSEvent *)theEvent -{ - // keep for dragging - [self setLastMouseDownEvent:theEvent]; - // what cell? - NSPoint mousePt = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - NSRect cellFrame; - PSMTabBarCell *cell = [self cellForPoint:mousePt cellFrame:&cellFrame]; - if(cell){ -#if 0 - NSRect iconRect = [cell closeButtonRectForFrame:cellFrame]; - if(NSMouseInRect(mousePt, iconRect,[self isFlipped])){ - [cell setCloseButtonPressed:YES]; - } else { - [cell setCloseButtonPressed:NO]; - } - [self setNeedsDisplay:YES]; -#else - // HACK! Let the tabs react on the mouse down instead of mouse up - NSRect iconRect = [cell closeButtonRectForFrame:cellFrame]; - if((NSMouseInRect(mousePt, iconRect,[self isFlipped]))){ - //[self performSelector:@selector(closeTabClick:) withObject:cell]; - [self closeTabClick:cell]; - } else if(NSMouseInRect(mousePt, cellFrame,[self isFlipped])){ - //[self performSelector:@selector(tabClick:) withObject:cell]; - [self tabClick:cell]; - } else { - //[self performSelector:@selector(tabNothing:) withObject:cell]; - [self tabNothing:cell]; - } -#endif - } -} - -- (void)mouseDragged:(NSEvent *)theEvent -{ - if([self lastMouseDownEvent] == nil){ - return; - } - - if ([_cells count] < 2) { - return; - } - - NSRect cellFrame; - NSPoint trackingStartPoint = [self convertPoint:[[self lastMouseDownEvent] locationInWindow] fromView:nil]; - PSMTabBarCell *cell = [self cellForPoint:trackingStartPoint cellFrame:&cellFrame]; - if (!cell) - return; - - NSPoint currentPoint = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - float dx = fabs(currentPoint.x - trackingStartPoint.x); - float dy = fabs(currentPoint.y - trackingStartPoint.y); - float distance = sqrt(dx * dx + dy * dy); - if (distance < 10) - return; - - if(![[PSMTabDragAssistant sharedDragAssistant] isDragging]) { - [[PSMTabDragAssistant sharedDragAssistant] startDraggingCell:cell fromTabBar:self withMouseDownEvent:[self lastMouseDownEvent]]; - } -} - -- (void)mouseUp:(NSEvent *)theEvent -{ -#if 0 // HACK! Tabs react on mouse down instead of mouse up - // what cell? - NSPoint mousePt = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - NSRect cellFrame, mouseDownCellFrame; - PSMTabBarCell *cell = [self cellForPoint:mousePt cellFrame:&cellFrame]; - PSMTabBarCell *mouseDownCell = [self cellForPoint:[self convertPoint:[[self lastMouseDownEvent] locationInWindow] fromView:nil] cellFrame:&mouseDownCellFrame]; - if(cell){ - NSRect iconRect = [mouseDownCell closeButtonRectForFrame:mouseDownCellFrame]; - if((NSMouseInRect(mousePt, iconRect,[self isFlipped])) && [mouseDownCell closeButtonPressed]){ - [self performSelector:@selector(closeTabClick:) withObject:cell]; - } else if(NSMouseInRect(mousePt, mouseDownCellFrame,[self isFlipped])){ - [mouseDownCell setCloseButtonPressed:NO]; - [self performSelector:@selector(tabClick:) withObject:cell]; - } else { - [mouseDownCell setCloseButtonPressed:NO]; - [self performSelector:@selector(tabNothing:) withObject:cell]; - } - } -#endif -} - -#pragma mark - -#pragma mark Drag and Drop - -- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent -{ - return YES; -} - -// NSDraggingSource -- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal -{ - return (isLocal ? NSDragOperationMove : NSDragOperationNone); -} - -- (BOOL)ignoreModifierKeysWhileDragging -{ - return YES; -} - -- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation -{ - [[PSMTabDragAssistant sharedDragAssistant] draggedImageEndedAt:aPoint operation:operation]; -} - -// NSDraggingDestination -- (NSDragOperation)draggingEntered:(id )sender -{ - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - _delegateHandlingDrag = NO; - if([[[sender draggingPasteboard] types] indexOfObject:@"PSMTabBarControlItemPBType"] != NSNotFound) { - - if ([sender draggingSource] != self && ![self allowsDragBetweenWindows]) - return NSDragOperationNone; - - [[PSMTabDragAssistant sharedDragAssistant] draggingEnteredTabBar:self atPoint:point]; - return NSDragOperationMove; - } else if (delegate && [delegate respondsToSelector:@selector(tabBarControl:draggingEntered:forTabAtIndex:)]) { - NSDragOperation op = [delegate tabBarControl:self draggingEntered:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - _delegateHandlingDrag = (op != NSDragOperationNone); - _delegateInitialDragOperation = op; - return op; - } - - return NSDragOperationNone; -} - -- (NSDragOperation)draggingUpdated:(id )sender -{ - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - if ([[[sender draggingPasteboard] types] indexOfObject:@"PSMTabBarControlItemPBType"] != NSNotFound) { - - if ([sender draggingSource] != self && ![self allowsDragBetweenWindows]) - return NSDragOperationNone; - - [[PSMTabDragAssistant sharedDragAssistant] draggingUpdatedInTabBar:self atPoint:point]; - return NSDragOperationMove; - } else if (_delegateHandlingDrag) { - if ([delegate respondsToSelector:@selector(tabBarControl:draggingUpdated:forTabAtIndex:)]) - return [delegate tabBarControl:self draggingUpdated:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - else - return _delegateInitialDragOperation; - } - - return NSDragOperationNone; -} - -- (void)draggingExited:(id )sender -{ - if (!_delegateHandlingDrag) { - [[PSMTabDragAssistant sharedDragAssistant] draggingExitedTabBar:self]; - } else if ([delegate respondsToSelector:@selector(tabBarControl:draggingExited:forTabAtIndex:)]) { - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - [delegate tabBarControl:self draggingExited:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - } -} - -- (BOOL)prepareForDragOperation:(id )sender -{ - if (_delegateHandlingDrag && [delegate respondsToSelector:@selector(tabBarControl:prepareForDragOperation:forTabAtIndex:)]) { - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - return [delegate tabBarControl:self prepareForDragOperation:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - } - - return YES; -} - -- (BOOL)performDragOperation:(id )sender -{ - if (!_delegateHandlingDrag) { -#if 1 - // HACK! Used below. - NSTabViewItem *tvi = [[[PSMTabDragAssistant sharedDragAssistant] draggedCell] representedObject]; -#endif - - [[PSMTabDragAssistant sharedDragAssistant] performDragOperation]; - -#if 1 - // HACK! Notify the delegate that a tab was dragged to a new position. - if (delegate && [delegate respondsToSelector:@selector(tabView:didDragTabViewItem:toIndex:)]) { - NSUInteger idx = [[self representedTabViewItems] indexOfObject:tvi]; - if (NSNotFound != idx) { - [delegate tabView:[self tabView] didDragTabViewItem:tvi toIndex:(int)idx]; - } - } -#endif - } else { - if ([delegate respondsToSelector:@selector(tabBarControl:performDragOperation:forTabAtIndex:)]) { - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - return [delegate tabBarControl:self performDragOperation:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - } else { - return NO; - } - } - - return YES; -} - -- (void)concludeDragOperation:(id )sender -{ - if (_delegateHandlingDrag && [delegate respondsToSelector:@selector(tabBarControl:concludeDragOperation:forTabAtIndex:)]) { - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - [delegate tabBarControl:self concludeDragOperation:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - } -} - -#pragma mark - -#pragma mark Actions - -- (void)overflowMenuAction:(id)sender -{ - [tabView selectTabViewItem:[sender representedObject]]; - [self update]; -} - -- (void)closeTabClick:(id)sender -{ - [sender retain]; - if(([_cells count] == 1) && (![self canCloseOnlyTab])) - return; - - if(([self delegate]) && ([[self delegate] respondsToSelector:@selector(tabView:shouldCloseTabViewItem:)])){ - if(![[self delegate] tabView:tabView shouldCloseTabViewItem:[sender representedObject]]){ - // fix mouse downed close button - [sender setCloseButtonPressed:NO]; - return; - } - } - - if(([self delegate]) && ([[self delegate] respondsToSelector:@selector(tabView:willCloseTabViewItem:)])){ - [[self delegate] tabView:tabView willCloseTabViewItem:[sender representedObject]]; - } - - [[sender representedObject] retain]; - [tabView removeTabViewItem:[sender representedObject]]; - - if(([self delegate]) && ([[self delegate] respondsToSelector:@selector(tabView:didCloseTabViewItem:)])){ - [[self delegate] tabView:tabView didCloseTabViewItem:[sender representedObject]]; - } - [[sender representedObject] release]; - [sender release]; -} - -- (void)tabClick:(id)sender -{ - [tabView selectTabViewItem:[sender representedObject]]; - [self update]; -} - -- (void)tabNothing:(id)sender -{ - [self update]; // takes care of highlighting based on state -} - -- (void)frameDidChange:(NSNotification *)notification -{ - [self update]; - // trying to address the drawing artifacts for the progress indicators - hackery follows - // this one fixes the "blanking" effect when the control hides and shows itself - NSEnumerator *e = [_cells objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - [[cell indicator] stopAnimation:self]; - [[cell indicator] startAnimation:self]; - } - [self setNeedsDisplay:YES]; -} - -- (void)viewWillStartLiveResize -{ - NSEnumerator *e = [_cells objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - [[cell indicator] stopAnimation:self]; - } - [self setNeedsDisplay:YES]; -} - --(void)viewDidEndLiveResize -{ - NSEnumerator *e = [_cells objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - [[cell indicator] startAnimation:self]; - } - [self setNeedsDisplay:YES]; -} - -- (void)windowDidMove:(NSNotification *)aNotification -{ - [self setNeedsDisplay:YES]; -} - -- (void)windowStatusDidChange:(NSNotification *)notification -{ - // hide? must readjust things if I'm not supposed to be showing - // this block of code only runs when the app launches - if(_hideForSingleTab && ([_cells count] <= 1) && !_awakenedFromNib){ - // must adjust frames now before display - NSRect myFrame = [self frame]; - if(partnerView){ - NSRect partnerFrame = [partnerView frame]; - // above or below me? - if(([self frame].origin.y - 22) > [partnerView frame].origin.y){ - // partner is below me - [self setFrame:NSMakeRect(myFrame.origin.x, myFrame.origin.y + 21, myFrame.size.width, myFrame.size.height - 21)]; - [partnerView setFrame:NSMakeRect(partnerFrame.origin.x, partnerFrame.origin.y, partnerFrame.size.width, partnerFrame.size.height + 21)]; - } else { - // partner is above me - [self setFrame:NSMakeRect(myFrame.origin.x, myFrame.origin.y, myFrame.size.width, myFrame.size.height - 21)]; - [partnerView setFrame:NSMakeRect(partnerFrame.origin.x, partnerFrame.origin.y - 21, partnerFrame.size.width, partnerFrame.size.height + 21)]; - } - [partnerView setNeedsDisplay:YES]; - [self setNeedsDisplay:YES]; - } else { - // for window movement - NSRect windowFrame = [[self window] frame]; - [[self window] setFrame:NSMakeRect(windowFrame.origin.x, windowFrame.origin.y + 21, windowFrame.size.width, windowFrame.size.height - 21) display:YES]; - [self setFrame:NSMakeRect(myFrame.origin.x, myFrame.origin.y, myFrame.size.width, myFrame.size.height - 21)]; - } - _isHidden = YES; - [self setNeedsDisplay:YES]; - //[[self window] display]; - } - _awakenedFromNib = YES; - [self update]; -} - -#pragma mark - -#pragma mark NSTabView Delegate - -- (void)tabView:(NSTabView *)aTabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem -{ - // here's a weird one - this message is sent before the "tabViewDidChangeNumberOfTabViewItems" - // message, thus I can end up updating when there are no cells, if no tabs were (yet) present - if([_cells count] > 0){ - [self update]; - } - if([self delegate]){ - if([[self delegate] respondsToSelector:@selector(tabView:didSelectTabViewItem:)]){ - [[self delegate] performSelector:@selector(tabView:didSelectTabViewItem:) withObject:aTabView withObject:tabViewItem]; - } - } -} - -- (BOOL)tabView:(NSTabView *)aTabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem -{ - if([self delegate]){ - if([[self delegate] respondsToSelector:@selector(tabView:shouldSelectTabViewItem:)]){ - // This is an ugly hack. tabView:shouldSelectTabViewItem: returns - // a BOOL and performSelector: assumes that it returns an id. - return nil != [[self delegate] performSelector:@selector(tabView:shouldSelectTabViewItem:) withObject:aTabView withObject:tabViewItem]; - } else { - return YES; - } - } else { - return YES; - } -} -- (void)tabView:(NSTabView *)aTabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem -{ - if([self delegate]){ - if([[self delegate] respondsToSelector:@selector(tabView:willSelectTabViewItem:)]){ - [[self delegate] performSelector:@selector(tabView:willSelectTabViewItem:) withObject:aTabView withObject:tabViewItem]; - } - } -} - -- (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)aTabView -{ - NSArray *tabItems = [tabView tabViewItems]; - // go through cells, remove any whose representedObjects are not in [tabView tabViewItems] - NSEnumerator *e = [_cells objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - if(![tabItems containsObject:[cell representedObject]]){ - [self removeTabForCell:cell]; - } - } - - // go through tab view items, add cell for any not present - NSMutableArray *cellItems = [self representedTabViewItems]; - NSEnumerator *ex = [tabItems objectEnumerator]; - NSTabViewItem *item; - while(item = [ex nextObject]){ - if(![cellItems containsObject:item]){ - [self addTabViewItem:item]; - } - } - -#if 0 - // HACK! Make sure '_cells' is ordered the same as 'tabItems'. - NSMutableArray *temp = [[NSMutableArray alloc] initWithArray:_cells]; - e = [_cells objectEnumerator]; - int count = [temp count]; - while ((cell = [e nextObject])) { - int idx = [tabItems indexOfObject:[cell representedObject]]; - if (NSNotFound != idx && idx < count) { - [temp replaceObjectAtIndex:idx withObject:cell]; - } - } - - [_cells release]; - _cells = temp; - - if ([_cells count] == [tabView numberOfTabViewItems]) { - [self update]; // don't update unless all are accounted for! - } -#endif - - // pass along for other delegate responses - if([self delegate]){ - if([[self delegate] respondsToSelector:@selector(tabViewDidChangeNumberOfTabViewItems:)]){ - [[self delegate] performSelector:@selector(tabViewDidChangeNumberOfTabViewItems:) withObject:aTabView]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - [super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:_cells forKey:@"PSMcells"]; - [aCoder encodeObject:tabView forKey:@"PSMtabView"]; - [aCoder encodeObject:_overflowPopUpButton forKey:@"PSMoverflowPopUpButton"]; - [aCoder encodeObject:_addTabButton forKey:@"PSMaddTabButton"]; - [aCoder encodeObject:style forKey:@"PSMstyle"]; - [aCoder encodeBool:_canCloseOnlyTab forKey:@"PSMcanCloseOnlyTab"]; - [aCoder encodeBool:_hideForSingleTab forKey:@"PSMhideForSingleTab"]; - [aCoder encodeBool:_showAddTabButton forKey:@"PSMshowAddTabButton"]; - [aCoder encodeBool:_sizeCellsToFit forKey:@"PSMsizeCellsToFit"]; - [aCoder encodeInt:_cellMinWidth forKey:@"PSMcellMinWidth"]; - [aCoder encodeInt:_cellMaxWidth forKey:@"PSMcellMaxWidth"]; - [aCoder encodeInt:_cellOptimumWidth forKey:@"PSMcellOptimumWidth"]; - [aCoder encodeInt:_currentStep forKey:@"PSMcurrentStep"]; - [aCoder encodeBool:_isHidden forKey:@"PSMisHidden"]; - [aCoder encodeBool:_hideIndicators forKey:@"PSMhideIndicators"]; - [aCoder encodeObject:partnerView forKey:@"PSMpartnerView"]; - [aCoder encodeBool:_awakenedFromNib forKey:@"PSMawakenedFromNib"]; - [aCoder encodeObject:_lastMouseDownEvent forKey:@"PSMlastMouseDownEvent"]; - [aCoder encodeObject:delegate forKey:@"PSMdelegate"]; - - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - self = [super initWithCoder:aDecoder]; - if (self) { - if ([aDecoder allowsKeyedCoding]) { - _cells = [[aDecoder decodeObjectForKey:@"PSMcells"] retain]; - tabView = [[aDecoder decodeObjectForKey:@"PSMtabView"] retain]; - _overflowPopUpButton = [[aDecoder decodeObjectForKey:@"PSMoverflowPopUpButton"] retain]; - _addTabButton = [[aDecoder decodeObjectForKey:@"PSMaddTabButton"] retain]; - style = [[aDecoder decodeObjectForKey:@"PSMstyle"] retain]; - _canCloseOnlyTab = [aDecoder decodeBoolForKey:@"PSMcanCloseOnlyTab"]; - _hideForSingleTab = [aDecoder decodeBoolForKey:@"PSMhideForSingleTab"]; - _showAddTabButton = [aDecoder decodeBoolForKey:@"PSMshowAddTabButton"]; - _sizeCellsToFit = [aDecoder decodeBoolForKey:@"PSMsizeCellsToFit"]; - _cellMinWidth = [aDecoder decodeIntForKey:@"PSMcellMinWidth"]; - _cellMaxWidth = [aDecoder decodeIntForKey:@"PSMcellMaxWidth"]; - _cellOptimumWidth = [aDecoder decodeIntForKey:@"PSMcellOptimumWidth"]; - _currentStep = [aDecoder decodeIntForKey:@"PSMcurrentStep"]; - _isHidden = [aDecoder decodeBoolForKey:@"PSMisHidden"]; - _hideIndicators = [aDecoder decodeBoolForKey:@"PSMhideIndicators"]; - partnerView = [[aDecoder decodeObjectForKey:@"PSMpartnerView"] retain]; - _awakenedFromNib = [aDecoder decodeBoolForKey:@"PSMawakenedFromNib"]; - _lastMouseDownEvent = [[aDecoder decodeObjectForKey:@"PSMlastMouseDownEvent"] retain]; - delegate = [[aDecoder decodeObjectForKey:@"PSMdelegate"] retain]; - } - } - return self; -} - -#pragma mark - -#pragma mark IB Palette - -- (NSSize)minimumFrameSizeFromKnobPosition:(int)position -{ - return NSMakeSize(100.0, 22.0); -} - -- (NSSize)maximumFrameSizeFromKnobPosition:(int)knobPosition -{ - return NSMakeSize(10000.0, 22.0); -} - -- (void)placeView:(NSRect)newFrame -{ - // this is called any time the view is resized in IB - [self setFrame:newFrame]; - [self update]; -} - -#pragma mark - -#pragma mark Convenience - -- (NSMutableArray *)representedTabViewItems -{ - NSMutableArray *temp = [NSMutableArray arrayWithCapacity:[_cells count]]; - NSEnumerator *e = [_cells objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - [temp addObject:[cell representedObject]]; - } - return temp; -} - -- (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame -{ - NSUInteger i = [self indexOfCellAtPoint:point cellFrame:outFrame]; - if (i == NSNotFound) - return nil; - PSMTabBarCell *cell = [_cells objectAtIndex:i]; - return cell; -} - -- (NSUInteger)indexOfCellAtPoint:(NSPoint)point -{ - return [self indexOfCellAtPoint:point cellFrame:NULL]; -} - -- (NSUInteger)indexOfCellAtPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame -{ - NSRect aRect = [self genericCellRect]; - - if(!NSPointInRect(point,aRect)){ - return NSNotFound; - } - - NSUInteger i, cnt = [_cells count]; - for(i = 0; i < cnt; i++){ - PSMTabBarCell *cell = [_cells objectAtIndex:i]; - float width = [cell width]; - aRect.size.width = width; - - if(NSPointInRect(point, aRect)){ - if(outFrame){ - *outFrame = aRect; - } - return i; - } - aRect.origin.x += width; - } - return NSNotFound; -} - -- (PSMTabBarCell *)lastVisibleTab -{ - NSUInteger i, cellCount = [_cells count]; - for(i = 0; i < cellCount; i++){ - if([[_cells objectAtIndex:i] isInOverflowMenu]) - return [_cells objectAtIndex:(i-1)]; - } - return [_cells objectAtIndex:(cellCount - 1)]; -} - -- (int)numberOfVisibleTabs -{ - NSUInteger i, cellCount = [_cells count]; - for(i = 0; i < cellCount; i++){ - if([[_cells objectAtIndex:i] isInOverflowMenu]) - return (int)i+1; - } - return (int)cellCount; -} - - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.h b/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.h deleted file mode 100644 index ba5d684b90..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// PSMTabBarControlInspector.h -// PSMTabBarControl -// -// Created by John Pannell on 12/21/05. -// Copyright Positive Spin Media 2005. All rights reserved. -// - -#import - -@interface PSMTabBarControlInspector : IBInspector -{ - IBOutlet NSPopUpButton *_stylePopUp; - IBOutlet NSButton *_canCloseOnlyTab; - IBOutlet NSButton *_hideForSingleTab; - IBOutlet NSButton *_showAddTab; - IBOutlet NSTextField *_cellMinWidth; - IBOutlet NSTextField *_cellMaxWidth; - IBOutlet NSTextField *_cellOptimumWidth; - IBOutlet NSButton *_sizeToFit; - IBOutlet NSButton *_allowsDragBetweenWindows; -} -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.m b/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.m deleted file mode 100644 index d9c5b91c4f..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.m +++ /dev/null @@ -1,99 +0,0 @@ -// -// PSMTabBarControlInspector.m -// PSMTabBarControl -// -// Created by John Pannell on 12/21/05. -// Copyright Positive Spin Media 2005 . All rights reserved. -// - -#import "PSMTabBarControlInspector.h" -#import "PSMTabBarControl.h" - -#define kPSMStyleTag 0 -#define kPSMCanCloseOnlyTabTag 1 -#define kPSMHideForSingleTabTag 2 -#define kPSMShowAddTabTag 3 -#define kPSMMinWidthTag 4 -#define kPSMMaxWidthTag 5 -#define kPSMOptimumWidthTag 6 -#define kPSMSizeToFitTag 7 -#define kPSMAllowsDragBetweenWindows 8 - -@implementation PSMTabBarControlInspector - -- (id)init -{ - self = [super init]; - [NSBundle loadNibNamed:@"PSMTabBarControlInspector" owner:self]; - return self; -} - -- (void)ok:(id)sender -{ - if([sender tag] == kPSMStyleTag){ - [[self object] setStyleNamed:[sender titleOfSelectedItem]]; - - } else if([sender tag] == kPSMCanCloseOnlyTabTag){ - [[self object] setCanCloseOnlyTab:[sender state]]; - - } else if([sender tag] == kPSMHideForSingleTabTag){ - [[self object] setHideForSingleTab:[sender state]]; - - } else if([sender tag] == kPSMShowAddTabTag){ - [[self object] setShowAddTabButton:[sender state]]; - - } else if([sender tag] == kPSMMinWidthTag){ - if([[self object] cellOptimumWidth] < [sender intValue]){ - [[self object] setCellMinWidth:[[self object] cellOptimumWidth]]; - [sender setIntValue:[[self object] cellOptimumWidth]]; - } else { - [[self object] setCellMinWidth:[sender intValue]]; - } - - } else if([sender tag] == kPSMMaxWidthTag){ - if([[self object] cellOptimumWidth] > [sender intValue]){ - [[self object] setCellMaxWidth:[[self object] cellOptimumWidth]]; - [sender setIntValue:[[self object] cellOptimumWidth]]; - } else { - [[self object] setCellMaxWidth:[sender intValue]]; - } - - } else if([sender tag] == kPSMOptimumWidthTag){ - if([[self object] cellMaxWidth] < [sender intValue]){ - [[self object] setCellOptimumWidth:[[self object] cellMaxWidth]]; - [sender setIntValue:[[self object] cellMaxWidth]]; - } else if([[self object] cellMinWidth] > [sender intValue]){ - [[self object] setCellOptimumWidth:[[self object] cellMinWidth]]; - [sender setIntValue:[[self object] cellMinWidth]]; - } else { - [[self object] setCellOptimumWidth:[sender intValue]]; - } - - } else if([sender tag] == kPSMSizeToFitTag){ - [[self object] setSizeCellsToFit:[sender state]]; - - } else if([sender tag] == kPSMAllowsDragBetweenWindows){ - [[self object] setAllowsDragBetweenWindows:[sender state]]; - - } - - - [super ok:sender]; -} - -- (void)revert:(id)sender -{ - [_stylePopUp selectItemWithTitle:[[self object] styleName]]; - [_canCloseOnlyTab setState:[[self object] canCloseOnlyTab]]; - [_hideForSingleTab setState:[[self object] hideForSingleTab]]; - [_showAddTab setState:[[self object] showAddTabButton]]; - [_cellMinWidth setIntValue:[[self object] cellMinWidth]]; - [_cellMaxWidth setIntValue:[[self object] cellMaxWidth]]; - [_cellOptimumWidth setIntValue:[[self object] cellOptimumWidth]]; - [_sizeToFit setState:[[self object] sizeCellsToFit]]; - [_allowsDragBetweenWindows setState:[[self object] allowsDragBetweenWindows]]; - - [super revert:sender]; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.h b/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.h deleted file mode 100644 index 0feb9ad9d0..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// PSMTabBarControlPalette.h -// PSMTabBarControl -// -// Created by John Pannell on 12/21/05. -// Copyright Positive Spin Media 2005 . All rights reserved. -// - -#import -#import "PSMTabBarControl.h" - -@interface PSMTabBarControlPalette : IBPalette -{ - IBOutlet NSImageView *repImage; - PSMTabBarControl *_customControl; -} -@end - -@interface PSMTabBarControl (PSMTabBarControlPaletteInspector) -- (NSString *)inspectorClassName; -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.m b/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.m deleted file mode 100644 index bb5851aa18..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.m +++ /dev/null @@ -1,35 +0,0 @@ -// -// PSMTabBarControlPalette.m -// PSMTabBarControl -// -// Created by John Pannell on 12/21/05. -// Copyright Positive Spin Media 2005 . All rights reserved. -// - -#import "PSMTabBarControlPalette.h" - -@implementation PSMTabBarControlPalette - -- (void)finishInstantiate -{ - // associate representative image with actual control - _customControl = [[PSMTabBarControl alloc] initWithFrame:NSMakeRect(0,0,180,22)]; - [self associateObject:_customControl ofType:IBViewPboardType withView:repImage]; -} - -- (void)dealloc -{ - [_customControl release]; - [super dealloc]; -} - -@end - -@implementation PSMTabBarControl (PSMTabBarControlPaletteInspector) - -- (NSString *)inspectorClassName -{ - return @"PSMTabBarControlInspector"; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl_Prefix.pch b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl_Prefix.pch deleted file mode 100644 index 65df9ffedb..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'PSMTabBarControl' target in the 'PSMTabBarControl' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.h b/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.h deleted file mode 100644 index 8c756c7233..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.h +++ /dev/null @@ -1,84 +0,0 @@ -// -// PSMTabDragAssistant.h -// PSMTabBarControl -// -// Created by John Pannell on 4/10/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -/* - This class is a sigleton that manages the details of a tab drag and drop. The details were beginning to overwhelm me when keeping all of this in the control and cells :-) - */ - -#import -#import "PSMTabBarControl.h" -@class PSMTabBarCell; -@class PSMTabDragWindow; - -#define kPSMTabDragAnimationSteps 8 -#define PI 3.1417 - -@interface PSMTabDragAssistant : NSObject { - PSMTabBarControl *_sourceTabBar; - PSMTabBarControl *_destinationTabBar; - NSMutableSet *_participatingTabBars; - PSMTabBarCell *_draggedCell; - int _draggedCellIndex; // for snap back - BOOL _isDragging; - - // Animation - NSTimer *_animationTimer; - NSMutableArray *_sineCurveWidths; - NSPoint _currentMouseLoc; - PSMTabBarCell *_targetCell; -} - -// Creation/destruction -+ (PSMTabDragAssistant *)sharedDragAssistant; - -// Accessors -- (PSMTabBarControl *)sourceTabBar; -- (void)setSourceTabBar:(PSMTabBarControl *)tabBar; -- (PSMTabBarControl *)destinationTabBar; -- (void)setDestinationTabBar:(PSMTabBarControl *)tabBar; -- (PSMTabBarCell *)draggedCell; -- (void)setDraggedCell:(PSMTabBarCell *)cell; -- (int)draggedCellIndex; -- (void)setDraggedCellIndex:(int)value; -- (BOOL)isDragging; -- (void)setIsDragging:(BOOL)value; -- (NSPoint)currentMouseLoc; -- (void)setCurrentMouseLoc:(NSPoint)point; -- (PSMTabBarCell *)targetCell; -- (void)setTargetCell:(PSMTabBarCell *)cell; - -// Functionality -- (void)startDraggingCell:(PSMTabBarCell *)cell fromTabBar:(PSMTabBarControl *)control withMouseDownEvent:(NSEvent *)event; -- (void)draggingEnteredTabBar:(PSMTabBarControl *)control atPoint:(NSPoint)mouseLoc; -- (void)draggingUpdatedInTabBar:(PSMTabBarControl *)control atPoint:(NSPoint)mouseLoc; -- (void)draggingExitedTabBar:(PSMTabBarControl *)control; -- (void)performDragOperation; -- (void)draggedImageEndedAt:(NSPoint)aPoint operation:(NSDragOperation)operation; -- (void)finishDrag; - -// Animation -- (void)animateDrag:(NSTimer *)timer; -- (void)calculateDragAnimationForTabBar:(PSMTabBarControl *)control; - -// Placeholder -- (void)distributePlaceholdersInTabBar:(PSMTabBarControl *)control withDraggedCell:(PSMTabBarCell *)cell; -- (void)distributePlaceholdersInTabBar:(PSMTabBarControl *)control; -- (void)removeAllPlaceholdersFromTabBar:(PSMTabBarControl *)control; - -@end - -@interface PSMTabBarControl (DragAccessors) - -- (id)psmTabStyle; -- (NSMutableArray *)cells; -- (void)setControlView:(id)view; -- (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame; -- (PSMTabBarCell *)lastVisibleTab; -- (int)numberOfVisibleTabs; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.m b/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.m deleted file mode 100644 index 1142cf57ce..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.m +++ /dev/null @@ -1,439 +0,0 @@ -// -// PSMTabDragAssistant.m -// PSMTabBarControl -// -// Created by John Pannell on 4/10/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import "PSMTabDragAssistant.h" -#import "PSMTabBarCell.h" -#import "PSMTabStyle.h" - - -@implementation PSMTabDragAssistant - -static PSMTabDragAssistant *sharedDragAssistant = nil; - -#pragma mark - -#pragma mark Creation/Destruction - -+ (PSMTabDragAssistant *)sharedDragAssistant -{ - if (!sharedDragAssistant){ - sharedDragAssistant = [[PSMTabDragAssistant alloc] init]; - } - - return sharedDragAssistant; -} - -- (id)init -{ - if(self = [super init]){ - _sourceTabBar = nil; - _destinationTabBar = nil; - _participatingTabBars = [[NSMutableSet alloc] init]; - _draggedCell = nil; - _animationTimer = nil; - _sineCurveWidths = [[NSMutableArray alloc] initWithCapacity:kPSMTabDragAnimationSteps]; - _targetCell = nil; - _isDragging = NO; - } - - return self; -} - -- (void)dealloc -{ - [_sourceTabBar release]; - [_destinationTabBar release]; - [_participatingTabBars release]; - [_draggedCell release]; - [_animationTimer release]; - [_sineCurveWidths release]; - [_targetCell release]; - [super dealloc]; -} - -#pragma mark - -#pragma mark Accessors - -- (PSMTabBarControl *)sourceTabBar -{ - return _sourceTabBar; -} - -- (void)setSourceTabBar:(PSMTabBarControl *)tabBar -{ - [tabBar retain]; - [_sourceTabBar release]; - _sourceTabBar = tabBar; -} - -- (PSMTabBarControl *)destinationTabBar -{ - return _destinationTabBar; -} - -- (void)setDestinationTabBar:(PSMTabBarControl *)tabBar -{ - [tabBar retain]; - [_destinationTabBar release]; - _destinationTabBar = tabBar; -} - -- (PSMTabBarCell *)draggedCell -{ - return _draggedCell; -} - -- (void)setDraggedCell:(PSMTabBarCell *)cell -{ - [cell retain]; - [_draggedCell release]; - _draggedCell = cell; -} - -- (int)draggedCellIndex -{ - return _draggedCellIndex; -} - -- (void)setDraggedCellIndex:(int)value -{ - _draggedCellIndex = value; -} - -- (BOOL)isDragging -{ - return _isDragging; -} - -- (void)setIsDragging:(BOOL)value -{ - _isDragging = value; -} - -- (NSPoint)currentMouseLoc -{ - return _currentMouseLoc; -} - -- (void)setCurrentMouseLoc:(NSPoint)point -{ - _currentMouseLoc = point; -} - -- (PSMTabBarCell *)targetCell -{ - return _targetCell; -} - -- (void)setTargetCell:(PSMTabBarCell *)cell -{ - [cell retain]; - [_targetCell release]; - _targetCell = cell; -} - -#pragma mark - -#pragma mark Functionality - -- (void)startDraggingCell:(PSMTabBarCell *)cell fromTabBar:(PSMTabBarControl *)control withMouseDownEvent:(NSEvent *)event -{ - [self setIsDragging:YES]; - [self setSourceTabBar:control]; - [self setDestinationTabBar:control]; - [_participatingTabBars addObject:control]; - [self setDraggedCell:cell]; - [self setDraggedCellIndex:(int)[[control cells] indexOfObject:cell]]; - - NSRect cellFrame = [cell frame]; - // list of widths for animation - int i; - float cellWidth = cellFrame.size.width; - for(i = 0; i < kPSMTabDragAnimationSteps; i++){ - int thisWidth; - thisWidth = (int)(cellWidth - ((cellWidth/2.0) + ((sin((PI/2.0) + ((float)i/(float)kPSMTabDragAnimationSteps)*PI) * cellWidth) / 2.0))); - [_sineCurveWidths addObject:[NSNumber numberWithInt:thisWidth]]; - } - - // hide UI buttons - [[control overflowPopUpButton] setHidden:YES]; - [[control addTabButton] setHidden:YES]; - - [[NSCursor closedHandCursor] set]; - - NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; - NSImage *dragImage = [cell dragImageForRect:cellFrame]; - [[cell indicator] removeFromSuperview]; - [self distributePlaceholdersInTabBar:control withDraggedCell:cell]; - - if([control isFlipped]){ - cellFrame.origin.y += cellFrame.size.height; - } - [cell setHighlighted:NO]; - NSSize offset = NSZeroSize; - [pboard declareTypes:[NSArray arrayWithObjects:@"PSMTabBarControlItemPBType", nil] owner: nil]; - [pboard setString:[[NSNumber numberWithInt:(int)[[control cells] indexOfObject:cell]] stringValue] forType:@"PSMTabBarControlItemPBType"]; - _animationTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0/30.0) target:self selector:@selector(animateDrag:) userInfo:nil repeats:YES]; - [control dragImage:dragImage at:cellFrame.origin offset:offset event:event pasteboard:pboard source:control slideBack:YES]; -} - -- (void)draggingEnteredTabBar:(PSMTabBarControl *)control atPoint:(NSPoint)mouseLoc -{ - [self setDestinationTabBar:control]; - [self setCurrentMouseLoc:mouseLoc]; - // hide UI buttons - [[control overflowPopUpButton] setHidden:YES]; - [[control addTabButton] setHidden:YES]; - if(![[[control cells] objectAtIndex:0] isPlaceholder]) - [self distributePlaceholdersInTabBar:control]; - [_participatingTabBars addObject:control]; -} - -- (void)draggingUpdatedInTabBar:(PSMTabBarControl *)control atPoint:(NSPoint)mouseLoc -{ - if([self destinationTabBar] != control) - [self setDestinationTabBar:control]; - [self setCurrentMouseLoc:mouseLoc]; -} - -- (void)draggingExitedTabBar:(PSMTabBarControl *)control -{ - [self setDestinationTabBar:nil]; - [self setCurrentMouseLoc:NSMakePoint(-1.0, -1.0)]; -} - -- (void)performDragOperation -{ -#if 1 - // move cell - [[[self destinationTabBar] cells] replaceObjectAtIndex:[[[self destinationTabBar] cells] indexOfObject:[self targetCell]] withObject:[self draggedCell]]; - [[self draggedCell] setControlView:[self destinationTabBar]]; - // move actual NSTabViewItem - if([self sourceTabBar] != [self destinationTabBar]){ - [[[self sourceTabBar] tabView] removeTabViewItem:[[self draggedCell] representedObject]]; - [[[self destinationTabBar] tabView] addTabViewItem:[[self draggedCell] representedObject]]; - } - [self finishDrag]; -#else - unsigned idx = [[[self destinationTabBar] cells] indexOfObject:[self targetCell]]; - - // move cell - [[[self destinationTabBar] cells] replaceObjectAtIndex:idx withObject:[self draggedCell]]; - [[self draggedCell] setControlView:[self destinationTabBar]]; - // move actual NSTabViewItem - if([self sourceTabBar] != [self destinationTabBar]){ - [[[self sourceTabBar] tabView] removeTabViewItem:[[self draggedCell] representedObject]]; - idx = [[[self destinationTabBar] cells] indexOfObject:[self draggedCell]]; - NSLog(@"Inserting at index %d", idx); - [[[self destinationTabBar] tabView] insertTabViewItem:[[self draggedCell] representedObject] atIndex:idx]; - } - [self finishDrag]; -#endif -} - -- (void)draggedImageEndedAt:(NSPoint)aPoint operation:(NSDragOperation)operation -{ - if([self isDragging]){ // means there was not a successful drop (performDragOperation) - // put cell back - [[[self sourceTabBar] cells] insertObject:[self draggedCell] atIndex:[self draggedCellIndex]]; - [self finishDrag]; - } -} - -- (void)finishDrag -{ - [self setIsDragging:NO]; - [self removeAllPlaceholdersFromTabBar:[self sourceTabBar]]; - [self setSourceTabBar:nil]; - [self setDestinationTabBar:nil]; - NSEnumerator *e = [_participatingTabBars objectEnumerator]; - PSMTabBarControl *tabBar; - while(tabBar = [e nextObject]){ - [self removeAllPlaceholdersFromTabBar:tabBar]; - } - [_participatingTabBars removeAllObjects]; - [self setDraggedCell:nil]; - [_animationTimer invalidate]; - _animationTimer = nil; - [_sineCurveWidths removeAllObjects]; - [self setTargetCell:nil]; -} - -#pragma mark - -#pragma mark Animation - -- (void)animateDrag:(NSTimer *)timer -{ - NSEnumerator *e = [_participatingTabBars objectEnumerator]; - PSMTabBarControl *tabBar; - while(tabBar = [e nextObject]){ - [self calculateDragAnimationForTabBar:tabBar]; - [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:tabBar argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; - } -} - -- (void)calculateDragAnimationForTabBar:(PSMTabBarControl *)control -{ - BOOL removeFlag = YES; - NSMutableArray *cells = [control cells]; - int i, cellCount = (unsigned)[cells count]; - float xPos = [[control psmTabStyle] leftMarginForTabBarControl]; - - // identify target cell - // mouse at beginning of tabs - NSPoint mouseLoc = [self currentMouseLoc]; - if([self destinationTabBar] == control){ - removeFlag = NO; - if(mouseLoc.x < [[control psmTabStyle] leftMarginForTabBarControl]){ - [self setTargetCell:[cells objectAtIndex:0]]; - goto layout; - } - - NSRect overCellRect; - PSMTabBarCell *overCell = [control cellForPoint:mouseLoc cellFrame:&overCellRect]; - if(overCell){ - // mouse among cells - placeholder - if([overCell isPlaceholder]){ - [self setTargetCell:overCell]; - goto layout; - } - - // non-placeholders - if(mouseLoc.x < (overCellRect.origin.x + (overCellRect.size.width / 2.0))){ - // mouse on left side of cell - [self setTargetCell:[cells objectAtIndex:([cells indexOfObject:overCell] - 1)]]; - goto layout; - } else { - // mouse on right side of cell - [self setTargetCell:[cells objectAtIndex:([cells indexOfObject:overCell] + 1)]]; - goto layout; - } - } else { - // out at end - must find proper cell (could be more in overflow menu) - [self setTargetCell:[control lastVisibleTab]]; - goto layout; - } - } else { - [self setTargetCell:nil]; - } - -layout: - for(i = 0; i < cellCount; i++){ - PSMTabBarCell *cell = [cells objectAtIndex:i]; - NSRect newRect = [cell frame]; - if(![cell isInOverflowMenu]){ - if([cell isPlaceholder]){ - if(cell == [self targetCell]){ - [cell setCurrentStep:([cell currentStep] + 1)]; - } else { - [cell setCurrentStep:([cell currentStep] - 1)]; - if([cell currentStep] > 0){ - removeFlag = NO; - } - } - newRect.size.width = [[_sineCurveWidths objectAtIndex:[cell currentStep]] intValue]; - } - } else { - break; - } - newRect.origin.x = xPos; - [cell setFrame:newRect]; - if([cell indicator]) - [[cell indicator] setFrame:[[control psmTabStyle] indicatorRectForTabCell:cell]]; - xPos += newRect.size.width; - } - if(removeFlag){ - [_participatingTabBars removeObject:control]; - [self removeAllPlaceholdersFromTabBar:control]; - } -} - -#pragma mark - -#pragma mark Placeholders - -- (void)distributePlaceholdersInTabBar:(PSMTabBarControl *)control withDraggedCell:(PSMTabBarCell *)cell -{ - // called upon first drag - must distribute placeholders - [self distributePlaceholdersInTabBar:control]; - // replace dragged cell with a placeholder, and clean up surrounding cells - NSUInteger cellIndex = [[control cells] indexOfObject:cell]; - PSMTabBarCell *pc = [[[PSMTabBarCell alloc] initPlaceholderWithFrame:[[self draggedCell] frame] expanded:YES inControlView:control] autorelease]; - [[control cells] replaceObjectAtIndex:cellIndex withObject:pc]; - [[control cells] removeObjectAtIndex:(cellIndex + 1)]; - [[control cells] removeObjectAtIndex:(cellIndex - 1)]; - return; -} - -- (void)distributePlaceholdersInTabBar:(PSMTabBarControl *)control -{ - int i, numVisibleTabs = [control numberOfVisibleTabs]; - for(i = 0; i < numVisibleTabs; i++){ - PSMTabBarCell *pc = [[[PSMTabBarCell alloc] initPlaceholderWithFrame:[[self draggedCell] frame] expanded:NO inControlView:control] autorelease]; - [[control cells] insertObject:pc atIndex:(2 * i)]; - } - if(numVisibleTabs > 0){ - PSMTabBarCell *pc = [[[PSMTabBarCell alloc] initPlaceholderWithFrame:[[self draggedCell] frame] expanded:NO inControlView:control] autorelease]; - if([[control cells] count] > (2 * numVisibleTabs)){ - [[control cells] insertObject:pc atIndex:(2 * numVisibleTabs)]; - } else { - [[control cells] addObject:pc]; - } - } -} - -- (void)removeAllPlaceholdersFromTabBar:(PSMTabBarControl *)control -{ - int i, cellCount = (int)[[control cells] count]; - for(i = (cellCount - 1); i >= 0; i--){ - PSMTabBarCell *cell = [[control cells] objectAtIndex:i]; - if([cell isPlaceholder]) - [[control cells] removeObject:cell]; - } - // redraw - [[NSRunLoop currentRunLoop] performSelector:@selector(update) target:control argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; - [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:control argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder { - //[super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:_sourceTabBar forKey:@"sourceTabBar"]; - [aCoder encodeObject:_destinationTabBar forKey:@"destinationTabBar"]; - [aCoder encodeObject:_participatingTabBars forKey:@"participatingTabBars"]; - [aCoder encodeObject:_draggedCell forKey:@"draggedCell"]; - [aCoder encodeInt:_draggedCellIndex forKey:@"draggedCellIndex"]; - [aCoder encodeBool:_isDragging forKey:@"isDragging"]; - [aCoder encodeObject:_animationTimer forKey:@"animationTimer"]; - [aCoder encodeObject:_sineCurveWidths forKey:@"sineCurveWidths"]; - [aCoder encodePoint:_currentMouseLoc forKey:@"currentMouseLoc"]; - [aCoder encodeObject:_targetCell forKey:@"targetCell"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - //self = [super initWithCoder:aDecoder]; - //if (self) { - if ([aDecoder allowsKeyedCoding]) { - _sourceTabBar = [[aDecoder decodeObjectForKey:@"sourceTabBar"] retain]; - _destinationTabBar = [[aDecoder decodeObjectForKey:@"destinationTabBar"] retain]; - _participatingTabBars = [[aDecoder decodeObjectForKey:@"participatingTabBars"] retain]; - _draggedCell = [[aDecoder decodeObjectForKey:@"draggedCell"] retain]; - _draggedCellIndex = [aDecoder decodeIntForKey:@"draggedCellIndex"]; - _isDragging = [aDecoder decodeBoolForKey:@"isDragging"]; - _animationTimer = [[aDecoder decodeObjectForKey:@"animationTimer"] retain]; - _sineCurveWidths = [[aDecoder decodeObjectForKey:@"sineCurveWidths"] retain]; - _currentMouseLoc = [aDecoder decodePointForKey:@"currentMouseLoc"]; - _targetCell = [[aDecoder decodeObjectForKey:@"targetCell"] retain]; - } - //} - return self; -} - - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabStyle.h b/src/MacVim/PSMTabBarControl/source/PSMTabStyle.h deleted file mode 100644 index eedf7b7712..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabStyle.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// PSMTabStyle.h -// PSMTabBarControl -// -// Created by John Pannell on 2/17/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -/* -Protocol to be observed by all style delegate objects. These objects handle the drawing responsibilities for PSMTabBarCell; once the control has been assigned a style, the background and cells draw consistent with that style. Design pattern and implementation by David Smith, Seth Willits, and Chris Forsythe, all touch up and errors by John P. :-) -*/ - -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" - -@protocol PSMTabStyle - -// identity -- (NSString *)name; - -// control specific parameters -- (float)leftMarginForTabBarControl; -- (float)rightMarginForTabBarControl; - -// add tab button -- (NSImage *)addTabButtonImage; -- (NSImage *)addTabButtonPressedImage; -- (NSImage *)addTabButtonRolloverImage; - -// cell specific parameters -- (NSRect)closeButtonRectForTabCell:(PSMTabBarCell *)cell; -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell; -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell; -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell; -- (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell; -- (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell; - -// cell values -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell; -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell; - -// drawing -- (void)drawTabCell:(PSMTabBarCell *)cell; -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect; - -@end - -@interface PSMTabBarControl (StyleAccessors) - -- (NSMutableArray *)cells; - -@end \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.h b/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.h deleted file mode 100644 index 871f713c52..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// PSMUnifiedTabStyle.h -// -------------------- -// -// Created by Keith Blount on 30/04/2006. -// Copyright 2006 __MyCompanyName__. All rights reserved. -// - -#import -#import "PSMTabStyle.h" - -@interface PSMUnifiedTabStyle : NSObject -{ - NSImage *unifiedCloseButton; - NSImage *unifiedCloseButtonDown; - NSImage *unifiedCloseButtonOver; - NSImage *_addTabButtonImage; - NSImage *_addTabButtonPressedImage; - NSImage *_addTabButtonRolloverImage; - NSMutableParagraphStyle *truncatingTailParagraphStyle; - NSMutableParagraphStyle *centeredParagraphStyle; - - float leftMargin; -} -- (void)setLeftMarginForTabBarControl:(float)margin; -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m deleted file mode 100644 index 56a60d3fab..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m +++ /dev/null @@ -1,525 +0,0 @@ -// -// PSMUnifiedTabStyle.m -// -------------------- -// -// Created by Keith Blount on 30/04/2006. -// Copyright 2006 __MyCompanyName__. All rights reserved. -// - -#import "PSMUnifiedTabStyle.h" -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" -#import "NSBezierPath_AMShading.h" - -#define kPSMUnifiedObjectCounterRadius 7.0 -#define kPSMUnifiedCounterMinWidth 20 - -@interface PSMUnifiedTabStyle (Private) -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; -@end - -@implementation PSMUnifiedTabStyle - -- (NSString *)name -{ - return @"Unified"; -} - -#pragma mark - -#pragma mark Creation/Destruction - -- (id) init -{ - if((self = [super init])) - { - unifiedCloseButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front"]]; - unifiedCloseButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Pressed"]]; - unifiedCloseButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNew"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewRollover"]]; - - leftMargin = 5.0; - } - return self; -} - -- (void)dealloc -{ - [unifiedCloseButton release]; - [unifiedCloseButtonDown release]; - [unifiedCloseButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - [truncatingTailParagraphStyle release]; - [centeredParagraphStyle release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Control Specific - -- (void)setLeftMarginForTabBarControl:(float)margin -{ - leftMargin = margin; -} - -- (float)leftMarginForTabBarControl -{ - return leftMargin; -} - -- (float)rightMarginForTabBarControl -{ - return 24.0f; -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect) closeButtonRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [unifiedCloseButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - result.origin.x += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y - 1.0; - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - float countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMUnifiedObjectCounterRadius - 6.0); - if(countWidth < kPSMUnifiedCounterMinWidth) - countWidth = kPSMUnifiedCounterMinWidth; - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMUnifiedObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - - return result; -} - - -- (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSNumberFormatter *nf = [[[NSNumberFormatter alloc] init] autorelease]; - [nf setLocalizesFormat:YES]; - [nf setFormat:@"0"]; - [nf setHasThousandSeparators:YES]; - NSString *contents = [nf stringFromNumber:[NSNumber numberWithInt:[cell count]]]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[fm convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor whiteColor] colorWithAlphaComponent:0.85] range:range]; - - return attrStr; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString * contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - - // Paragraph Style for Truncating Long Text - if (!truncatingTailParagraphStyle) { - truncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [truncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:truncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - NSColor * lineColor = nil; - NSBezierPath* bezier = [NSBezierPath bezierPath]; - lineColor = [NSColor colorWithCalibratedWhite:0.576 alpha:1.0]; - - if ([cell state] == NSOnState) - { - // selected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x+0.5, cellFrame.origin.y-0.5, cellFrame.size.width-1.0, cellFrame.size.height); - aRect.size.height -= 0.5; - - aRect.size.height+=0.5; - - // frame - float radius = MIN(6.0, 0.5f * MIN(NSWidth(aRect), NSHeight(aRect))); - NSRect rect = NSInsetRect(aRect, radius, radius); - - [bezier appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMinY(rect)) radius:radius startAngle:180.0 endAngle:270.0]; - - [bezier appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMinY(rect)) radius:radius startAngle:270.0 endAngle:360.0]; - - NSPoint cornerPoint = NSMakePoint(NSMaxX(aRect), NSMaxY(aRect)); - [bezier appendBezierPathWithPoints:&cornerPoint count:1]; - - cornerPoint = NSMakePoint(NSMinX(aRect), NSMaxY(aRect)); - [bezier appendBezierPathWithPoints:&cornerPoint count:1]; - - [bezier closePath]; - - //[[NSColor windowBackgroundColor] set]; - //[bezier fill]; - [bezier linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.99 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.941 alpha:1.0]]; - - [lineColor set]; - [bezier stroke]; - } - else - { - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - aRect.origin.y += 0.5; - aRect.origin.x += 1.5; - aRect.size.width -= 1; - - aRect.origin.x -= 1; - aRect.size.width += 1; - - // rollover - if ([cell isHighlighted]) - { - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositingOperationSourceAtop); - } - - // frame - - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y-0.5)]; - if(!([cell tabState] & PSMTab_RightIsSelectedMask)){ - [bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect))]; - } - - [bezier stroke]; - - // Create a thin lighter line next to the dividing line for a bezel effect - if(!([cell tabState] & PSMTab_RightIsSelectedMask)){ - [[[NSColor whiteColor] colorWithAlphaComponent:0.5] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(NSMaxX(aRect)+1.0, aRect.origin.y-0.5) - toPoint:NSMakePoint(NSMaxX(aRect)+1.0, NSMaxY(aRect)-2.5)]; - } - - // If this is the leftmost tab, we want to draw a line on the left, too - if ([cell tabState] & PSMTab_PositionLeftMask) - { - [lineColor set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(aRect.origin.x,aRect.origin.y-0.5) - toPoint:NSMakePoint(aRect.origin.x,NSMaxY(aRect)-2.5)]; - [[[NSColor whiteColor] colorWithAlphaComponent:0.5] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(aRect.origin.x+1.0,aRect.origin.y-0.5) - toPoint:NSMakePoint(aRect.origin.x+1.0,NSMaxY(aRect)-2.5)]; - } - } - - [self drawInteriorWithTabCell:cell inView:[cell controlView]]; -} - - - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - float labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage * closeButton = nil; - - closeButton = unifiedCloseButton; - if ([cell closeButtonOver]) closeButton = unifiedCloseButtonOver; - if ([cell closeButtonPressed]) closeButton = unifiedCloseButtonDown; - - closeButtonSize = [closeButton size]; - [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; - } - -#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best. - // icon - if([cell hasIcon]){ - NSRect iconRect = [self iconRectForTabCell:cell]; - NSImage *icon = [[[[cell representedObject] identifier] content] icon]; - if ([controlView isFlipped]) { - iconRect.origin.y = cellFrame.size.height - iconRect.origin.y; - } - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0]; - - // scoot label over - labelPosition += iconRect.size.width + kPSMTabBarCellPadding; - } -#endif - - // object counter - if([cell count] > 0){ - [[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - myRect.origin.y -= 1.0; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMUnifiedObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMUnifiedObjectCounterRadius, myRect.origin.y + kPSMUnifiedObjectCounterRadius) radius:kPSMUnifiedObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y + kPSMUnifiedObjectCounterRadius) radius:kPSMUnifiedObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - NSSize s = [[cell attributedStringValue] size]; - labelRect.origin.y = cellFrame.origin.y + (cellFrame.size.height-s.height)/2.0 - 1.0; - labelRect.size.height = s.height; - - if(![[cell indicator] isHidden]) - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - - if([cell count] > 0) - labelRect.size.width -= ([self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding); - - // label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - NSRect gradientRect = rect; - gradientRect.size.height -= 1.0; - NSBezierPath *path = [NSBezierPath bezierPathWithRect:gradientRect]; - [path linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.918 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]]; - [[NSColor colorWithCalibratedWhite:0.576 alpha:1.0] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,NSMaxY(rect)-0.5) - toPoint:NSMakePoint(NSMaxX(rect),NSMaxY(rect)-0.5)]; - - // no tab view == not connected - if(![bar tabView]){ - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [centeredParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - if(![cell isInOverflowMenu]){ - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - //[super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:unifiedCloseButton forKey:@"unifiedCloseButton"]; - [aCoder encodeObject:unifiedCloseButtonDown forKey:@"unifiedCloseButtonDown"]; - [aCoder encodeObject:unifiedCloseButtonOver forKey:@"unifiedCloseButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - // self = [super initWithCoder:aDecoder]; - //if (self) { - if ([aDecoder allowsKeyedCoding]) { - unifiedCloseButton = [[aDecoder decodeObjectForKey:@"unifiedCloseButton"] retain]; - unifiedCloseButtonDown = [[aDecoder decodeObjectForKey:@"unifiedCloseButtonDown"] retain]; - unifiedCloseButtonOver = [[aDecoder decodeObjectForKey:@"unifiedCloseButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - } - //} - return self; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.h b/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.h deleted file mode 100644 index 2f3581132f..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// PSMYosemiteTabStyle.h -// PSMTabBarControl -// -// Created by Christoffer Winterkvist on 25/08/14. -// -// - -#import -#import "PSMTabStyle.h" - -@interface PSMYosemiteTabStyle : NSObject { - NSImage *closeButton; - NSImage *closeButtonDown; - NSImage *closeButtonOver; - NSImage *_addTabButtonImage; - NSImage *_addTabButtonPressedImage; - NSImage *_addTabButtonRolloverImage; - NSMutableParagraphStyle *truncatingTailParagraphStyle; - NSMutableParagraphStyle *centeredParagraphStyle; -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; - -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.m deleted file mode 100644 index 0997cc00bb..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.m +++ /dev/null @@ -1,499 +0,0 @@ -// -// PSMYosemiteTabStyle.m -// PSMTabBarControl -// -// Created by Christoffer Winterkvist on 25/08/14. -// -// - -#import "PSMYosemiteTabStyle.h" - -#define kPSMMetalObjectCounterRadius 7.0 -#define kPSMMetalCounterMinWidth 20 - -void YosemiteNSDrawWindowBackground(NSRect rect, NSColor *color) -{ - [color set]; - NSRectFill( rect ); -} - -@implementation PSMYosemiteTabStyle - -- (void)dealloc -{ - [closeButton release]; - [closeButtonDown release]; - [closeButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - - [truncatingTailParagraphStyle release]; - [centeredParagraphStyle release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Initializers - -- (id)init -{ - self = [super init]; - if (!self) return nil; - - closeButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front"]]; - //NSLog(@"closeButton=%@ path=%@", metalCloseButton, - // [[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front"]); - closeButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front_Pressed"]]; - closeButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetal"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetalPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetalRollover"]]; - - return self; -} - -- (NSString *)name -{ - return @"Yosemite"; -} - -#pragma mark - -#pragma mark Control Specific - -- (float)leftMarginForTabBarControl -{ - return -1.0f; -} - -- (float)rightMarginForTabBarControl -{ - return 24.0f; -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -- (NSColor *)backgroundColor:(BOOL)isKeyWindow -{ - NSColor *backgroundColor; - if (isKeyWindow) { - backgroundColor = [NSColor colorWithCalibratedHue:0.000 saturation:0.000 brightness:0.875 alpha:1]; - } else { - backgroundColor = [NSColor colorWithCalibratedHue:0.000 saturation:0.000 brightness:0.957 alpha:1]; - } - - return backgroundColor; -} - -- (NSColor *)borderColor -{ - return [NSColor colorWithCalibratedHue:0.000 saturation:0.000 brightness:0.678 alpha:1]; -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect) closeButtonRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [closeButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 2.0; - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - result.origin.x += [closeButton size].width + kPSMTabBarCellPadding; - - if([cell state] == NSOnState){ - result.origin.y += 1; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell state] == NSOnState){ - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - float countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMMetalObjectCounterRadius - 6.0); - if(countWidth < kPSMMetalCounterMinWidth) - countWidth = kPSMMetalCounterMinWidth; - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMMetalObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - - return result; -} - - -- (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [closeButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [closeButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSNumberFormatter *nf = [[[NSNumberFormatter alloc] init] autorelease]; - [nf setLocalizesFormat:YES]; - [nf setFormat:@"0"]; - [nf setHasThousandSeparators:YES]; - NSString *contents = [nf stringFromNumber:[NSNumber numberWithInt:[cell count]]]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[fm convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor whiteColor] colorWithAlphaComponent:0.85] range:range]; - - return attrStr; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString *contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - - PSMTabBarControl *bar = (PSMTabBarControl *)cell.controlView; - BOOL isKeyWindow = [bar.window isKeyWindow]; - - CGFloat textAlpha; - if ([cell state] == NSOnState) { - textAlpha = (isKeyWindow) ? 1.0f : 0.5f; - } else { - textAlpha = (isKeyWindow) ? 0.5f : 0.25f; - } - NSColor *textColor = [[NSColor textColor] colorWithAlphaComponent:textAlpha]; - - [attrStr addAttribute:NSForegroundColorAttributeName value:textColor range:range]; - - // Paragraph Style for Truncating Long Text - if (!truncatingTailParagraphStyle) { - truncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [truncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingHead]; - [truncatingTailParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:truncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - NSColor * lineColor = nil; - NSBezierPath* bezier = [NSBezierPath bezierPath]; - lineColor = [self borderColor]; - - if ([cell state] == NSOnState) { - // selected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - - PSMTabBarControl *bar = (PSMTabBarControl *)cell.controlView; - BOOL isKeyWindow = [bar.window isKeyWindow]; - - // background - YosemiteNSDrawWindowBackground(aRect, [self backgroundColor:isKeyWindow]); - - aRect.size.height -= 1.0f; - aRect.origin.y += 0.5f; - // frame - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier stroke]; - } else { - - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - - aRect.origin.x += 0.5; - - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositingOperationSourceAtop); - - // frame - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y)]; - if(!([cell tabState] & PSMTab_RightIsSelectedMask)){ - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y + aRect.size.height)]; - } - [bezier stroke]; - } - - [self drawInteriorWithTabCell:cell inView:[cell controlView]]; -} - - - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - float labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage *button = nil; - - if ([cell isHighlighted]) button = closeButton; - if ([cell closeButtonOver]) button = closeButtonOver; - if ([cell closeButtonPressed]) button = closeButtonDown; - - closeButtonSize = [button size]; - [button drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil]; - } - - // object counter - if([cell count] > 0){ - [[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - labelRect.size.height = cellFrame.size.height; - labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - - if([cell count] > 0) - labelRect.size.width -= ([self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding); - - // label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - BOOL isKeyWindow = [bar.window isKeyWindow]; - YosemiteNSDrawWindowBackground(rect, [self backgroundColor:isKeyWindow]); - - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.0] set]; - NSRectFillUsingOperation(rect, NSCompositingOperationSourceAtop); - [[self borderColor] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,rect.origin.y+0.5) toPoint:NSMakePoint(rect.origin.x+rect.size.width,rect.origin.y+0.5)]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,rect.origin.y+rect.size.height-0.5) toPoint:NSMakePoint(rect.origin.x+rect.size.width,rect.origin.y+rect.size.height-0.5)]; - - // no tab view == not connected - if(![bar tabView]){ - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [centeredParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - if(![cell isInOverflowMenu]){ - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:closeButton forKey:@"metalCloseButton"]; - [aCoder encodeObject:closeButtonDown forKey:@"metalCloseButtonDown"]; - [aCoder encodeObject:closeButtonOver forKey:@"metalCloseButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - if ([aDecoder allowsKeyedCoding]) { - closeButton = [[aDecoder decodeObjectForKey:@"metalCloseButton"] retain]; - closeButtonDown = [[aDecoder decodeObjectForKey:@"metalCloseButtonDown"] retain]; - closeButtonOver = [[aDecoder decodeObjectForKey:@"metalCloseButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - } - - return self; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/WindowController.h b/src/MacVim/PSMTabBarControl/source/WindowController.h deleted file mode 100644 index ae655b8bea..0000000000 --- a/src/MacVim/PSMTabBarControl/source/WindowController.h +++ /dev/null @@ -1,58 +0,0 @@ -// -// WindowController.h -// PSMTabBarControl -// -// Created by John Pannell on 4/6/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import -@class PSMTabBarControl; - -@interface WindowController : NSWindowController { - IBOutlet NSTabView *tabView; - IBOutlet NSTextField *tabField; - IBOutlet NSDrawer *drawer; - - IBOutlet PSMTabBarControl *tabBar; - - IBOutlet NSButton *isProcessingButton; - IBOutlet NSTextField *objectCounterField; - IBOutlet NSPopUpButton *iconButton; -} - -// UI -- (IBAction)addNewTab:(id)sender; -- (IBAction)closeTab:(id)sender; -- (IBAction)stopProcessing:(id)sender; -- (IBAction)setIconNamed:(id)sender; -- (IBAction)setObjectCount:(id)sender; -- (IBAction)setTabLabel:(id)sender; - -// Actions -- (IBAction)isProcessingAction:(id)sender; - -// tab bar config -- (void)configStyle:(id)sender; -- (void)configCanCloseOnlyTab:(id)sender; -- (void)configHideForSingleTab:(id)sender; -- (void)configAddTabButton:(id)sender; -- (void)configTabMinWidth:(id)sender; -- (void)configTabMaxWidth:(id)sender; -- (void)configTabOptimumWidth:(id)sender; -- (void)configTabSizeToFit:(id)sender; - -// delegate -- (void)tabView:(NSTabView *)aTabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem; -- (BOOL)tabView:(NSTabView *)aTabView shouldCloseTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)aTabView willCloseTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)aTabView didCloseTabViewItem:(NSTabViewItem *)tabViewItem; - -// toolbar -- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag; -- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar; -- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar; -- (IBAction)toggleToolbar:(id)sender; -- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/WindowController.m b/src/MacVim/PSMTabBarControl/source/WindowController.m deleted file mode 100644 index 07414dbdcf..0000000000 --- a/src/MacVim/PSMTabBarControl/source/WindowController.m +++ /dev/null @@ -1,280 +0,0 @@ -// -// WindowController.m -// PSMTabBarControl -// -// Created by John Pannell on 4/6/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import "WindowController.h" -#import "FakeModel.h" -#import "PSMTabBarControl.h" - -@implementation WindowController - -- (void)awakeFromNib -{ - // toolbar - NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@"DemoToolbar"]; - [toolbar setDelegate:self]; - [toolbar setAllowsUserCustomization:YES]; - [toolbar setAutosavesConfiguration:YES]; - /*SInt32 MacVersion; - if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr){ - if (MacVersion >= 0x1040){ - // this call is Tiger only - [toolbar setShowsBaselineSeparator:NO]; - } - }*/ - [[self window] setToolbar:toolbar]; - - // hook up add tab button - [[tabBar addTabButton] setTarget:self]; - [[tabBar addTabButton] setAction:@selector(addNewTab:)]; - - // remove any tabs present in the nib - NSArray *existingItems = [tabView tabViewItems]; - NSEnumerator *e = [existingItems objectEnumerator]; - NSTabViewItem *item; - while(item = [e nextObject]){ - [tabView removeTabViewItem:item]; - } - - [self addNewTab:self]; - [self addNewTab:self]; - [self addNewTab:self]; - [[tabView tabViewItemAtIndex:0] setLabel:@"Tab"]; - [[tabView tabViewItemAtIndex:1] setLabel:@"Bar"]; - [[tabView tabViewItemAtIndex:2] setLabel:@"Control"]; - - // open drawer - //[drawer toggle:self]; -} - -- (IBAction)addNewTab:(id)sender -{ - FakeModel *newModel = [[FakeModel alloc] init]; - NSTabViewItem *newItem = [[[NSTabViewItem alloc] initWithIdentifier:[newModel controller]] autorelease]; - [newItem setLabel:@"Untitled"]; - [tabView addTabViewItem:newItem]; - [tabView selectTabViewItem:newItem]; // this is optional, but expected behavior - [newModel release]; -} - -- (IBAction)closeTab:(id)sender -{ - [tabView removeTabViewItem:[tabView selectedTabViewItem]]; -} - -- (void)stopProcessing:(id)sender -{ - [[[tabView selectedTabViewItem] identifier] setValue:[NSNumber numberWithBool:NO] forKeyPath:@"selection.isProcessing"]; -} - -- (void)setIconNamed:(id)sender -{ - NSString *iconName = [sender titleOfSelectedItem]; - if([iconName isEqualToString:@"None"]){ - [[[tabView selectedTabViewItem] identifier] setValue:nil forKeyPath:@"selection.icon"]; - [[[tabView selectedTabViewItem] identifier] setValue:@"None" forKeyPath:@"selection.iconName"]; - } else { - NSImage *newIcon = [NSImage imageNamed:iconName]; - [[[tabView selectedTabViewItem] identifier] setValue:newIcon forKeyPath:@"selection.icon"]; - [[[tabView selectedTabViewItem] identifier] setValue:iconName forKeyPath:@"selection.iconName"]; - } -} - -- (void)setObjectCount:(id)sender -{ - [[[tabView selectedTabViewItem] identifier] setValue:[NSNumber numberWithInt:[sender intValue]] forKeyPath:@"selection.objectCount"]; -} - -- (IBAction)isProcessingAction:(id)sender -{ - [[[tabView selectedTabViewItem] identifier] setValue:[NSNumber numberWithBool:[sender state]] forKeyPath:@"selection.isProcessing"]; -} - -- (IBAction)setTabLabel:(id)sender -{ - [[tabView selectedTabViewItem] setLabel:[sender stringValue]]; -} - -- (BOOL)validateMenuItem:(id )menuItem -{ - if([menuItem action] == @selector(closeTab:)){ - if(![tabBar canCloseOnlyTab] && ([tabView numberOfTabViewItems] <= 1)){ - return NO; - } - } - return YES; -} - -#pragma mark - -#pragma mark ---- tab bar config ---- - -- (void)configStyle:(id)sender -{ - [tabBar setStyleNamed:[sender titleOfSelectedItem]]; -} - -- (void)configCanCloseOnlyTab:(id)sender -{ - [tabBar setCanCloseOnlyTab:[sender state]]; -} - -- (void)configHideForSingleTab:(id)sender -{ - [tabBar setHideForSingleTab:[sender state]]; -} - -- (void)configAddTabButton:(id)sender -{ - [tabBar setShowAddTabButton:[sender state]]; -} - -- (void)configTabMinWidth:(id)sender -{ - if([tabBar cellOptimumWidth] < [sender intValue]){ - [tabBar setCellMinWidth:[tabBar cellOptimumWidth]]; - [sender setIntValue:[tabBar cellOptimumWidth]]; - return; - } - - [tabBar setCellMinWidth:[sender intValue]]; -} - -- (void)configTabMaxWidth:(id)sender -{ - if([tabBar cellOptimumWidth] > [sender intValue]){ - [tabBar setCellMaxWidth:[tabBar cellOptimumWidth]]; - [sender setIntValue:[tabBar cellOptimumWidth]]; - return; - } - - [tabBar setCellMaxWidth:[sender intValue]]; -} - -- (void)configTabOptimumWidth:(id)sender -{ - if([tabBar cellMaxWidth] < [sender intValue]){ - [tabBar setCellOptimumWidth:[tabBar cellMaxWidth]]; - [sender setIntValue:[tabBar cellMaxWidth]]; - return; - } - - if([tabBar cellMinWidth] > [sender intValue]){ - [tabBar setCellOptimumWidth:[tabBar cellMinWidth]]; - [sender setIntValue:[tabBar cellMinWidth]]; - return; - } - - [tabBar setCellOptimumWidth:[sender intValue]]; -} - -- (void)configTabSizeToFit:(id)sender -{ - [tabBar setSizeCellsToFit:[sender state]]; -} - -#pragma mark - -#pragma mark ---- delegate ---- - -- (void)tabView:(NSTabView *)aTabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem -{ - // need to update bound values to match the selected tab - if([[tabViewItem identifier] respondsToSelector:@selector(content)]){ - if([[[tabViewItem identifier] content] respondsToSelector:@selector(objectCount)]){ - [objectCounterField setIntValue:[[[tabViewItem identifier] content] objectCount]]; - } - } - if([[tabViewItem identifier] respondsToSelector:@selector(content)]){ - if([[[tabViewItem identifier] content] respondsToSelector:@selector(isProcessing)]){ - [isProcessingButton setState:[[[tabViewItem identifier] content] isProcessing]]; - } - } - if([[tabViewItem identifier] respondsToSelector:@selector(content)]){ - if([[[tabViewItem identifier] content] respondsToSelector:@selector(iconName)]){ - NSString *newName = [[[tabViewItem identifier] content] iconName]; - if(newName){ - [iconButton selectItem:[[iconButton menu] itemWithTitle:newName]]; - } else { - [iconButton selectItem:[[iconButton menu] itemWithTitle:@"None"]]; - } - } - } -} - -- (BOOL)tabView:(NSTabView *)aTabView shouldCloseTabViewItem:(NSTabViewItem *)tabViewItem -{ - if([[tabViewItem label] isEqualToString:@"Drake"]){ - NSAlert *drakeAlert = [NSAlert alertWithMessageText:@"No Way!" defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"I refuse to close a tab named \"Drake\""]; - [drakeAlert beginSheetModalForWindow:[NSApp keyWindow] modalDelegate:nil didEndSelector:nil contextInfo:nil]; - return NO; - } - return YES; -} - -- (void)tabView:(NSTabView *)aTabView willCloseTabViewItem:(NSTabViewItem *)tabViewItem -{ - NSLog(@"willCloseTabViewItem: %@", [tabViewItem label]); -} - -- (void)tabView:(NSTabView *)aTabView didCloseTabViewItem:(NSTabViewItem *)tabViewItem -{ - NSLog(@"didCloseTabViewItem: %@", [tabViewItem label]); -} - -#pragma mark - -#pragma mark ---- toolbar ---- - -- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag -{ - NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; - - if([itemIdentifier isEqualToString:@"TabField"]){ - [item setPaletteLabel:@"Tab Label"]; - [item setLabel:@"Tab Label"]; - [item setView:tabField]; - [item setMinSize:NSMakeSize(100, [tabField frame].size.height)]; - [item setMaxSize:NSMakeSize(500, [tabField frame].size.height)]; - - } else if([itemIdentifier isEqualToString:@"DrawerItem"]){ - [item setPaletteLabel:@"Configuration"]; - [item setLabel:@"Configuration"]; - [item setToolTip:@"Configuration"]; - [item setImage:[NSImage imageNamed:@"32x32_log"]]; - [item setTarget:drawer]; - [item setAction:@selector(toggle:)]; - - } - - return [item autorelease]; -} - -- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar -{ - return [NSArray arrayWithObjects:@"TabField", - NSToolbarFlexibleSpaceItemIdentifier, - @"DrawerItem", - nil]; -} - -- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar -{ - return [NSArray arrayWithObjects:@"TabField", - NSToolbarFlexibleSpaceItemIdentifier, - @"DrawerItem", - nil]; -} - -- (IBAction)toggleToolbar:(id)sender -{ - [[[self window] toolbar] setVisible:![[[self window] toolbar] isVisible]]; -} - -- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem -{ - return YES; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/main.m b/src/MacVim/PSMTabBarControl/source/main.m deleted file mode 100644 index bcdabbe7b0..0000000000 --- a/src/MacVim/PSMTabBarControl/source/main.m +++ /dev/null @@ -1,14 +0,0 @@ -// -// main.m -// TabBarControl -// -// Created by John Pannell on 12/18/05. -// Copyright Positive Spin Media 2005. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) -{ - return NSApplicationMain(argc, (const char **) argv); -} diff --git a/src/MacVim/PSMTabBarControl/version.plist b/src/MacVim/PSMTabBarControl/version.plist deleted file mode 100644 index df8c3dc7d1..0000000000 --- a/src/MacVim/PSMTabBarControl/version.plist +++ /dev/null @@ -1,16 +0,0 @@ - - - - - BuildVersion - 92 - CFBundleVersion - 1.0 - ProductBuildVersion - 7K571 - ProjectName - NibPBTemplates - SourceVersion - 1200000 - - From 237f257f23afb5df75cd2e65e8b6fbdc137aaca4 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Fri, 24 Jan 2025 17:56:42 -0800 Subject: [PATCH 81/93] Always build dmg installer in CI Given that building a dmg is fast, just always build it instead of only doing so when doing a release. This allows a user to download fixes and new features quickly to test it out locally. Note that the dmg will be unsigned, however, and not officially blessed by the team. This is essentially a nightly build for the project. Add a sane upper limit to retention days for dev builds, just in case we end up making a lot of artifacts this way (since we are doing this per every commit to master now). Also, remove the previous "--skip-jenkins" hack we passed to create-dmg. It was necessary in previous runners due to permission issues but it seems like new GitHub Actions images have relaxed on that so the script runs without that flag now. This allows us to beautify the dmg image in CI. --- .github/workflows/ci-macvim.yaml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-macvim.yaml b/.github/workflows/ci-macvim.yaml index 422a824851..e445a46100 100644 --- a/.github/workflows/ci-macvim.yaml +++ b/.github/workflows/ci-macvim.yaml @@ -384,27 +384,35 @@ jobs: make ${MAKE_BUILD_ARGS} -C src/testdir clean make ${MAKE_BUILD_ARGS} -C src testgui - # Creates a DMG package of MacVim. Note that this doesn't create a GitHub release for us, because we would prefer to - # do it manually, for two reasons: 1) signing / notarization are currently done out of CI, 2) we want to manually - # format our release notes and add pictures to make them look nice. - name: Build MacVim dmg image - if: startsWith(github.ref, 'refs/tags/') && matrix.publish + if: matrix.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') run: | # Use the --skip-jenkins flag to skip the prettify osascript calls which could fail due to permission issues in # CI environment. if ${{ matrix.legacy == true }}; then - make -C src macvim-dmg-legacy CREATEDMG_FLAGS=--skip-jenkins + make -C src macvim-dmg-legacy else - make -C src macvim-dmg CREATEDMG_FLAGS=--skip-jenkins + make -C src macvim-dmg fi if ${{ matrix.publish_postfix != '' }}; then mv src/MacVim/build/Release/MacVim.dmg src/MacVim/build/Release/MacVim${{ matrix.publish_postfix }}.dmg fi + # Upload the dmg installer only when making tagged release or making a dev build from a master branch. + # Note that this doesn't create a GitHub release for us, because we would prefer to do it manually, for two + # reasons: 1) signing / notarization are currently done out of CI, 2) we want to manually format our release notes + # and add pictures to make them look nice. - name: Upload MacVim image - if: startsWith(github.ref, 'refs/tags/') && matrix.publish + if: matrix.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') uses: actions/upload-artifact@v4 with: name: MacVim${{ matrix.publish_postfix }}.dmg path: src/MacVim/build/Release/MacVim${{ matrix.publish_postfix }}.dmg + + # If doing a tagged release, use repository-specified number of retention days (usually 90 days) to make it + # easier to audit. (specify "0" to indicate using repository settings) + # + # Otherwise, we are just doing a dev build for potential testing, just use a maximum of 21 days as we don't + # tend to need these for long. + retention-days: ${{ startsWith(github.ref, 'refs/tags/') && 0 || (github.retention_days > 21 && 21 || 0) }} From c8ff0ff505d9acec4d0aa76a22e97d3b7a801019 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Sat, 25 Jan 2025 00:34:01 -0800 Subject: [PATCH 82/93] ci: Don't run both non-GUI/GUI Vim tests most of the time Only run the full suite of Vim tests when doing a tagged release. Otherwise just either run GUI or non-GUI test on each platform. This should catch most regressions in Vim upstream functionality, as even a bad upstream merge should still exhibit the same issue in one of the other (and most MacVim pull requests do not touch Vim to begin with). This helps speeds up CI as currently it's quite time consuming to run Vim tests twice. We still run the whole thing for a release for now just to catch any potential issues. --- .github/workflows/ci-macvim.yaml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-macvim.yaml b/.github/workflows/ci-macvim.yaml index e445a46100..bc0ce94600 100644 --- a/.github/workflows/ci-macvim.yaml +++ b/.github/workflows/ci-macvim.yaml @@ -68,16 +68,19 @@ jobs: - os: macos-13 xcode: '15.2' + testgui: true extra: [vimtags, check-xcodeproj-compat] # Below runners use Apple Silicon. - os: macos-14 xcode: '15.4' + testgui: false optimized: true # Most up to date OS and Xcode. Used to publish release for the main build. - os: macos-15 xcode: '16.2' + testgui: true publish: true optimized: true @@ -351,12 +354,13 @@ jobs: fi - name: Test MacVim + id: test_macvim timeout-minutes: 10 run: | make ${MAKE_BUILD_ARGS} -C src macvim-tests - name: Upload failed MacVim test results - if: ${{ !cancelled() && failure() }} + if: ${{ !cancelled() && failure() && steps.test_macvim.conclusion == 'failure' }} uses: ./.github/actions/test_macvim_artifacts - name: Build Vim test binaries @@ -370,20 +374,24 @@ jobs: make ${MAKE_BUILD_ARGS} -j${NPROC} -C src unittesttargets - name: Test Vim + if: startsWith(github.ref, 'refs/tags/') || !matrix.testgui timeout-minutes: 25 - run: make ${MAKE_BUILD_ARGS} test - - - name: Upload failed test files - if: ${{ !cancelled() && failure() }} - uses: ./.github/actions/test_artifacts + run: | + defaults delete org.vim.MacVim # Clean up stale states + make ${MAKE_BUILD_ARGS} test - name: Test Vim (GUI) + if: startsWith(github.ref, 'refs/tags/') || matrix.testgui timeout-minutes: 25 run: | - defaults delete org.vim.MacVim # Clean up stale states left from MacVim tests + defaults delete org.vim.MacVim # Clean up stale states make ${MAKE_BUILD_ARGS} -C src/testdir clean make ${MAKE_BUILD_ARGS} -C src testgui + - name: Upload failed test files + if: ${{ !cancelled() && failure() }} + uses: ./.github/actions/test_artifacts + - name: Build MacVim dmg image if: matrix.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') run: | From 7fbb4453005c3e316a98d04e7e02348a5ff12eb4 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Mon, 27 Jan 2025 04:16:02 -0800 Subject: [PATCH 83/93] Make GUI tabs track Vim tabs in updates and animate correctly MMTabline was introduced in #1120, which replaced the ancient PSMTabBarControl for representing Vim tabs. It uses animation to handle tab layouts, but it only worked in some situations, due to the Vim IPC API only sending a tabline update with all the tab labels with no way to track individual tabs. Update the API so that Vim now sends individual unique IDs in the update message as well to allow the GUI to track tabs over time and animate them. Vim does not interally have a concept of unique tab IDs, but we can use the pointer to the structure as such because they are allocated as a linked list and will never change. Extend MMTabline to have a new `updateTabsByTags` API to batch update all tabs in one go, which will diff the new tags with existing tabs and create/remove/move tabs as necessary. The scrolling logic has also been moved inside it and it now only scrolls to selected tab when it has changed or moved. When deleting tabs we won't scroll as usually the user doesn't expect it. Dragging tabs also now work correctly when it is removed during a drag, or another tab has been selected. This does mean the add/close tab APIs are currently unused, as the only entrypoint for modifying tabs from MacVim is currently only via `updateTabsByTags`. After this, different Vim operations will now animate correctly, including `:tabmove`, `:bdelete` (which could remove multiple tabs at once), `:tabnew`, `:tabclose`. --- src/MacVim/MMBackend.m | 36 +++--- src/MacVim/MMTabline/MMTab.h | 1 + src/MacVim/MMTabline/MMTab.m | 2 + src/MacVim/MMTabline/MMTabline.h | 24 +++- src/MacVim/MMTabline/MMTabline.m | 208 +++++++++++++++++++++++++++---- src/MacVim/MMVimView.h | 5 +- src/MacVim/MMVimView.m | 157 ++++++++++------------- src/MacVim/MMWindowController.h | 1 - src/MacVim/MMWindowController.m | 8 -- 9 files changed, 293 insertions(+), 149 deletions(-) diff --git a/src/MacVim/MMBackend.m b/src/MacVim/MMBackend.m index 569d4c7c98..9f38769967 100644 --- a/src/MacVim/MMBackend.m +++ b/src/MacVim/MMBackend.m @@ -764,32 +764,36 @@ - (void)selectTab:(int)index - (void)updateTabBar { + // Update the tab bar with the most up-to-date info, including number of + // tabs and titles/tooltips. MacVim would also like to know which specific + // tabs were moved/added/deleted in order for animation to work, but Vim + // does not have specific callbacks to listen to that. Instead, since the + // tabpage_T memory address is constant per tab, we use that as a permanent + // identifier for each GUI tab so MacVim can do the association. NSMutableData *data = [NSMutableData data]; + // 1. Current selected tab index int idx = tabpage_index(curtab) - 1; [data appendBytes:&idx length:sizeof(int)]; tabpage_T *tp; + // 2. Unique id for all the tabs + // Do these first so they appear as a consecutive memory block. for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) { - // Count the number of windows in the tabpage. - //win_T *wp = tp->tp_firstwin; - //int wincount; - //for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount); - //[data appendBytes:&wincount length:sizeof(int)]; - - int tabProp = MMTabInfoCount; - [data appendBytes:&tabProp length:sizeof(int)]; - for (tabProp = MMTabLabel; tabProp < MMTabInfoCount; ++tabProp) { + [data appendBytes:&tp length:sizeof(void*)]; + } + // Null terminate the unique IDs. + tp = 0; + [data appendBytes:&tp length:sizeof(void*)]; + // 3. Labels and tooltips of each tab + for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) { + for (int tabProp = MMTabLabel; tabProp < MMTabInfoCount; ++tabProp) { // This function puts the label of the tab in the global 'NameBuff'. get_tabline_label(tp, (tabProp == MMTabToolTip)); - NSString *s = [NSString stringWithVimString:NameBuff]; - int len = [s lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; - if (len < 0) - len = 0; - - [data appendBytes:&len length:sizeof(int)]; + size_t len = STRLEN(NameBuff); + [data appendBytes:&len length:sizeof(size_t)]; if (len > 0) - [data appendBytes:[s UTF8String] length:len]; + [data appendBytes:NameBuff length:len]; } } diff --git a/src/MacVim/MMTabline/MMTab.h b/src/MacVim/MMTabline/MMTab.h index 2bd05037d2..8a6c198a83 100644 --- a/src/MacVim/MMTabline/MMTab.h +++ b/src/MacVim/MMTabline/MMTab.h @@ -14,6 +14,7 @@ typedef enum : NSInteger { @interface MMTab : NSView +@property (nonatomic, readwrite) NSInteger tag; ///< Unique identifier that caller can set for the tab @property (nonatomic, copy) NSString *title; @property (nonatomic, getter=isCloseButtonHidden) BOOL closeButtonHidden; @property (nonatomic) MMTabState state; diff --git a/src/MacVim/MMTabline/MMTab.m b/src/MacVim/MMTabline/MMTab.m index e69b1335f2..5b3fe16ce4 100644 --- a/src/MacVim/MMTabline/MMTab.m +++ b/src/MacVim/MMTabline/MMTab.m @@ -20,6 +20,8 @@ @implementation MMTab NSTextField *_titleLabel; } +@synthesize tag = _tag; + + (id)defaultAnimationForKey:(NSAnimatablePropertyKey)key { if ([key isEqualToString:@"fillColor"]) { diff --git a/src/MacVim/MMTabline/MMTabline.h b/src/MacVim/MMTabline/MMTabline.h index 18c7dca70e..462619d2f0 100644 --- a/src/MacVim/MMTabline/MMTabline.h +++ b/src/MacVim/MMTabline/MMTabline.h @@ -10,7 +10,8 @@ @interface MMTabline : NSView -@property (nonatomic) NSInteger selectedTabIndex; +/// The index of the selected tab. Can be -1 if nothing is selected. +@property (nonatomic, readonly) NSInteger selectedTabIndex; @property (nonatomic) NSInteger optimumTabWidth; @property (nonatomic) NSInteger minimumTabWidth; @property (nonatomic) BOOL showsAddTabButton; @@ -24,10 +25,31 @@ @property (nonatomic, retain) NSColor *tablineFillFgColor; @property (nonatomic, weak) id delegate; +/// Add a tab at the end. It's not selected automatically. - (NSInteger)addTabAtEnd; +/// Add a tab after the selected one. It's not selected automatically. - (NSInteger)addTabAfterSelectedTab; +/// Add a tab at specified index. It's not selected automatically. - (NSInteger)addTabAtIndex:(NSInteger)index; + - (void)closeTab:(MMTab *)tab force:(BOOL)force layoutImmediately:(BOOL)layoutImmediately; + +/// Batch update all the tabs using tab tags as unique IDs. Tab line will handle +/// creating / removing tabs as necessary, and moving tabs to their new +/// positions. +/// +/// The tags array has to have unique items only, and each existing MMTab also +/// has to have unique tags. +/// +/// @param tags The list of unique tags that are cross-referenced with each +/// MMTab's tag. Order within the array indicates the desired tab order. +/// @param len The length of the tags array. +/// @param delayTabResize If true, do not resize tab widths until the the tab +/// line loses focus. This helps preserve the relative tab positions and +/// lines up the close buttons to the previous tab. This will also +/// prevent scrolling to the new selected tab. +- (void)updateTabsByTags:(NSInteger *)tags len:(NSUInteger)len delayTabResize:(BOOL)delayTabResize; + - (void)selectTabAtIndex:(NSInteger)index; - (MMTab *)tabAtIndex:(NSInteger)index; - (void)scrollTabToVisibleAtIndex:(NSInteger)index; diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m index 5d0d04c7ba..6f58ccbbfd 100644 --- a/src/MacVim/MMTabline/MMTabline.m +++ b/src/MacVim/MMTabline/MMTabline.m @@ -39,7 +39,6 @@ @implementation MMTabline NSLayoutConstraint *_tabScrollButtonsLeadingConstraint; NSLayoutConstraint *_addTabButtonTrailingConstraint; BOOL _pendingFixupLayout; - MMTab *_selectedTab; MMTab *_draggedTab; CGFloat _xOffsetForDrag; NSInteger _initialDraggedTabIndex; @@ -64,7 +63,11 @@ - (instancetype)initWithFrame:(NSRect)frameRect _tabs = [NSMutableArray new]; _showsAddTabButton = YES; // get from NSUserDefaults _showsTabScrollButtons = YES; // get from NSUserDefaults - + + _selectedTabIndex = -1; + + _initialDraggedTabIndex = _finalDraggedTabIndex = NSNotFound; + // This view holds the tab views. _tabsContainer = [NSView new]; _tabsContainer.frame = (NSRect){{0, 0}, frameRect.size}; @@ -269,7 +272,7 @@ - (NSInteger)addTabAtIndex:(NSInteger)index TabWidth t = [self tabWidthForTabs:_tabs.count + 1]; NSRect frame = _tabsContainer.bounds; frame.size.width = index == _tabs.count ? t.width + t.remainder : t.width; - frame.origin.x = index ? index * (t.width - TabOverlap) : 0; + frame.origin.x = index * (t.width - TabOverlap); MMTab *newTab = [[MMTab alloc] initWithFrame:frame tabline:self]; [_tabs insertObject:newTab atIndex:index]; @@ -292,14 +295,7 @@ - (void)closeTab:(MMTab *)tab force:(BOOL)force layoutImmediately:(BOOL)layoutIm if (![self.delegate tabline:self shouldCloseTabAtIndex:index]) return; } if (index != NSNotFound) { - CGFloat w = NSWidth(tab.frame) - TabOverlap; [tab removeFromSuperview]; - for (NSInteger i = index + 1; i < _tabs.count; i++) { - MMTab *tv = _tabs[i]; - NSRect frame = tv.frame; - frame.origin.x -= w; - tv.animator.frame = frame; - } [_tabs removeObject:tab]; if (index <= _selectedTabIndex) { if (index < _selectedTabIndex || index > _tabs.count - 1) { @@ -311,26 +307,161 @@ - (void)closeTab:(MMTab *)tab force:(BOOL)force layoutImmediately:(BOOL)layoutIm } [self fixupCloseButtons]; [self evaluateHoverStateForMouse:[self.window mouseLocationOutsideOfEventStream]]; - if (layoutImmediately) [self fixupLayoutWithAnimation:YES]; - else _pendingFixupLayout = YES; + [self fixupLayoutWithAnimation:YES delayResize:!layoutImmediately]; } else { NSLog(@"CANNOT FIND TAB TO REMOVE"); } } +- (void)updateTabsByTags:(NSInteger *)tags len:(NSUInteger)len delayTabResize:(BOOL)delayTabResize +{ + BOOL needUpdate = NO; + if (len != _tabs.count) { + needUpdate = YES; + } else { + for (NSUInteger i = 0; i < len; i++) { + MMTab *tab = _tabs[i]; + if (tab.tag != tags[i]) { + needUpdate = YES; + break; + } + } + } + if (!needUpdate) + return; + + // Perform a diff between the existing tabs (using MMTab's tags as unique + // identifiers) and the input specified tags + + // Create a mapping for tags->index. Could potentially cache this but it's + // simpler to recreate this every time to avoid tracking states. + NSMutableDictionary *tagToTabIdx = [NSMutableDictionary dictionaryWithCapacity:_tabs.count]; + for (NSUInteger i = 0; i < _tabs.count; i++) { + MMTab *tab = _tabs[i]; + if (tagToTabIdx[@(tab.tag)] != nil) { + NSLog(@"Duplicate tag found in tabs"); + // Duplicates are not supposed to exist. We need to remove the view + // here because the algorithm below will not handle this case and + // leaves stale views. + [tab removeFromSuperview]; + continue; + } + tagToTabIdx[@(tab.tag)] = @(i); + } + + const NSInteger oldSelectedTabTag = _selectedTabIndex < 0 ? 0 : _tabs[_selectedTabIndex].tag; + NSInteger newSelectedTabIndex = -1; + + // Allocate a new tabs list and store all the new and moved tabs there. This + // is simpler than an in-place algorithm. + NSMutableArray *newTabs = [NSMutableArray arrayWithCapacity:len]; + for (NSUInteger i = 0; i < len; i++) { + NSInteger tag = tags[i]; + NSNumber *newTabIdxObj = [tagToTabIdx objectForKey:@(tag)]; + if (newTabIdxObj == nil) { + // Create new tab + TabWidth t = [self tabWidthForTabs:len]; + NSRect frame = _tabsContainer.bounds; + frame.size.width = i == (len - 1) ? t.width + t.remainder : t.width; + frame.origin.x = i * (t.width - TabOverlap); + MMTab *newTab = [[MMTab alloc] initWithFrame:frame tabline:self]; + newTab.tag = tag; + [newTabs addObject:newTab]; + [_tabsContainer addSubview:newTab]; + } else { + // Move existing tab + NSUInteger newTabIdx = [newTabIdxObj unsignedIntegerValue]; + [newTabs addObject:_tabs[newTabIdx]]; + [tagToTabIdx removeObjectForKey:@(tag)]; + + // Remap indices if needed + if (newTabIdx == _selectedTabIndex) { + newSelectedTabIndex = newTabs.count - 1; + } + if (newTabIdx == _initialDraggedTabIndex) { + _initialDraggedTabIndex = newTabs.count - 1; + _finalDraggedTabIndex = _initialDraggedTabIndex; + } + } + } + + // Now go through the remaining tabs that did not make it to the new list + // and remove them. + NSInteger numDeletedTabsBeforeSelected = 0; + for (NSUInteger i = 0; i < _tabs.count; i++) { + MMTab *tab = _tabs[i]; + if ([tagToTabIdx objectForKey:@(tab.tag)] == nil) { + continue; + } + [tab removeFromSuperview]; + if (i < _selectedTabIndex) { + numDeletedTabsBeforeSelected++; + } + if (_draggedTab != nil && _draggedTab == tab) { + _draggedTab = nil; + _initialDraggedTabIndex = _finalDraggedTabIndex = NSNotFound; + } + } + const BOOL selectedTabMovedByDeleteOnly = newSelectedTabIndex != -1 && + (newSelectedTabIndex == _selectedTabIndex - numDeletedTabsBeforeSelected); + + _tabs = newTabs; + + if (newSelectedTabIndex == -1) { + // The old selected tab is removed. Select a new one nearby. + newSelectedTabIndex = _selectedTabIndex >= _tabs.count ? _tabs.count - 1 : _selectedTabIndex; + } + [self selectTabAtIndex:newSelectedTabIndex]; + + [self fixupLayoutWithAnimation:YES delayResize:delayTabResize]; + [self fixupCloseButtons]; + [self evaluateHoverStateForMouse:[self.window mouseLocationOutsideOfEventStream]]; + + // Heuristics for scrolling to the selected tab after update: + // 1. If 'delayTabResize' is set, we are trying to line up tab positions, do + // DON'T scroll, even if the old selected tab was removed. + // 2. Otherwise if we changed tab selection (happens when the selected tab + // was removed), just scroll to the new selected tab. + // 3. If the selected tab has moved in position, scroll to it, unless it + // only moved due to the earlier tabs being deleted (meaning that the tab + // ordering was preserved). This helps prevent unnecessary scrolling + // around when the user is trying to delete tabs in other areas. + // This chould potentially be exposed to the caller for more custimization. + const NSInteger newSelectedTabTag = _selectedTabIndex < 0 ? 0 : _tabs[_selectedTabIndex].tag; + BOOL scrollToSelected = NO; + if (!delayTabResize) { + if (oldSelectedTabTag != newSelectedTabTag) + scrollToSelected = YES; + else if (!selectedTabMovedByDeleteOnly) + scrollToSelected = YES; + } + if (scrollToSelected) + [self scrollTabToVisibleAtIndex:_selectedTabIndex]; +} + - (void)selectTabAtIndex:(NSInteger)index { - if (_selectedTabIndex <= _tabs.count - 1) { + if (_draggedTab != nil) { + // Selected a non-dragged tab, simply unset the dragging operation. This + // is somewhat Vim-specific, as it does not support re-ordering a + // non-active tab. Could be made configurable in the future. + if (index < 0 || index >= _tabs.count || _tabs[index] != _draggedTab) { + _draggedTab = nil; + _initialDraggedTabIndex = _finalDraggedTabIndex = NSNotFound; + [self fixupLayoutWithAnimation:YES]; + } + } + if (_selectedTabIndex >= 0 && _selectedTabIndex <= _tabs.count - 1) { _tabs[_selectedTabIndex].state = MMTabStateUnselected; } if (index <= _tabs.count - 1) { _selectedTabIndex = index; - _tabs[_selectedTabIndex].state = MMTabStateSelected; + if (index >= 0) + _tabs[_selectedTabIndex].state = MMTabStateSelected; } else { NSLog(@"TRIED TO SELECT OUT OF BOUNDS: %ld/%ld", index, _tabs.count - 1); } - _selectedTab = _tabs[_selectedTabIndex]; [self fixupTabZOrder]; } @@ -429,17 +560,30 @@ - (void)fixupTabZOrder [_tabsContainer sortSubviewsUsingFunction:SortTabsForZOrder context:(__bridge void *)(_draggedTab)]; } -- (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate +- (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate delayResize:(BOOL)delayResize { if (_tabs.count == 0) return; + if (delayResize) { + // The pending delayed resize is trigged by mouse exit, but if we are + // already outside, then there's nothing to delay. + NSPoint locationInWindow = [self.window mouseLocationOutsideOfEventStream]; + if (![self mouse:locationInWindow inRect:self.frame]) { + delayResize = NO; + } + } + TabWidth t = [self tabWidthForTabs:_tabs.count]; for (NSInteger i = 0; i < _tabs.count; i++) { MMTab *tab = _tabs[i]; if (_draggedTab == tab) continue; NSRect frame = tab.frame; - frame.size.width = i == _tabs.count - 1 ? t.width + t.remainder : t.width; - frame.origin.x = i ? i * (t.width - TabOverlap) : 0; + if (delayResize) { + frame.origin.x = i != 0 ? i * (NSWidth(_tabs[i-1].frame) - TabOverlap) : 0; + } else { + frame.size.width = i == _tabs.count - 1 ? t.width + t.remainder : t.width; + frame.origin.x = i != 0 ? i * (t.width - TabOverlap) : 0; + } if (shouldAnimate) { [NSAnimationContext runAnimationGroup:^(NSAnimationContext * _Nonnull context) { context.allowsImplicitAnimation = YES; @@ -450,13 +594,22 @@ - (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate tab.frame = frame; } } - // _tabsContainer expands to fit tabs, is at least as wide as _scrollView. - NSRect frame = _tabsContainer.frame; - frame.size.width = t.width * _tabs.count - TabOverlap * (_tabs.count - 1); - frame.size.width = NSWidth(frame) < NSWidth(_scrollView.frame) ? NSWidth(_scrollView.frame) : NSWidth(frame); - if (shouldAnimate) _tabsContainer.animator.frame = frame; - else _tabsContainer.frame = frame; - [self updateTabScrollButtonsEnabledState]; + if (delayResize) { + _pendingFixupLayout = YES; + } else { + // _tabsContainer expands to fit tabs, is at least as wide as _scrollView. + NSRect frame = _tabsContainer.frame; + frame.size.width = t.width * _tabs.count - TabOverlap * (_tabs.count - 1); + frame.size.width = NSWidth(frame) < NSWidth(_scrollView.frame) ? NSWidth(_scrollView.frame) : NSWidth(frame); + if (shouldAnimate) _tabsContainer.animator.frame = frame; + else _tabsContainer.frame = frame; + [self updateTabScrollButtonsEnabledState]; + } +} + +- (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate +{ + [self fixupLayoutWithAnimation:shouldAnimate delayResize:NO]; } #pragma mark - Mouse @@ -556,6 +709,7 @@ - (void)mouseUp:(NSEvent *)event [self.delegate tabline:self didDragTab:_tabs[_finalDraggedTabIndex] toIndex:_finalDraggedTabIndex]; } } + _initialDraggedTabIndex = _finalDraggedTabIndex = NSNotFound; } - (void)mouseDragged:(NSEvent *)event @@ -569,12 +723,13 @@ - (void)mouseDragged:(NSEvent *)event [_tabsContainer autoscroll:event]; [self fixupTabZOrder]; [_draggedTab setFrameOrigin:NSMakePoint(mouse.x - _xOffsetForDrag, 0)]; + MMTab *selectedTab = _selectedTabIndex == -1 ? nil : _tabs[_selectedTabIndex]; [_tabs sortWithOptions:NSSortStable usingComparator:^NSComparisonResult(MMTab *t1, MMTab *t2) { if (NSMinX(t1.frame) <= NSMinX(t2.frame)) return NSOrderedAscending; if (NSMinX(t1.frame) > NSMinX(t2.frame)) return NSOrderedDescending; return NSOrderedSame; }]; - _selectedTabIndex = [_tabs indexOfObject:_selectedTab]; + _selectedTabIndex = _selectedTabIndex == -1 ? -1 : [_tabs indexOfObject:selectedTab]; _finalDraggedTabIndex = [_tabs indexOfObject:_draggedTab]; [self fixupLayoutWithAnimation:YES]; } @@ -604,6 +759,7 @@ - (void)updateTabScrollButtonsEnabledState - (void)scrollTabToVisibleAtIndex:(NSInteger)index { if (_tabs.count == 0) return; + if (index < 0 || index >= _tabs.count) return; // Get the amount of time elapsed between the previous invocation // of this method and now. Use this elapsed time to set the animation diff --git a/src/MacVim/MMVimView.h b/src/MacVim/MMVimView.h index eac3d4da39..8f7da31a2a 100644 --- a/src/MacVim/MMVimView.h +++ b/src/MacVim/MMVimView.h @@ -20,8 +20,9 @@ @interface MMVimView : NSView { + /// The tab that has been requested to be closed and waiting on Vim to respond + NSInteger pendingCloseTabID; MMTabline *tabline; - MMTab *tabToClose; MMVimController *vimController; MMTextView *textView; NSMutableArray *scrollbars; @@ -44,8 +45,6 @@ - (MMTabline *)tabline; - (IBAction)addNewTab:(id)sender; - (void)updateTabsWithData:(NSData *)data; -- (void)selectTabWithIndex:(int)idx; -- (MMTab *)addNewTab; - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type; - (BOOL)destroyScrollbarWithIdentifier:(int32_t)ident; diff --git a/src/MacVim/MMVimView.m b/src/MacVim/MMVimView.m index 2a88fa9616..35a55cbb30 100644 --- a/src/MacVim/MMVimView.m +++ b/src/MacVim/MMVimView.m @@ -254,118 +254,82 @@ - (IBAction)addNewTab:(id)sender [vimController sendMessage:AddNewTabMsgID data:nil]; } +/// Callback from Vim to update the tabline with new tab data - (void)updateTabsWithData:(NSData *)data { const void *p = [data bytes]; - const void *end = p + [data length]; - int tabIdx = 0; - BOOL didCloseTab = NO; - - // Count how many tabs Vim has and compare to the number MacVim's tabline has. - const void *q = [data bytes]; - int vimNumberOfTabs = 0; - q += sizeof(int); // skip over current tab index - while (q < end) { - int infoCount = *((int*)q); q += sizeof(int); - for (unsigned i = 0; i < infoCount; ++i) { - int length = *((int*)q); q += sizeof(int); - if (length <= 0) continue; - q += length; - if (i == MMTabLabel) ++vimNumberOfTabs; - } - } - // Close the specific tab where the user clicked the close button. - if (tabToClose && vimNumberOfTabs == tabline.numberOfTabs - 1) { - [tabline closeTab:tabToClose force:YES layoutImmediately:NO]; - tabToClose = nil; - didCloseTab = YES; - } + const void * const end = p + [data length]; - // HACK! Current tab is first in the message. This way it is not - // necessary to guess which tab should be the selected one (this can be - // problematic for instance when new tabs are created). + // 1. Current tab is first in the message. int curtabIdx = *((int*)p); p += sizeof(int); + // 2. Read all the tab IDs (which uniquely identify each tab), and count + // the number of Vim tabs in the process of doing so. + int numTabs = 0; + BOOL pendingCloseTabClosed = (pendingCloseTabID != 0); + const intptr_t * const tabIDs = p; while (p < end) { - MMTab *tv; + intptr_t tabID = *((intptr_t*)p); p += sizeof(intptr_t); + if (tabID == 0) // null-terminated + break; + if (pendingCloseTabID != 0 && (NSInteger)tabID == pendingCloseTabID) { + // Vim hasn't gotten around to handling the tab close message yet, + // just wait until it has done so. + pendingCloseTabClosed = NO; + } + numTabs += 1; + } - //int wincount = *((int*)p); p += sizeof(int); - int infoCount = *((int*)p); p += sizeof(int); - unsigned i; - for (i = 0; i < infoCount; ++i) { - int length = *((int*)p); p += sizeof(int); + BOOL delayTabResize = NO; + if (pendingCloseTabClosed) { + // When the user has pressed a tab close button, only animate tab + // positions, not the widths. This allows the next tab's close button + // to line up with the last, allowing the user to close multiple tabs + // quickly. + delayTabResize = YES; + pendingCloseTabID = 0; + } + + // Ask the tabline to update all the tabs based on the tab IDs + static_assert(sizeof(NSInteger) == sizeof(intptr_t), + "Tab tag size mismatch between Vim and MacVim"); + [tabline updateTabsByTags:(NSInteger*)tabIDs + len:numTabs + delayTabResize:delayTabResize]; + + // 3. Read all the tab labels/tooltips and assign to each tab + NSInteger tabIdx = 0; + while (p < end && tabIdx < tabline.numberOfTabs) { + MMTab *tv = [tabline tabAtIndex:tabIdx]; + for (unsigned i = 0; i < MMTabInfoCount; ++i) { + size_t length = *((size_t*)p); p += sizeof(size_t); if (length <= 0) continue; - NSString *val = [[NSString alloc] initWithBytes:(void*)p length:length encoding:NSUTF8StringEncoding]; p += length; - - switch (i) { - case MMTabLabel: - // Set the label of the tab, adding a new tab when needed. - tv = tabline.numberOfTabs <= tabIdx - ? [self addNewTab] - : [tabline tabAtIndex:tabIdx]; - tv.title = val; - ++tabIdx; - break; - case MMTabToolTip: - if (tv) tv.toolTip = val; - break; - default: - ASLogWarn(@"Unknown tab info for index: %d", i); + if (i == MMTabLabel) { + tv.title = val; + } else if (i == MMTabToolTip) { + tv.toolTip = val; } - [val release]; } + tabIdx += 1; } - // Remove unused tabs from the tabline. - long i, count = tabline.numberOfTabs; - for (i = count-1; i >= tabIdx; --i) { - MMTab *tv = [tabline tabAtIndex:i]; - [tabline closeTab:tv force:YES layoutImmediately:YES]; - } - - [self selectTabWithIndex:curtabIdx]; - // It would be better if we could scroll to the selected tab only if it - // reflected user intent. Presumably, the user expects MacVim to scroll - // to the selected tab if they: added a tab, clicked a partially hidden - // tab, or navigated to a tab with a keyboard command. Since we don't - // have this kind of information, we always scroll to selected unless - // the window isn't key or we think the user is in the process of - // closing a tab by clicking its close button. Doing it this way instead - // of using a signal of explicit user intent is probably too aggressive. - if (self.window.isKeyWindow && !tabToClose && !didCloseTab) { - [tabline scrollTabToVisibleAtIndex:curtabIdx]; - } -} - -- (void)selectTabWithIndex:(int)idx -{ - if (idx < 0 || idx >= tabline.numberOfTabs) { - ASLogWarn(@"No tab with index %d exists.", idx); + // Finally, select the currently selected tab + if (curtabIdx < 0 || curtabIdx >= tabline.numberOfTabs) { + ASLogWarn(@"No tab with index %d exists.", curtabIdx); return; } - // Do not try to select a tab if already selected. - if (idx != tabline.selectedTabIndex) { - [tabline selectTabAtIndex:idx]; - // We might need to change the scrollbars that are visible. - self.pendingPlaceScrollbars = YES; + if (curtabIdx != tabline.selectedTabIndex) { + [tabline selectTabAtIndex:curtabIdx]; + [tabline scrollTabToVisibleAtIndex:curtabIdx]; } } -- (MMTab *)addNewTab -{ - // NOTE! A newly created tab is not by selected by default; Vim decides - // which tab should be selected at all times. However, the AppKit will - // automatically select the first tab added to a tab view. - NSUInteger index = [tabline addTabAtEnd]; - return [tabline tabAtIndex:index]; -} - - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type { MMScroller *scroller = [[MMScroller alloc] initWithIdentifier:ident @@ -486,7 +450,7 @@ - (BOOL)tabline:(MMTabline *)tabline shouldSelectTabAtIndex:(NSUInteger)index { // Propagate the selection message to Vim. if (NSNotFound != index) { - int i = (int)index; // HACK! Never more than MAXINT tabs?! + int i = (int)index; NSData *data = [NSData dataWithBytes:&i length:sizeof(int)]; [vimController sendMessage:SelectTabMsgID data:data]; } @@ -497,14 +461,19 @@ - (BOOL)tabline:(MMTabline *)tabline shouldSelectTabAtIndex:(NSUInteger)index - (BOOL)tabline:(MMTabline *)tabline shouldCloseTabAtIndex:(NSUInteger)index { if (index >= 0 && index < tabline.numberOfTabs - 1) { - tabToClose = [tabline tabAtIndex:index]; + // If the user is closing any tab other than the last one, we remember + // the state so later on we don't resize the tabs in the layout + // animation to preserve the stability of tab positions to allow for + // quickly closing multiple tabs. This is similar to how macOS tabs + // work. + pendingCloseTabID = [tabline tabAtIndex:index].tag; } - // HACK! This method is only called when the user clicks the close button - // on the tab. Instead of letting the tab bar close the tab, we return NO - // and pass a message on to Vim to let it handle the closing. - int i = (int)index; // HACK! Never more than MAXINT tabs?! + // Propagate the close message to Vim + int i = (int)index; NSData *data = [NSData dataWithBytes:&i length:sizeof(int)]; [vimController sendMessage:CloseTabMsgID data:data]; + + // Let Vim decide whether to close the tab or not. return NO; } diff --git a/src/MacVim/MMWindowController.h b/src/MacVim/MMWindowController.h index 8d4605abe8..df932f0e98 100644 --- a/src/MacVim/MMWindowController.h +++ b/src/MacVim/MMWindowController.h @@ -65,7 +65,6 @@ - (BOOL)presentWindow:(id)unused; - (void)moveWindowAcrossScreens:(NSPoint)origin; - (void)updateTabsWithData:(NSData *)data; -- (void)selectTabWithIndex:(int)idx; - (void)setTextDimensionsWithRows:(int)rows columns:(int)cols isLive:(BOOL)live keepGUISize:(BOOL)keepGUISize keepOnScreen:(BOOL)onScreen; diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index e52896ee85..5ae435bf34 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -331,9 +331,6 @@ - (void)openWindow // TODO: Remove this method? Everything can probably be done in // presentWindow: but must carefully check dependencies on 'setupDone' // flag. - - [vimView addNewTab]; - setupDone = YES; } @@ -392,11 +389,6 @@ - (void)updateTabsWithData:(NSData *)data [vimView updateTabsWithData:data]; } -- (void)selectTabWithIndex:(int)idx -{ - [vimView selectTabWithIndex:idx]; -} - - (void)setTextDimensionsWithRows:(int)rows columns:(int)cols isLive:(BOOL)live keepGUISize:(BOOL)keepGUISize keepOnScreen:(BOOL)onScreen From 8406d28431f6c1b4a155f69a104315a52ea610e7 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Tue, 28 Jan 2025 21:36:58 -0800 Subject: [PATCH 84/93] MMTabline: expose scroll button settings and fix misc scroll issues Allows the user to set whether to show the tabs scroll buttons or not in the preference pane as this is likely going to be a relatively popular configuration. Also, add new `macaction`'s for scrolling to selected tab and scrolling backward/forward so the user doesn't have to use the mouse to scroll. Fix misc issues with scrolling to a tab. The existing implementation was animating both the bounds size and position which would cause issues if the user resizes the window while still scrolling. Make sure the animation only touches the position. Also, the scrolling logic were using the physical locations of the scroll bounds to determine scroll condition, which doesn't account for the fact that it could be in the middle of animation. This led to rapid clicking of the scroll buttons having some clicks being ignored. Instead, fix it to always use the animated destination. --- runtime/doc/gui_mac.txt | 7 +++-- src/MacVim/Actions.plist | 6 +++++ src/MacVim/Base.lproj/Preferences.xib | 37 +++++++++++++++++++++++---- src/MacVim/MMAppController.h | 1 + src/MacVim/MMAppController.m | 23 ++++++++--------- src/MacVim/MMPreferenceController.h | 1 + src/MacVim/MMPreferenceController.m | 5 ++++ src/MacVim/MMTabline/MMTabline.h | 2 ++ src/MacVim/MMTabline/MMTabline.m | 21 ++++++++------- src/MacVim/MMVimView.h | 5 ++++ src/MacVim/MMVimView.m | 31 ++++++++++++++++++++++ 11 files changed, 111 insertions(+), 28 deletions(-) diff --git a/runtime/doc/gui_mac.txt b/runtime/doc/gui_mac.txt index 68963f4bf1..fde60648e0 100644 --- a/runtime/doc/gui_mac.txt +++ b/runtime/doc/gui_mac.txt @@ -573,8 +573,11 @@ _cycleWindows: Select next window (similar to ) _cycleWindowsBackwards: Select previous window (similar to ) _removeWindowFromStageManagerSet Remove window from a Stage Manager Set. Same as the "Remove Window from Set" menu item. -joinAllStageManagerSets Window will float among all Stage Manager sets -unjoinAllStageManagerSets Window will only show up in its own set +joinAllStageManagerSets: Window will float among all Stage Manager sets +unjoinAllStageManagerSets: Window will only show up in its own set +scrollToCurrentTab: Scroll to the selected tab in the GUI tab bar +scrollBackwardOneTab: Scroll backward by one tab in the tab bar +scrollForwardOneTab: Scroll forward by one tab in the tab bar ============================================================================== 7. Toolbar *macvim-toolbar* diff --git a/src/MacVim/Actions.plist b/src/MacVim/Actions.plist index 99d32b8def..6e468c5ac9 100644 --- a/src/MacVim/Actions.plist +++ b/src/MacVim/Actions.plist @@ -8,6 +8,12 @@ addNewTab: + scrollToCurrentTab: + + scrollBackwardOneTab: + + scrollForwardOneTab: + arrangeInFront: clearRecentDocuments: diff --git a/src/MacVim/Base.lproj/Preferences.xib b/src/MacVim/Base.lproj/Preferences.xib index 0dbab227b2..1aa2e8057d 100644 --- a/src/MacVim/Base.lproj/Preferences.xib +++ b/src/MacVim/Base.lproj/Preferences.xib @@ -280,11 +280,11 @@ - + - + @@ -345,7 +345,7 @@ - + @@ -407,6 +407,33 @@ + + + + + + + + + + + + + + + + @@ -508,7 +535,7 @@ - + @@ -595,7 +622,7 @@ - + diff --git a/src/MacVim/MMAppController.h b/src/MacVim/MMAppController.h index e9f9631556..f97c028c76 100644 --- a/src/MacVim/MMAppController.h +++ b/src/MacVim/MMAppController.h @@ -84,6 +84,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args; - (void)refreshAllAppearances; +- (void)refreshAllTabProperties; - (void)refreshAllFonts; - (void)refreshAllResizeConstraints; - (void)refreshAllTextViews; diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index e1c1f4ffee..78df273f4d 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -1229,19 +1229,22 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args - (void)refreshAllAppearances { - const NSUInteger count = [vimControllers count]; - for (unsigned i = 0; i < count; ++i) { - MMVimController *vc = [vimControllers objectAtIndex:i]; + for (MMVimController *vc in vimControllers) { [vc.windowController refreshApperanceMode]; } } +- (void)refreshAllTabProperties +{ + for (MMVimController *vc in vimControllers) { + [vc.windowController.vimView refreshTabProperties]; + } +} + /// Refresh all Vim text views' fonts. - (void)refreshAllFonts { - const NSUInteger count = [vimControllers count]; - for (unsigned i = 0; i < count; ++i) { - MMVimController *vc = [vimControllers objectAtIndex:i]; + for (MMVimController *vc in vimControllers) { [vc.windowController refreshFonts]; } } @@ -1250,9 +1253,7 @@ - (void)refreshAllFonts /// and resize the windows to match the constraints. - (void)refreshAllResizeConstraints { - const NSUInteger count = [vimControllers count]; - for (unsigned i = 0; i < count; ++i) { - MMVimController *vc = [vimControllers objectAtIndex:i]; + for (MMVimController *vc in vimControllers) { [vc.windowController updateResizeConstraints:YES]; } } @@ -1261,9 +1262,7 @@ - (void)refreshAllResizeConstraints /// cmdline alignment properties to make sure they are pinned properly. - (void)refreshAllTextViews { - const NSUInteger count = [vimControllers count]; - for (unsigned i = 0; i < count; ++i) { - MMVimController *vc = [vimControllers objectAtIndex:i]; + for (MMVimController *vc in vimControllers) { [vc.windowController.vimView.textView updateCmdlineRow]; vc.windowController.vimView.textView.needsDisplay = YES; } diff --git a/src/MacVim/MMPreferenceController.h b/src/MacVim/MMPreferenceController.h index 3021e1be13..e705f4e3a2 100644 --- a/src/MacVim/MMPreferenceController.h +++ b/src/MacVim/MMPreferenceController.h @@ -39,5 +39,6 @@ // Appearance pane - (IBAction)fontPropertiesChanged:(id)sender; +- (IBAction)tabsPropertiesChanged:(id)sender; @end diff --git a/src/MacVim/MMPreferenceController.m b/src/MacVim/MMPreferenceController.m index a556626496..4a615da45b 100644 --- a/src/MacVim/MMPreferenceController.m +++ b/src/MacVim/MMPreferenceController.m @@ -167,6 +167,11 @@ - (IBAction)fontPropertiesChanged:(id)sender [[MMAppController sharedInstance] refreshAllFonts]; } +- (IBAction)tabsPropertiesChanged:(id)sender +{ + [[MMAppController sharedInstance] refreshAllTabProperties]; +} + - (IBAction)smoothResizeChanged:(id)sender { [[MMAppController sharedInstance] refreshAllResizeConstraints]; diff --git a/src/MacVim/MMTabline/MMTabline.h b/src/MacVim/MMTabline/MMTabline.h index 462619d2f0..02d813fdf6 100644 --- a/src/MacVim/MMTabline/MMTabline.h +++ b/src/MacVim/MMTabline/MMTabline.h @@ -53,6 +53,8 @@ - (void)selectTabAtIndex:(NSInteger)index; - (MMTab *)tabAtIndex:(NSInteger)index; - (void)scrollTabToVisibleAtIndex:(NSInteger)index; +- (void)scrollLeftOneTab; +- (void)scrollRightOneTab; - (void)setTablineSelBackground:(NSColor *)back foreground:(NSColor *)fore; @end diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m index 6f58ccbbfd..5ef0745ca1 100644 --- a/src/MacVim/MMTabline/MMTabline.m +++ b/src/MacVim/MMTabline/MMTabline.m @@ -8,9 +8,10 @@ CGFloat remainder; } TabWidth; -const CGFloat OptimumTabWidth = 200; +const CGFloat OptimumTabWidth = 220; const CGFloat MinimumTabWidth = 100; const CGFloat TabOverlap = 6; +const CGFloat ScrollOneTabAllowance = 0.25; // If we are showing 75+% of the tab, consider it to be fully shown when deciding whether to scroll to next tab. static MMHoverButton* MakeHoverButton(MMTabline *tabline, NSString *imageName, NSString *tooltip, SEL action, BOOL continuous) { MMHoverButton *button = [MMHoverButton new]; @@ -759,7 +760,7 @@ - (void)updateTabScrollButtonsEnabledState - (void)scrollTabToVisibleAtIndex:(NSInteger)index { if (_tabs.count == 0) return; - if (index < 0 || index >= _tabs.count) return; + index = index < 0 ? 0 : (index >= _tabs.count ? _tabs.count - 1 : index); // Get the amount of time elapsed between the previous invocation // of this method and now. Use this elapsed time to set the animation @@ -780,8 +781,8 @@ - (void)scrollTabToVisibleAtIndex:(NSInteger)index NSTimeInterval elapsedTime = 0.1; #endif - NSRect tabFrame = _tabs[index].frame; - NSRect clipBounds = _scrollView.contentView.bounds; + NSRect tabFrame = _tabs[index].animator.frame; + NSRect clipBounds =_scrollView.contentView.animator.bounds; // One side or the other of the selected tab is clipped. if (!NSContainsRect(clipBounds, tabFrame)) { if (NSMinX(tabFrame) > NSMinX(clipBounds)) { @@ -793,18 +794,19 @@ - (void)scrollTabToVisibleAtIndex:(NSInteger)index } [NSAnimationContext beginGrouping]; [NSAnimationContext.currentContext setDuration:elapsedTime < 0.2 ? 0.05 : 0.2]; - _scrollView.contentView.animator.bounds = clipBounds; + [_scrollView.contentView.animator setBoundsOrigin:clipBounds.origin]; [NSAnimationContext endGrouping]; } } - (void)scrollLeftOneTab { - NSRect clipBounds = _scrollView.contentView.bounds; + NSRect clipBounds = _scrollView.contentView.animator.bounds; for (NSInteger i = _tabs.count - 1; i >= 0; i--) { NSRect tabFrame = _tabs[i].frame; if (!NSContainsRect(clipBounds, tabFrame)) { - if (NSMinX(tabFrame) < NSMinX(clipBounds)) { + CGFloat allowance = i == 0 ? 0 : NSWidth(tabFrame) * ScrollOneTabAllowance; + if (NSMinX(tabFrame) + allowance < NSMinX(clipBounds)) { [self scrollTabToVisibleAtIndex:i]; break; } @@ -814,11 +816,12 @@ - (void)scrollLeftOneTab - (void)scrollRightOneTab { - NSRect clipBounds = _scrollView.contentView.bounds; + NSRect clipBounds = _scrollView.contentView.animator.bounds; for (NSInteger i = 0; i < _tabs.count; i++) { NSRect tabFrame = _tabs[i].frame; if (!NSContainsRect(clipBounds, tabFrame)) { - if (NSMaxX(tabFrame) > NSMaxX(clipBounds)) { + CGFloat allowance = i == _tabs.count - 1 ? 0 : NSWidth(tabFrame) * ScrollOneTabAllowance; + if (NSMaxX(tabFrame) - allowance > NSMaxX(clipBounds)) { [self scrollTabToVisibleAtIndex:i]; break; } diff --git a/src/MacVim/MMVimView.h b/src/MacVim/MMVimView.h index 8f7da31a2a..d29b75c63c 100644 --- a/src/MacVim/MMVimView.h +++ b/src/MacVim/MMVimView.h @@ -44,7 +44,12 @@ - (MMTabline *)tabline; - (IBAction)addNewTab:(id)sender; +- (IBAction)scrollToCurrentTab:(id)sender; +- (IBAction)scrollBackwardOneTab:(id)sender; +- (IBAction)scrollForwardOneTab:(id)sender; +- (void)showTabline:(BOOL)on; - (void)updateTabsWithData:(NSData *)data; +- (void)refreshTabProperties; - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type; - (BOOL)destroyScrollbarWithIdentifier:(int32_t)ident; diff --git a/src/MacVim/MMVimView.m b/src/MacVim/MMVimView.m index 35a55cbb30..15d7b57cbb 100644 --- a/src/MacVim/MMVimView.m +++ b/src/MacVim/MMVimView.m @@ -254,6 +254,31 @@ - (IBAction)addNewTab:(id)sender [vimController sendMessage:AddNewTabMsgID data:nil]; } +- (IBAction)scrollToCurrentTab:(id)sender +{ + [tabline scrollTabToVisibleAtIndex:tabline.selectedTabIndex]; +} + +- (IBAction)scrollBackwardOneTab:(id)sender +{ + [tabline scrollLeftOneTab]; +} + +- (IBAction)scrollForwardOneTab:(id)sender +{ + [tabline scrollRightOneTab]; +} + +- (void)showTabline:(BOOL)on +{ + [tabline setHidden:!on]; + if (!on) { + // When the tab is not shown we don't get tab updates from Vim. We just + // close all of them as otherwise we will be holding onto stale states. + [tabline closeAllTabs]; + } +} + /// Callback from Vim to update the tabline with new tab data - (void)updateTabsWithData:(NSData *)data { @@ -330,6 +355,12 @@ - (void)updateTabsWithData:(NSData *)data } } +- (void)refreshTabProperties +{ + NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; + tabline.showsTabScrollButtons = [ud boolForKey:MMShowTabScrollButtonsKey]; +} + - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type { MMScroller *scroller = [[MMScroller alloc] initWithIdentifier:ident From 558c2e936a4eaebb63ff49b339192b0626dbdcc1 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Tue, 28 Jan 2025 03:29:43 -0800 Subject: [PATCH 85/93] MMTabline: Use cached images for buttons, fix memory leaks and misc issues MMHoverButton was a bit inefficient in its image management. It always made a new template image which then had to be converted into two other images (image and alternateImage) for every button. Cache at least the template images with weak references so we don't have to keep generating new ones. For now, allow setImage: to create new images but they could be changed to also just use cached images as well. Also, fix memory leaks in the tabs codebase due to improper closure usage in blocks. They were subtly capturing the self pointer which led to the tab line and hover buttons never getting destroyed. Fix to make sure we never accidentally capture self and try to capture as little as possible. Another leak happens in the usage of the local event monitor that we use to intercept scroll wheel events. The API contract mandates that we remove the monitor which the code never does. Make sure we do that, and fix up the logic of the event interceptor to be more resilient and works better with third-party software (which could inject horizontal scroll events without holding down the Shift key). --- src/MacVim/MMTabline/MMHoverButton.h | 10 ++- src/MacVim/MMTabline/MMHoverButton.m | 67 ++++++++++++----- src/MacVim/MMTabline/MMTab.m | 2 +- src/MacVim/MMTabline/MMTabline.m | 105 ++++++++++++++++++++------- 4 files changed, 135 insertions(+), 49 deletions(-) diff --git a/src/MacVim/MMTabline/MMHoverButton.h b/src/MacVim/MMTabline/MMHoverButton.h index df3322b8a9..43351a9b73 100644 --- a/src/MacVim/MMTabline/MMHoverButton.h +++ b/src/MacVim/MMTabline/MMHoverButton.h @@ -6,6 +6,14 @@ @property (nonatomic, retain) NSColor *fgColor; -+ (NSImage *)imageNamed:(NSString *)name; +typedef enum : NSUInteger { + MMHoverButtonImageAddTab = 0, + MMHoverButtonImageCloseTab, + MMHoverButtonImageScrollLeft, + MMHoverButtonImageScrollRight, + MMHoverButtonImageCount +} MMHoverButtonImage; + ++ (NSImage *)imageFromType:(MMHoverButtonImage)imageType; @end diff --git a/src/MacVim/MMTabline/MMHoverButton.m b/src/MacVim/MMTabline/MMHoverButton.m index e51c4d8c30..0b9b076f85 100644 --- a/src/MacVim/MMTabline/MMHoverButton.m +++ b/src/MacVim/MMTabline/MMHoverButton.m @@ -6,41 +6,64 @@ @implementation MMHoverButton NSBox *_circle; } -+ (NSImage *)imageNamed:(NSString *)name ++ (NSImage *)imageFromType:(MMHoverButtonImage)imageType { - CGFloat size = [name isEqualToString:@"CloseTabButton"] ? 15 : 17; - return [NSImage imageWithSize:NSMakeSize(size, size) flipped:NO drawingHandler:^BOOL(NSRect dstRect) { - NSBezierPath *p = [NSBezierPath new]; - if ([name isEqualToString:@"AddTabButton"]) { + if (imageType >= MMHoverButtonImageCount) + return nil; + + CGFloat size = imageType == MMHoverButtonImageCloseTab ? 15 : 17; + + static __weak NSImage *imageCache[MMHoverButtonImageCount] = { nil }; + if (imageCache[imageType] != nil) + return imageCache[imageType]; + + BOOL (^drawFuncs[MMHoverButtonImageCount])(NSRect) = { + // AddTab + ^BOOL(NSRect dstRect) { + NSBezierPath *p = [NSBezierPath new]; [p moveToPoint:NSMakePoint( 8.5, 4.5)]; [p lineToPoint:NSMakePoint( 8.5, 12.5)]; [p moveToPoint:NSMakePoint( 4.5, 8.5)]; [p lineToPoint:NSMakePoint(12.5, 8.5)]; [p setLineWidth:1.2]; [p stroke]; - } - else if ([name isEqualToString:@"CloseTabButton"]) { + return YES; + }, + // CloseTab + ^BOOL(NSRect dstRect) { + NSBezierPath *p = [NSBezierPath new]; [p moveToPoint:NSMakePoint( 4.5, 4.5)]; [p lineToPoint:NSMakePoint(10.5, 10.5)]; [p moveToPoint:NSMakePoint( 4.5, 10.5)]; [p lineToPoint:NSMakePoint(10.5, 4.5)]; [p setLineWidth:1.2]; [p stroke]; - } - else if ([name isEqualToString:@"ScrollLeftButton"]) { + return YES; + }, + // ScrollLeft + ^BOOL(NSRect dstRect) { + NSBezierPath *p = [NSBezierPath new]; [p moveToPoint:NSMakePoint( 5.0, 8.5)]; [p lineToPoint:NSMakePoint(10.0, 4.5)]; [p lineToPoint:NSMakePoint(10.0, 12.5)]; [p fill]; - } - else if ([name isEqualToString:@"ScrollRightButton"]) { + return YES; + }, + // ScrollRight + ^BOOL(NSRect dstRect) { + NSBezierPath *p = [NSBezierPath new]; [p moveToPoint:NSMakePoint(12.0, 8.5)]; [p lineToPoint:NSMakePoint( 7.0, 4.5)]; [p lineToPoint:NSMakePoint( 7.0, 12.5)]; [p fill]; + return YES; } - return YES; - }]; + }; + NSImage *img = [NSImage imageWithSize:NSMakeSize(size, size) + flipped:NO + drawingHandler:drawFuncs[imageType]]; + imageCache[imageType] = img; + return img; } - (instancetype)initWithFrame:(NSRect)frameRect @@ -70,22 +93,28 @@ - (void)setFgColor:(NSColor *)color self.image = super.image; } -- (void)setImage:(NSImage *)image +- (void)setImage:(NSImage *)imageTemplate { - _circle.cornerRadius = image.size.width / 2.0; + _circle.cornerRadius = imageTemplate.size.width / 2.0; NSColor *fillColor = self.fgColor ?: NSColor.controlTextColor; - super.image = [NSImage imageWithSize:image.size flipped:NO drawingHandler:^BOOL(NSRect dstRect) { - [image drawInRect:dstRect]; + NSImage *image = [NSImage imageWithSize:imageTemplate.size + flipped:NO + drawingHandler:^BOOL(NSRect dstRect) { + [imageTemplate drawInRect:dstRect]; [fillColor set]; NSRectFillUsingOperation(dstRect, NSCompositingOperationSourceAtop); return YES; }]; - self.alternateImage = [NSImage imageWithSize:image.size flipped:NO drawingHandler:^BOOL(NSRect dstRect) { + NSImage *alternateImage = [NSImage imageWithSize:imageTemplate.size + flipped:NO + drawingHandler:^BOOL(NSRect dstRect) { [[fillColor colorWithAlphaComponent:0.2] set]; [[NSBezierPath bezierPathWithOvalInRect:dstRect] fill]; - [super.image drawInRect:dstRect]; + [image drawInRect:dstRect]; return YES; }]; + super.image = image; + self.alternateImage = alternateImage; } - (void)setEnabled:(BOOL)enabled diff --git a/src/MacVim/MMTabline/MMTab.m b/src/MacVim/MMTabline/MMTab.m index 5b3fe16ce4..1b6de407a9 100644 --- a/src/MacVim/MMTabline/MMTab.m +++ b/src/MacVim/MMTabline/MMTab.m @@ -39,7 +39,7 @@ - (instancetype)initWithFrame:(NSRect)frameRect tabline:(MMTabline *)tabline _tabline = tabline; _closeButton = [MMHoverButton new]; - _closeButton.image = [MMHoverButton imageNamed:@"CloseTabButton"]; + _closeButton.image = [MMHoverButton imageFromType:MMHoverButtonImageCloseTab]; _closeButton.target = self; _closeButton.action = @selector(closeTab:); _closeButton.translatesAutoresizingMaskIntoConstraints = NO; diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m index 5ef0745ca1..c5dd783011 100644 --- a/src/MacVim/MMTabline/MMTabline.m +++ b/src/MacVim/MMTabline/MMTabline.m @@ -13,9 +13,9 @@ const CGFloat TabOverlap = 6; const CGFloat ScrollOneTabAllowance = 0.25; // If we are showing 75+% of the tab, consider it to be fully shown when deciding whether to scroll to next tab. -static MMHoverButton* MakeHoverButton(MMTabline *tabline, NSString *imageName, NSString *tooltip, SEL action, BOOL continuous) { +static MMHoverButton* MakeHoverButton(MMTabline *tabline, MMHoverButtonImage imageType, NSString *tooltip, SEL action, BOOL continuous) { MMHoverButton *button = [MMHoverButton new]; - button.image = [MMHoverButton imageNamed:imageName]; + button.image = [MMHoverButton imageFromType:imageType]; button.translatesAutoresizingMaskIntoConstraints = NO; button.target = tabline; button.action = action; @@ -81,9 +81,9 @@ - (instancetype)initWithFrame:(NSRect)frameRect _scrollView.documentView = _tabsContainer; [self addSubview:_scrollView]; - _addTabButton = MakeHoverButton(self, @"AddTabButton", @"New Tab (⌘T)", @selector(addTabAtEnd), NO); - _leftScrollButton = MakeHoverButton(self, @"ScrollLeftButton", @"Scroll Tabs", @selector(scrollLeftOneTab), YES); - _rightScrollButton = MakeHoverButton(self, @"ScrollRightButton", @"Scroll Tabs", @selector(scrollRightOneTab), YES); + _addTabButton = MakeHoverButton(self, MMHoverButtonImageAddTab, @"New Tab (⌘T)", @selector(addTabAtEnd), NO); + _leftScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollLeft, @"Scroll Tabs", @selector(scrollLeftOneTab), YES); + _rightScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollRight, @"Scroll Tabs", @selector(scrollRightOneTab), YES); [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[_leftScrollButton][_rightScrollButton]-5-[_scrollView]-5-[_addTabButton]" options:NSLayoutFormatAlignAllCenterY metrics:nil views:NSDictionaryOfVariableBindings(_scrollView, _leftScrollButton, _rightScrollButton, _addTabButton)]]; [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_scrollView]|" options:0 metrics:nil views:@{@"_scrollView":_scrollView}]]; @@ -96,29 +96,8 @@ - (instancetype)initWithFrame:(NSRect)frameRect [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didScroll:) name:NSViewBoundsDidChangeNotification object:_scrollView.contentView]; - // Monitor for scroll wheel events so we can scroll the tabline - // horizontally without the user having to hold down SHIFT. - _scrollWheelEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskScrollWheel handler:^NSEvent * _Nullable(NSEvent * _Nonnull event) { - NSPoint location = [_scrollView convertPoint:event.locationInWindow fromView:nil]; - // We want events: - // where the mouse is over the _scrollView - // and where the user is not modifying it with the SHIFT key - // and initiated by the scroll wheel and not the trackpad - if ([_scrollView mouse:location inRect:_scrollView.bounds] - && !event.modifierFlags - && !event.hasPreciseScrollingDeltas) - { - // Create a new scroll wheel event based on the original, - // but set the new deltaX to the original's deltaY. - // stackoverflow.com/a/38991946/111418 - CGEventRef cgEvent = CGEventCreateCopy(event.CGEvent); - CGEventSetIntegerValueField(cgEvent, kCGScrollWheelEventDeltaAxis2, event.scrollingDeltaY); - NSEvent *newEvent = [NSEvent eventWithCGEvent:cgEvent]; - CFRelease(cgEvent); - return newEvent; - } - return event; - }]; + [self addScrollWheelMonitor]; + } return self; } @@ -141,6 +120,32 @@ - (void)viewDidChangeEffectiveAppearance for (MMTab *tab in _tabs) tab.state = tab.state; } +- (void)viewDidHide +{ + if (_scrollWheelEventMonitor != nil) { + [NSEvent removeMonitor:_scrollWheelEventMonitor]; + _scrollWheelEventMonitor = nil; + } + [super viewDidHide]; +} + +- (void)viewDidUnhide +{ + [self addScrollWheelMonitor]; + [super viewDidUnhide]; +} + +- (void)dealloc +{ + if (_scrollWheelEventMonitor != nil) { + [NSEvent removeMonitor:_scrollWheelEventMonitor]; + _scrollWheelEventMonitor = nil; + } + + // This is not necessary after macOS 10.11, but there's no harm in doing so + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + #pragma mark - Accessors - (NSInteger)numberOfTabs @@ -546,6 +551,50 @@ - (TabWidth)tabWidthForTabs:(NSInteger)numTabs return (TabWidth){tabWidth, availableWidthForTabs - tabWidth * numTabs}; } +/// Install a scroll wheel event monitor so that we can convert vertical scroll +/// wheel events to horizontal ones, so that the user doesn't have to hold down +/// SHIFT key while scrolling. +/// +/// Caller *has* to call `removeMonitor:` on `_scrollWheelEventMonitor` +/// afterwards. +- (void)addScrollWheelMonitor +{ + // We have to use a local event monitor because we are not allowed to + // override NSScrollView's scrollWheel: method. If we do so we will lose + // macOS responsive scrolling. See: + // https://developer.apple.com/library/archive/releasenotes/AppKit/RN-AppKitOlderNotes/index.html#10_9Scrolling + if (_scrollWheelEventMonitor != nil) + return; + __weak NSScrollView *scrollView_weak = _scrollView; + __weak __typeof__(self) self_weak = self; + _scrollWheelEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskScrollWheel handler:^NSEvent * _Nullable(NSEvent * _Nonnull event) { + // We want an event: + // - that actually belongs to this window + // - initiated by the scroll wheel and not the trackpad + // - is a vertical scroll event (if this is a horizontal scroll event + // either via holding SHIFT or third-party software we just let it + // through) + // - where the mouse is over the scroll view + if (event.window == self_weak.window + && !event.hasPreciseScrollingDeltas + && (event.scrollingDeltaX == 0 && event.scrollingDeltaY != 0) + && [scrollView_weak mouse:[scrollView_weak convertPoint:event.locationInWindow fromView:nil] + inRect:scrollView_weak.bounds]) + { + // Create a new scroll wheel event based on the original, + // but set the new deltaX to the original's deltaY. + // stackoverflow.com/a/38991946/111418 + CGEventRef cgEvent = CGEventCreateCopy(event.CGEvent); + CGEventSetIntegerValueField(cgEvent, kCGScrollWheelEventDeltaAxis1, 0); + CGEventSetIntegerValueField(cgEvent, kCGScrollWheelEventDeltaAxis2, event.scrollingDeltaY); + NSEvent *newEvent = [NSEvent eventWithCGEvent:cgEvent]; + CFRelease(cgEvent); + return newEvent; + } + return event; + }]; +} + - (void)fixupCloseButtons { if (_tabs.count == 1) { From 2745806351a9e9ef90d20311779ef700e053da9d Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Tue, 28 Jan 2025 03:23:02 -0800 Subject: [PATCH 86/93] MMTabline: Clear all tabs while showing / hiding tab line When the GUI tab line is hidden (either due to `set showtabline` or `set go-=e`), Vim stops sending update messages to the GUI. This means the tabs were stale and would never get cleared, and the moment we show the tabs we see a confusing animation when the tabs quicly try to rearrange to match Vim's state. To fix this, just make sure to clean up and remove all of them when we hide the tab line. --- src/MacVim/MMTabline/MMTabline.h | 1 + src/MacVim/MMTabline/MMTabline.m | 20 +++++++++++++++++++- src/MacVim/MMVimView.m | 2 ++ src/MacVim/MMWindowController.m | 2 +- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/MacVim/MMTabline/MMTabline.h b/src/MacVim/MMTabline/MMTabline.h index 02d813fdf6..347cc86c78 100644 --- a/src/MacVim/MMTabline/MMTabline.h +++ b/src/MacVim/MMTabline/MMTabline.h @@ -33,6 +33,7 @@ - (NSInteger)addTabAtIndex:(NSInteger)index; - (void)closeTab:(MMTab *)tab force:(BOOL)force layoutImmediately:(BOOL)layoutImmediately; +- (void)closeAllTabs; /// Batch update all the tabs using tab tags as unique IDs. Tab line will handle /// creating / removing tabs as necessary, and moving tabs to their new diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m index c5dd783011..ef45c58384 100644 --- a/src/MacVim/MMTabline/MMTabline.m +++ b/src/MacVim/MMTabline/MMTabline.m @@ -319,6 +319,18 @@ - (void)closeTab:(MMTab *)tab force:(BOOL)force layoutImmediately:(BOOL)layoutIm } } +- (void)closeAllTabs +{ + _selectedTabIndex = -1; + _draggedTab = nil; + _initialDraggedTabIndex = _finalDraggedTabIndex = NSNotFound; + for (MMTab *tab in _tabs) { + [tab removeFromSuperview]; + } + [_tabs removeAllObjects]; + [self fixupLayoutWithAnimation:NO]; +} + - (void)updateTabsByTags:(NSInteger *)tags len:(NSUInteger)len delayTabResize:(BOOL)delayTabResize { BOOL needUpdate = NO; @@ -612,7 +624,13 @@ - (void)fixupTabZOrder - (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate delayResize:(BOOL)delayResize { - if (_tabs.count == 0) return; + if (_tabs.count == 0) { + NSRect frame = _tabsContainer.frame; + frame.size.width = 0; + _tabsContainer.frame = frame; + [self updateTabScrollButtonsEnabledState]; + return; + } if (delayResize) { // The pending delayed resize is trigged by mouse exit, but if we are diff --git a/src/MacVim/MMVimView.m b/src/MacVim/MMVimView.m index 15d7b57cbb..dc1db6060a 100644 --- a/src/MacVim/MMVimView.m +++ b/src/MacVim/MMVimView.m @@ -251,6 +251,8 @@ - (void)setDesiredRows:(int)r columns:(int)c - (IBAction)addNewTab:(id)sender { + // Callback from the "Create a new tab button". We override this so we can + // send a message to Vim first and let it handle it before replying back. [vimController sendMessage:AddNewTabMsgID data:nil]; } diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 5ae435bf34..e062796052 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -868,7 +868,7 @@ - (void)processInputQueueDidFinish - (void)showTabline:(BOOL)on { - [[vimView tabline] setHidden:!on]; + [vimView showTabline:on]; [self updateTablineSeparator]; shouldMaximizeWindow = YES; } From 18f00e57e4efbb85706b389030ea85903b09c98f Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Wed, 29 Jan 2025 01:21:35 -0800 Subject: [PATCH 87/93] MMTabline: Add ability to turn off animation This is not exposed in the user preference pane, as it should be a niche case, but it's useful to have a way to turn off animations for either accessibility or user preferences reasons. --- runtime/doc/gui_mac.txt | 1 + runtime/doc/tags | 1 + src/MacVim/MMAppController.m | 1 + src/MacVim/MMTabline/MMTabline.h | 1 + src/MacVim/MMTabline/MMTabline.m | 16 ++++++++++++---- src/MacVim/MMVimView.m | 1 + src/MacVim/Miscellaneous.h | 1 + src/MacVim/Miscellaneous.m | 1 + 8 files changed, 19 insertions(+), 4 deletions(-) diff --git a/runtime/doc/gui_mac.txt b/runtime/doc/gui_mac.txt index fde60648e0..df2644f4e2 100644 --- a/runtime/doc/gui_mac.txt +++ b/runtime/doc/gui_mac.txt @@ -290,6 +290,7 @@ KEY VALUE ~ *MMDialogsTrackPwd* open/save dialogs track the Vim pwd [bool] *MMDisableLaunchAnimation* disable launch animation when opening a new MacVim window [bool] +*MMDisableTablineAnimation* disable animation in GUI tabs [bool] *MMFontPreserveLineSpacing* use the line-spacing as specified by font [bool] *MMLoginShell* use login shell for launching Vim [bool] *MMLoginShellArgument* login shell parameter [string] diff --git a/runtime/doc/tags b/runtime/doc/tags index b1b23149db..d8b5f59472 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5648,6 +5648,7 @@ MMCmdLineAlignBottom gui_mac.txt /*MMCmdLineAlignBottom* MMDefaultTablineColors gui_mac.txt /*MMDefaultTablineColors* MMDialogsTrackPwd gui_mac.txt /*MMDialogsTrackPwd* MMDisableLaunchAnimation gui_mac.txt /*MMDisableLaunchAnimation* +MMDisableTablineAnimation gui_mac.txt /*MMDisableTablineAnimation* MMFontPreserveLineSpacing gui_mac.txt /*MMFontPreserveLineSpacing* MMFullScreenFadeTime gui_mac.txt /*MMFullScreenFadeTime* MMLoginShell gui_mac.txt /*MMLoginShell* diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index 78df273f4d..116ee74c27 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -196,6 +196,7 @@ + (void)registerDefaults MMUntitledWindowKey, [NSNumber numberWithBool:NO], MMNoWindowShadowKey, [NSNumber numberWithBool:NO], MMDisableLaunchAnimationKey, + [NSNumber numberWithBool:NO], MMDisableTablineAnimationKey, [NSNumber numberWithInt:0], MMAppearanceModeSelectionKey, [NSNumber numberWithBool:NO], MMNoTitleBarWindowKey, [NSNumber numberWithBool:NO], MMTitlebarAppearsTransparentKey, diff --git a/src/MacVim/MMTabline/MMTabline.h b/src/MacVim/MMTabline/MMTabline.h index 347cc86c78..eb59034990 100644 --- a/src/MacVim/MMTabline/MMTabline.h +++ b/src/MacVim/MMTabline/MMTabline.h @@ -16,6 +16,7 @@ @property (nonatomic) NSInteger minimumTabWidth; @property (nonatomic) BOOL showsAddTabButton; @property (nonatomic) BOOL showsTabScrollButtons; +@property (nonatomic) BOOL useAnimation; @property (nonatomic, readonly) NSInteger numberOfTabs; @property (nonatomic, retain, readonly) MMHoverButton *addTabButton; @property (nonatomic, retain) NSColor *tablineBgColor; diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m index ef45c58384..eb37b9f072 100644 --- a/src/MacVim/MMTabline/MMTabline.m +++ b/src/MacVim/MMTabline/MMTabline.m @@ -64,6 +64,7 @@ - (instancetype)initWithFrame:(NSRect)frameRect _tabs = [NSMutableArray new]; _showsAddTabButton = YES; // get from NSUserDefaults _showsTabScrollButtons = YES; // get from NSUserDefaults + _useAnimation = YES; // get from NSUserDefaults _selectedTabIndex = -1; @@ -624,6 +625,9 @@ - (void)fixupTabZOrder - (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate delayResize:(BOOL)delayResize { + if (!self.useAnimation) + shouldAnimate = NO; + if (_tabs.count == 0) { NSRect frame = _tabsContainer.frame; frame.size.width = 0; @@ -859,10 +863,14 @@ - (void)scrollTabToVisibleAtIndex:(NSInteger)index // Left side of the selected tab is clipped. clipBounds.origin.x = tabFrame.origin.x; } - [NSAnimationContext beginGrouping]; - [NSAnimationContext.currentContext setDuration:elapsedTime < 0.2 ? 0.05 : 0.2]; - [_scrollView.contentView.animator setBoundsOrigin:clipBounds.origin]; - [NSAnimationContext endGrouping]; + if (_useAnimation) { + [NSAnimationContext beginGrouping]; + [NSAnimationContext.currentContext setDuration:elapsedTime < 0.2 ? 0.05 : 0.2]; + [_scrollView.contentView.animator setBoundsOrigin:clipBounds.origin]; + [NSAnimationContext endGrouping]; + } else { + [_scrollView.contentView setBoundsOrigin:clipBounds.origin]; + } } } diff --git a/src/MacVim/MMVimView.m b/src/MacVim/MMVimView.m index dc1db6060a..b696ac32ee 100644 --- a/src/MacVim/MMVimView.m +++ b/src/MacVim/MMVimView.m @@ -115,6 +115,7 @@ - (MMVimView *)initWithFrame:(NSRect)frame tabline.hidden = YES; tabline.showsAddTabButton = [ud boolForKey:MMShowAddTabButtonKey]; tabline.showsTabScrollButtons = [ud boolForKey:MMShowTabScrollButtonsKey]; + tabline.useAnimation = ![ud boolForKey:MMDisableTablineAnimationKey]; tabline.optimumTabWidth = [ud integerForKey:MMTabOptimumWidthKey]; tabline.minimumTabWidth = [ud integerForKey:MMTabMinWidthKey]; tabline.addTabButton.target = self; diff --git a/src/MacVim/Miscellaneous.h b/src/MacVim/Miscellaneous.h index 3b864602a8..0d297dd094 100644 --- a/src/MacVim/Miscellaneous.h +++ b/src/MacVim/Miscellaneous.h @@ -41,6 +41,7 @@ extern NSString *MMTitlebarAppearsTransparentKey; extern NSString *MMTitlebarShowsDocumentIconKey; extern NSString *MMNoWindowShadowKey; extern NSString *MMDisableLaunchAnimationKey; +extern NSString *MMDisableTablineAnimationKey; extern NSString *MMLoginShellKey; extern NSString *MMUntitledWindowKey; extern NSString *MMZoomBothKey; diff --git a/src/MacVim/Miscellaneous.m b/src/MacVim/Miscellaneous.m index 84b1bbec44..0b1e0523e2 100644 --- a/src/MacVim/Miscellaneous.m +++ b/src/MacVim/Miscellaneous.m @@ -37,6 +37,7 @@ NSString *MMTitlebarShowsDocumentIconKey = @"MMTitlebarShowsDocumentIcon"; NSString *MMNoWindowShadowKey = @"MMNoWindowShadow"; NSString *MMDisableLaunchAnimationKey = @"MMDisableLaunchAnimation"; +NSString *MMDisableTablineAnimationKey = @"MMDisableTablineAnimation"; NSString *MMLoginShellKey = @"MMLoginShell"; NSString *MMUntitledWindowKey = @"MMUntitledWindow"; NSString *MMZoomBothKey = @"MMZoomBoth"; From 2b811bb6eddfb8b1ec2805d9cb718d11b3a095bc Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Wed, 29 Jan 2025 04:22:20 -0800 Subject: [PATCH 88/93] MMTabline: Localize button strings Use Apple Glossary for the new tab button translations. For the scroll backward/forward buttons I took it from Firefox (https://pontoon.mozilla.org/) under the arrowscrollbox strings. --- src/MacVim/MMTabline/MMTabline.m | 8 +-- src/MacVim/MacVim.xcodeproj/project.pbxproj | 68 +++++++++++++++++-- .../MacVim_xcode8.xcodeproj/project.pbxproj | 68 +++++++++++++++++-- src/MacVim/ca.lproj/Localizable.strings | 11 +++ src/MacVim/cs.lproj/Localizable.strings | 11 +++ src/MacVim/da.lproj/Localizable.strings | 11 +++ src/MacVim/de.lproj/Localizable.strings | 11 +++ src/MacVim/en.lproj/Localizable.strings | 9 +++ src/MacVim/es.lproj/Localizable.strings | 11 +++ src/MacVim/fi.lproj/Localizable.strings | 11 +++ src/MacVim/fr.lproj/Localizable.strings | 11 +++ src/MacVim/hu.lproj/Localizable.strings | 11 +++ src/MacVim/it.lproj/Localizable.strings | 11 +++ src/MacVim/ja.lproj/Localizable.strings | 11 +++ src/MacVim/ko.lproj/Localizable.strings | 11 +++ src/MacVim/nb.lproj/Localizable.strings | 11 +++ src/MacVim/nl.lproj/Localizable.strings | 11 +++ src/MacVim/pl.lproj/Localizable.strings | 11 +++ src/MacVim/pt-BR.lproj/Localizable.strings | 11 +++ src/MacVim/pt-PT.lproj/Localizable.strings | 11 +++ src/MacVim/ru.lproj/Localizable.strings | 11 +++ .../extract-specific-localised-strings.swift | 31 +++++++-- src/MacVim/sv.lproj/Localizable.strings | 11 +++ src/MacVim/tr.lproj/Localizable.strings | 11 +++ src/MacVim/zh-Hans.lproj/Localizable.strings | 11 +++ src/MacVim/zh-Hant.lproj/Localizable.strings | 13 ++++ 26 files changed, 392 insertions(+), 25 deletions(-) create mode 100644 src/MacVim/ca.lproj/Localizable.strings create mode 100644 src/MacVim/cs.lproj/Localizable.strings create mode 100644 src/MacVim/da.lproj/Localizable.strings create mode 100644 src/MacVim/de.lproj/Localizable.strings create mode 100644 src/MacVim/en.lproj/Localizable.strings create mode 100644 src/MacVim/es.lproj/Localizable.strings create mode 100644 src/MacVim/fi.lproj/Localizable.strings create mode 100644 src/MacVim/fr.lproj/Localizable.strings create mode 100644 src/MacVim/hu.lproj/Localizable.strings create mode 100644 src/MacVim/it.lproj/Localizable.strings create mode 100644 src/MacVim/ja.lproj/Localizable.strings create mode 100644 src/MacVim/ko.lproj/Localizable.strings create mode 100644 src/MacVim/nb.lproj/Localizable.strings create mode 100644 src/MacVim/nl.lproj/Localizable.strings create mode 100644 src/MacVim/pl.lproj/Localizable.strings create mode 100644 src/MacVim/pt-BR.lproj/Localizable.strings create mode 100644 src/MacVim/pt-PT.lproj/Localizable.strings create mode 100644 src/MacVim/ru.lproj/Localizable.strings create mode 100644 src/MacVim/sv.lproj/Localizable.strings create mode 100644 src/MacVim/tr.lproj/Localizable.strings create mode 100644 src/MacVim/zh-Hans.lproj/Localizable.strings create mode 100644 src/MacVim/zh-Hant.lproj/Localizable.strings diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m index eb37b9f072..9d24fa1604 100644 --- a/src/MacVim/MMTabline/MMTabline.m +++ b/src/MacVim/MMTabline/MMTabline.m @@ -21,7 +21,7 @@ button.action = action; button.continuous = continuous; [button sizeToFit]; - [button setToolTip:NSLocalizedString(tooltip, @"Tabline button")]; + [button setToolTip:tooltip]; [tabline addSubview:button]; return button; } @@ -82,9 +82,9 @@ - (instancetype)initWithFrame:(NSRect)frameRect _scrollView.documentView = _tabsContainer; [self addSubview:_scrollView]; - _addTabButton = MakeHoverButton(self, MMHoverButtonImageAddTab, @"New Tab (⌘T)", @selector(addTabAtEnd), NO); - _leftScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollLeft, @"Scroll Tabs", @selector(scrollLeftOneTab), YES); - _rightScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollRight, @"Scroll Tabs", @selector(scrollRightOneTab), YES); + _addTabButton = MakeHoverButton(self, MMHoverButtonImageAddTab, NSLocalizedString(@"create-new-tab-button", @"Create a new tab button"), @selector(addTabAtEnd), NO); + _leftScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollLeft, NSLocalizedString(@"scroll-tabs-backward", @"Scroll backward button in tabs line"), @selector(scrollLeftOneTab), YES); + _rightScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollRight, NSLocalizedString(@"scroll-tabs-forward", @"Scroll forward button in tabs line"), @selector(scrollRightOneTab), YES); [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[_leftScrollButton][_rightScrollButton]-5-[_scrollView]-5-[_addTabButton]" options:NSLayoutFormatAlignAllCenterY metrics:nil views:NSDictionaryOfVariableBindings(_scrollView, _leftScrollButton, _rightScrollButton, _addTabButton)]]; [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_scrollView]|" options:0 metrics:nil views:@{@"_scrollView":_scrollView}]]; diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj index 403e34fcf8..74818701b0 100644 --- a/src/MacVim/MacVim.xcodeproj/project.pbxproj +++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj @@ -66,6 +66,7 @@ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + 90290BB02D48649B00AA7489 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 90290BAE2D48649B00AA7489 /* Localizable.strings */; }; 907FF7512521BCE200BADACB /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF74F2521BCE200BADACB /* MainMenu.xib */; }; 907FF7542521BDA600BADACB /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF7522521BDA600BADACB /* Preferences.xib */; }; 907FF7572521BDC300BADACB /* FindAndReplace.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF7552521BDC200BADACB /* FindAndReplace.xib */; }; @@ -283,6 +284,28 @@ 901C07182430C8CD00797C2A /* viminfo.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = viminfo.c; path = ../viminfo.c; sourceTree = ""; }; 901C07192430C8CD00797C2A /* filepath.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = filepath.c; path = ../filepath.c; sourceTree = ""; }; 901C071A2430C8CD00797C2A /* session.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = session.c; path = ../session.c; sourceTree = ""; }; + 90290BAF2D48649B00AA7489 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB12D4864C200AA7489 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; + 90290BB22D486AC600AA7489 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB32D486AC600AA7489 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB42D486AC600AA7489 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; + 90290BB52D48743A00AA7489 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB62D48743A00AA7489 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB72D48743A00AA7489 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB82D48743A00AA7489 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB92D48743A00AA7489 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; + 90290BBA2D48743A00AA7489 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; + 90290BBB2D48743A00AA7489 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; + 90290BBC2D48743A00AA7489 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; + 90290BBD2D48764E00AA7489 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = ""; }; + 90290BBE2D48764E00AA7489 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = ""; }; + 90290BBF2D48764E00AA7489 /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/Localizable.strings; sourceTree = ""; }; + 90290BC02D48764E00AA7489 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; + 90290BC12D48764E00AA7489 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = ""; }; + 90290BC22D4878BF00AA7489 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; + 90290BC32D4878BF00AA7489 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; + 90290BC42D4878BF00AA7489 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = ""; }; + 90290BC52D4878BF00AA7489 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = ""; }; 907FF75A2521C09F00BADACB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/FindAndReplace.xib; sourceTree = ""; }; 907FF75B2521C09F00BADACB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Preferences.xib; sourceTree = ""; }; 907FF75C2521C0A000BADACB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -441,6 +464,13 @@ 90F84F312521F8760000268B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/MainMenu.strings; sourceTree = ""; }; 90F84F322521F87F0000268B /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/MainMenu.strings; sourceTree = ""; }; 90F84F332521F8880000268B /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/MainMenu.strings; sourceTree = ""; }; + 925B55CD254B604A006B047E /* MMHoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHoverButton.h; sourceTree = ""; }; + 925B55D1254B604A006B047E /* MMHoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHoverButton.m; sourceTree = ""; }; + 925B55D6254B61AB006B047E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 92C6F6E325587E1C007AE21E /* MMTab.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTab.m; sourceTree = ""; }; + 92C6F6E525587E1C007AE21E /* MMTabline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTabline.m; sourceTree = ""; }; + 92C6F6E625587E1C007AE21E /* MMTabline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTabline.h; sourceTree = ""; }; + 92C6F6E725587E1C007AE21E /* MMTab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTab.h; sourceTree = ""; }; 95241CE12573D587001E3711 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 95241CF025749CC6001E3711 /* vim9type.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = vim9type.c; path = ../vim9type.c; sourceTree = ""; }; 95241CF125749CC6001E3711 /* help.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = help.c; path = ../help.c; sourceTree = ""; }; @@ -454,13 +484,6 @@ 95241CF925749CC7001E3711 /* errors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = errors.h; path = ../errors.h; sourceTree = ""; }; 95241CFA25749CC7001E3711 /* textobject.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = textobject.c; path = ../textobject.c; sourceTree = ""; }; 95241CFB25749D4A001E3711 /* os_macosx.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = os_macosx.m; path = ../os_macosx.m; sourceTree = ""; }; - 925B55CD254B604A006B047E /* MMHoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHoverButton.h; sourceTree = ""; }; - 925B55D1254B604A006B047E /* MMHoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHoverButton.m; sourceTree = ""; }; - 925B55D6254B61AB006B047E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 92C6F6E325587E1C007AE21E /* MMTab.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTab.m; sourceTree = ""; }; - 92C6F6E525587E1C007AE21E /* MMTabline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTabline.m; sourceTree = ""; }; - 92C6F6E625587E1C007AE21E /* MMTabline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTabline.h; sourceTree = ""; }; - 92C6F6E725587E1C007AE21E /* MMTab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTab.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -635,6 +658,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 90290BAE2D48649B00AA7489 /* Localizable.strings */, 1D384A0D100D671700D3C22F /* KeyBinding.plist */, 1D9C602E0EF79C0C0034AD44 /* MacVim.icns */, 0395A8A90D72D88B00881434 /* General.png */, @@ -1036,6 +1060,7 @@ 1DCD00C10E50B2B700460166 /* Cut.png in Resources */, 1DCD00C20E50B2B700460166 /* FindHelp.png in Resources */, 1DCD00C30E50B2B700460166 /* FindNext.png in Resources */, + 90290BB02D48649B00AA7489 /* Localizable.strings in Resources */, 1DCD00C40E50B2B700460166 /* FindPrev.png in Resources */, 1DCD00C50E50B2B700460166 /* Help.png in Resources */, 1DCD00C60E50B2B700460166 /* LoadSesn.png in Resources */, @@ -1259,6 +1284,35 @@ name = InfoPlist.strings; sourceTree = ""; }; + 90290BAE2D48649B00AA7489 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 90290BAF2D48649B00AA7489 /* en */, + 90290BB12D4864C200AA7489 /* zh-Hant */, + 90290BB22D486AC600AA7489 /* ja */, + 90290BB32D486AC600AA7489 /* ko */, + 90290BB42D486AC600AA7489 /* zh-Hans */, + 90290BB52D48743A00AA7489 /* ca */, + 90290BB62D48743A00AA7489 /* cs */, + 90290BB72D48743A00AA7489 /* da */, + 90290BB82D48743A00AA7489 /* de */, + 90290BB92D48743A00AA7489 /* fi */, + 90290BBA2D48743A00AA7489 /* fr */, + 90290BBB2D48743A00AA7489 /* nl */, + 90290BBC2D48743A00AA7489 /* pt-BR */, + 90290BBD2D48764E00AA7489 /* hu */, + 90290BBE2D48764E00AA7489 /* it */, + 90290BBF2D48764E00AA7489 /* nb */, + 90290BC02D48764E00AA7489 /* pl */, + 90290BC12D48764E00AA7489 /* pt-PT */, + 90290BC22D4878BF00AA7489 /* es */, + 90290BC32D4878BF00AA7489 /* ru */, + 90290BC42D4878BF00AA7489 /* sv */, + 90290BC52D4878BF00AA7489 /* tr */, + ); + name = Localizable.strings; + sourceTree = ""; + }; 907FF74F2521BCE200BADACB /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/src/MacVim/MacVim_xcode8.xcodeproj/project.pbxproj b/src/MacVim/MacVim_xcode8.xcodeproj/project.pbxproj index cd4b93f341..671fa705a7 100644 --- a/src/MacVim/MacVim_xcode8.xcodeproj/project.pbxproj +++ b/src/MacVim/MacVim_xcode8.xcodeproj/project.pbxproj @@ -67,6 +67,7 @@ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + 90290BB02D48649B00AA7489 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 90290BAE2D48649B00AA7489 /* Localizable.strings */; }; 907FF7512521BCE200BADACB /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF74F2521BCE200BADACB /* MainMenu.xib */; }; 907FF7542521BDA600BADACB /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF7522521BDA600BADACB /* Preferences.xib */; }; 907FF7572521BDC300BADACB /* FindAndReplace.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF7552521BDC200BADACB /* FindAndReplace.xib */; }; @@ -284,6 +285,28 @@ 901C07182430C8CD00797C2A /* viminfo.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = viminfo.c; path = ../viminfo.c; sourceTree = ""; }; 901C07192430C8CD00797C2A /* filepath.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = filepath.c; path = ../filepath.c; sourceTree = ""; }; 901C071A2430C8CD00797C2A /* session.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = session.c; path = ../session.c; sourceTree = ""; }; + 90290BAF2D48649B00AA7489 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB12D4864C200AA7489 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; + 90290BB22D486AC600AA7489 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB32D486AC600AA7489 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB42D486AC600AA7489 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; + 90290BB52D48743A00AA7489 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB62D48743A00AA7489 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB72D48743A00AA7489 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB82D48743A00AA7489 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; + 90290BB92D48743A00AA7489 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; + 90290BBA2D48743A00AA7489 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; + 90290BBB2D48743A00AA7489 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; + 90290BBC2D48743A00AA7489 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; + 90290BBD2D48764E00AA7489 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = ""; }; + 90290BBE2D48764E00AA7489 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = ""; }; + 90290BBF2D48764E00AA7489 /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/Localizable.strings; sourceTree = ""; }; + 90290BC02D48764E00AA7489 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; + 90290BC12D48764E00AA7489 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = ""; }; + 90290BC22D4878BF00AA7489 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; + 90290BC32D4878BF00AA7489 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; + 90290BC42D4878BF00AA7489 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = ""; }; + 90290BC52D4878BF00AA7489 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = ""; }; 907FF75A2521C09F00BADACB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/FindAndReplace.xib; sourceTree = ""; }; 907FF75B2521C09F00BADACB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Preferences.xib; sourceTree = ""; }; 907FF75C2521C0A000BADACB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -442,6 +465,13 @@ 90F84F312521F8760000268B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/MainMenu.strings; sourceTree = ""; }; 90F84F322521F87F0000268B /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/MainMenu.strings; sourceTree = ""; }; 90F84F332521F8880000268B /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/MainMenu.strings; sourceTree = ""; }; + 925B55CD254B604A006B047E /* MMHoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHoverButton.h; sourceTree = ""; }; + 925B55D1254B604A006B047E /* MMHoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHoverButton.m; sourceTree = ""; }; + 925B55D6254B61AB006B047E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 92C6F6E325587E1C007AE21E /* MMTab.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTab.m; sourceTree = ""; }; + 92C6F6E525587E1C007AE21E /* MMTabline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTabline.m; sourceTree = ""; }; + 92C6F6E625587E1C007AE21E /* MMTabline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTabline.h; sourceTree = ""; }; + 92C6F6E725587E1C007AE21E /* MMTab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTab.h; sourceTree = ""; }; 95241CE12573D587001E3711 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 95241CF025749CC6001E3711 /* vim9type.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = vim9type.c; path = ../vim9type.c; sourceTree = ""; }; 95241CF125749CC6001E3711 /* help.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = help.c; path = ../help.c; sourceTree = ""; }; @@ -455,13 +485,6 @@ 95241CF925749CC7001E3711 /* errors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = errors.h; path = ../errors.h; sourceTree = ""; }; 95241CFA25749CC7001E3711 /* textobject.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = textobject.c; path = ../textobject.c; sourceTree = ""; }; 95241CFB25749D4A001E3711 /* os_macosx.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = os_macosx.m; path = ../os_macosx.m; sourceTree = ""; }; - 925B55CD254B604A006B047E /* MMHoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHoverButton.h; sourceTree = ""; }; - 925B55D1254B604A006B047E /* MMHoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHoverButton.m; sourceTree = ""; }; - 925B55D6254B61AB006B047E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 92C6F6E325587E1C007AE21E /* MMTab.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTab.m; sourceTree = ""; }; - 92C6F6E525587E1C007AE21E /* MMTabline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTabline.m; sourceTree = ""; }; - 92C6F6E625587E1C007AE21E /* MMTabline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTabline.h; sourceTree = ""; }; - 92C6F6E725587E1C007AE21E /* MMTab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTab.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -636,6 +659,7 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 90290BAE2D48649B00AA7489 /* Localizable.strings */, 1D384A0D100D671700D3C22F /* KeyBinding.plist */, 1D9C602E0EF79C0C0034AD44 /* MacVim.icns */, 0395A8A90D72D88B00881434 /* General.png */, @@ -1037,6 +1061,7 @@ 1DCD00C10E50B2B700460166 /* Cut.png in Resources */, 1DCD00C20E50B2B700460166 /* FindHelp.png in Resources */, 1DCD00C30E50B2B700460166 /* FindNext.png in Resources */, + 90290BB02D48649B00AA7489 /* Localizable.strings in Resources */, 1DCD00C40E50B2B700460166 /* FindPrev.png in Resources */, 1DCD00C50E50B2B700460166 /* Help.png in Resources */, 1DCD00C60E50B2B700460166 /* LoadSesn.png in Resources */, @@ -1260,6 +1285,35 @@ name = InfoPlist.strings; sourceTree = ""; }; + 90290BAE2D48649B00AA7489 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 90290BAF2D48649B00AA7489 /* en */, + 90290BB12D4864C200AA7489 /* zh-Hant */, + 90290BB22D486AC600AA7489 /* ja */, + 90290BB32D486AC600AA7489 /* ko */, + 90290BB42D486AC600AA7489 /* zh-Hans */, + 90290BB52D48743A00AA7489 /* ca */, + 90290BB62D48743A00AA7489 /* cs */, + 90290BB72D48743A00AA7489 /* da */, + 90290BB82D48743A00AA7489 /* de */, + 90290BB92D48743A00AA7489 /* fi */, + 90290BBA2D48743A00AA7489 /* fr */, + 90290BBB2D48743A00AA7489 /* nl */, + 90290BBC2D48743A00AA7489 /* pt-BR */, + 90290BBD2D48764E00AA7489 /* hu */, + 90290BBE2D48764E00AA7489 /* it */, + 90290BBF2D48764E00AA7489 /* nb */, + 90290BC02D48764E00AA7489 /* pl */, + 90290BC12D48764E00AA7489 /* pt-PT */, + 90290BC22D4878BF00AA7489 /* es */, + 90290BC32D4878BF00AA7489 /* ru */, + 90290BC42D4878BF00AA7489 /* sv */, + 90290BC52D4878BF00AA7489 /* tr */, + ); + name = Localizable.strings; + sourceTree = ""; + }; 907FF74F2521BCE200BADACB /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/src/MacVim/ca.lproj/Localizable.strings b/src/MacVim/ca.lproj/Localizable.strings new file mode 100644 index 0000000000..98af8da140 --- /dev/null +++ b/src/MacVim/ca.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Desplaça cap enrere"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Desplaça cap endavant"; + +// The strings below were generated from Apple localization glossaries (Catalan). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Crear una pestanya nova"; diff --git a/src/MacVim/cs.lproj/Localizable.strings b/src/MacVim/cs.lproj/Localizable.strings new file mode 100644 index 0000000000..4859f76a3c --- /dev/null +++ b/src/MacVim/cs.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Posunout dozadu"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Posunout dopředu"; + +// The strings below were generated from Apple localization glossaries (Czech). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Vytvoří nový panel"; diff --git a/src/MacVim/da.lproj/Localizable.strings b/src/MacVim/da.lproj/Localizable.strings new file mode 100644 index 0000000000..8a4cb613ef --- /dev/null +++ b/src/MacVim/da.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Scroll baglæns"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Scroll forlæns"; + +// The strings below were generated from Apple localization glossaries (Danish). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Opret en ny fane"; diff --git a/src/MacVim/de.lproj/Localizable.strings b/src/MacVim/de.lproj/Localizable.strings new file mode 100644 index 0000000000..80a1ae0461 --- /dev/null +++ b/src/MacVim/de.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Zurück scrollen"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Nach vorn scrollen"; + +// The strings below were generated from Apple localization glossaries (German). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Neuen Tab erstellen"; diff --git a/src/MacVim/en.lproj/Localizable.strings b/src/MacVim/en.lproj/Localizable.strings new file mode 100644 index 0000000000..4eedcf66fa --- /dev/null +++ b/src/MacVim/en.lproj/Localizable.strings @@ -0,0 +1,9 @@ +/* Create a new tab button */ +"create-new-tab-button" = "Create a new tab"; + +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Scroll backwards"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Scroll forwards"; + diff --git a/src/MacVim/es.lproj/Localizable.strings b/src/MacVim/es.lproj/Localizable.strings new file mode 100644 index 0000000000..634e05a785 --- /dev/null +++ b/src/MacVim/es.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Desplazarse hacia atrás"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Desplazarse hacia adelante"; + +// The strings below were generated from Apple localization glossaries (Spanish). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Crear una pestaña nueva"; diff --git a/src/MacVim/fi.lproj/Localizable.strings b/src/MacVim/fi.lproj/Localizable.strings new file mode 100644 index 0000000000..7414b609cb --- /dev/null +++ b/src/MacVim/fi.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Vieritä taaksepäin"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Vieritä eteenpäin"; + +// The strings below were generated from Apple localization glossaries (Finnish). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Luo uusi välilehti"; diff --git a/src/MacVim/fr.lproj/Localizable.strings b/src/MacVim/fr.lproj/Localizable.strings new file mode 100644 index 0000000000..b7b310fc32 --- /dev/null +++ b/src/MacVim/fr.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Faire défiler vers l’arrière"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Faire défiler vers l’avant"; + +// The strings below were generated from Apple localization glossaries (Universal French). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Créer un nouvel onglet"; diff --git a/src/MacVim/hu.lproj/Localizable.strings b/src/MacVim/hu.lproj/Localizable.strings new file mode 100644 index 0000000000..840abdec0b --- /dev/null +++ b/src/MacVim/hu.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Görgetés visszafelé"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Görgetés előrefelé"; + +// The strings below were generated from Apple localization glossaries (Hungarian). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Új lap létrehozása"; diff --git a/src/MacVim/it.lproj/Localizable.strings b/src/MacVim/it.lproj/Localizable.strings new file mode 100644 index 0000000000..4bcba71bdb --- /dev/null +++ b/src/MacVim/it.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Scorri indietro"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Scorri avanti"; + +// The strings below were generated from Apple localization glossaries (Italian). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Crea un nuovo pannello"; diff --git a/src/MacVim/ja.lproj/Localizable.strings b/src/MacVim/ja.lproj/Localizable.strings new file mode 100644 index 0000000000..6389f5bfb5 --- /dev/null +++ b/src/MacVim/ja.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "スクロールして戻ります"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "スクロールして進みます"; + +// The strings below were generated from Apple localization glossaries (Japanese). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "新しいタブを開きます"; diff --git a/src/MacVim/ko.lproj/Localizable.strings b/src/MacVim/ko.lproj/Localizable.strings new file mode 100644 index 0000000000..c2444fd101 --- /dev/null +++ b/src/MacVim/ko.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "뒤로 스크롤"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "앞으로 스크롤"; + +// The strings below were generated from Apple localization glossaries (Korean). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "새로운 탭을 생성합니다"; diff --git a/src/MacVim/nb.lproj/Localizable.strings b/src/MacVim/nb.lproj/Localizable.strings new file mode 100644 index 0000000000..c64e7ad0de --- /dev/null +++ b/src/MacVim/nb.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Rull bakover"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Rull fremover"; + +// The strings below were generated from Apple localization glossaries (Norwegian). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Opprett ny fane"; diff --git a/src/MacVim/nl.lproj/Localizable.strings b/src/MacVim/nl.lproj/Localizable.strings new file mode 100644 index 0000000000..9e07b305ed --- /dev/null +++ b/src/MacVim/nl.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Terug scrollen"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Vooruit scrollen"; + +// The strings below were generated from Apple localization glossaries (Dutch). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Maak een nieuw tabblad aan"; diff --git a/src/MacVim/pl.lproj/Localizable.strings b/src/MacVim/pl.lproj/Localizable.strings new file mode 100644 index 0000000000..dd24d412ad --- /dev/null +++ b/src/MacVim/pl.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Przewiń do tyłu"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Przewiń do przodu"; + +// The strings below were generated from Apple localization glossaries (Polish). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Pozwala utworzyć nową kartę."; diff --git a/src/MacVim/pt-BR.lproj/Localizable.strings b/src/MacVim/pt-BR.lproj/Localizable.strings new file mode 100644 index 0000000000..84587d2b0b --- /dev/null +++ b/src/MacVim/pt-BR.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Deslizar para trás"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Deslizar para frente"; + +// The strings below were generated from Apple localization glossaries (Brazilian). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Cria uma nova aba"; diff --git a/src/MacVim/pt-PT.lproj/Localizable.strings b/src/MacVim/pt-PT.lproj/Localizable.strings new file mode 100644 index 0000000000..2e70e66395 --- /dev/null +++ b/src/MacVim/pt-PT.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Deslocar para trás"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Deslocar para a frente"; + +// The strings below were generated from Apple localization glossaries (Portuguese). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Criar um novo separador."; diff --git a/src/MacVim/ru.lproj/Localizable.strings b/src/MacVim/ru.lproj/Localizable.strings new file mode 100644 index 0000000000..cbe26a33b1 --- /dev/null +++ b/src/MacVim/ru.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Прокрутить назад"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Прокрутить вперёд"; + +// The strings below were generated from Apple localization glossaries (Russian). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Создать новую вкладку"; diff --git a/src/MacVim/scripts/extract-specific-localised-strings.swift b/src/MacVim/scripts/extract-specific-localised-strings.swift index f235c97149..87cbdc0aa2 100755 --- a/src/MacVim/scripts/extract-specific-localised-strings.swift +++ b/src/MacVim/scripts/extract-specific-localised-strings.swift @@ -19,16 +19,24 @@ // cd xib_strings; for f in *.lproj; do cat ../../$f/MainMenu.strings | head -$(awk -v line='Apple localization glossaries' '$0 ~ line {print NR-1}' ../../$f/MainMenu.strings) >! ./test.strings; cat $f/Localizable.strings >> ./test.strings; cp ./test.strings ../../$f/MainMenu.strings; rm ./test.strings; done // 3. Run this script with --vimMenu. This should output the updated string names to the individual locale's .vim // translation files. +// 4. Run this script with --localizableStrings. This will generate the translations for Localizable.strings. +// Similar to MainManu.xib, do the following: +// cd xib_strings; for f in *.lproj; do cat ../../$f/Localizable.strings | head -$(awk -v line='Apple localization glossaries' '$0 ~ line {print NR-1}' ../../$f/Localizable.strings) >! ./test.strings; cat $f/Localizable.strings >> ./test.strings; cp ./test.strings ../../$f/Localizable.strings; rm ./test.strings; done -var isMainMenu = true +var isMainMenu = false +var isVimMenu = false +var isLocalizable = false for argument in CommandLine.arguments { switch argument { case "--vimMenu": - isMainMenu = false + isVimMenu = true case "--mainMenu": isMainMenu = true + case "--localizableStrings": + isLocalizable = true + case "--help": print("extract-specific-localised-strings.swift [--vimMenu] [--mainMenu]") exit(0) @@ -76,7 +84,7 @@ import Foundation /// The directory containing the .lproj directories where the .strings files will be written. var outputDirectory = URL(fileURLWithPath: "./xib_strings") -if !isMainMenu { +if isVimMenu { outputDirectory = URL(fileURLWithPath: "../../../runtime/lang/macvim_menu") } @@ -161,6 +169,12 @@ let neededLocalisations_mainmenu_xib = [ NeededLocalisation(targetKey: "e16-xE-q4U.title", appleKey: "WHATS_NEW_TITLE", glossaryFilename: "Marmoset"), ] +// These are the translations we need for Localizable.strings +let neededLocalisations_localizable_xib = [ + // Create new tab button + NeededLocalisation(targetKey: "create-new-tab-button", appleKey: "Create a new tab", glossaryFilename: "AppKit"), +] + // These are the translations for the Vim menus that MacVim re-named to fit Apple's HIG better. let neededLocalisations_vim = [ NeededLocalisation(targetKey: "New\\ Window", appleKey: "82.title", glossaryFilename: "WebBrowser"), @@ -193,7 +207,10 @@ let neededLocalisations_vim = [ ] var neededLocalisations = neededLocalisations_mainmenu_xib -if !isMainMenu { +if isLocalizable { + neededLocalisations = neededLocalisations_localizable_xib +} +if isVimMenu { neededLocalisations = neededLocalisations_vim } @@ -360,7 +377,7 @@ for localisation in localisations { return nil } - if isMainMenu { + if !isVimMenu { return """ "\(neededLocalisation.targetKey)" = "\(translation)"; """ @@ -377,13 +394,13 @@ for localisation in localisations { } var targetStringsFileURL = outputDirectory.appendingPathComponents(["\(localisation.code).lproj", "Localizable.strings"]) - if !isMainMenu { + if isVimMenu { targetStringsFileURL = outputDirectory.appendingPathComponents(["menu_\(localisation.vimMenuTrans).apple.vim"]) } try! FileManager.default.createDirectory(at: targetStringsFileURL.deletingLastPathComponent(), withIntermediateDirectories: true, attributes: nil) - if isMainMenu { + if !isVimMenu { try! """ // The strings below were generated from Apple localization glossaries (\(localisation.volumeName)). // See extract-specific-localised-strings.swift for details. diff --git a/src/MacVim/sv.lproj/Localizable.strings b/src/MacVim/sv.lproj/Localizable.strings new file mode 100644 index 0000000000..b1c02501cf --- /dev/null +++ b/src/MacVim/sv.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Bläddra bakåt"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "Bläddra framåt"; + +// The strings below were generated from Apple localization glossaries (Swedish). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Skapa en ny flik"; diff --git a/src/MacVim/tr.lproj/Localizable.strings b/src/MacVim/tr.lproj/Localizable.strings new file mode 100644 index 0000000000..2aea263a2c --- /dev/null +++ b/src/MacVim/tr.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "Geri kaydır"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "İleri kaydır"; + +// The strings below were generated from Apple localization glossaries (Turkish). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "Yeni bir sekme yarat"; diff --git a/src/MacVim/zh-Hans.lproj/Localizable.strings b/src/MacVim/zh-Hans.lproj/Localizable.strings new file mode 100644 index 0000000000..2d0b355ce7 --- /dev/null +++ b/src/MacVim/zh-Hans.lproj/Localizable.strings @@ -0,0 +1,11 @@ +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "往回滚动"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "向前滚动"; + +// The strings below were generated from Apple localization glossaries (Simplified Chinese). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "创建新标签页"; diff --git a/src/MacVim/zh-Hant.lproj/Localizable.strings b/src/MacVim/zh-Hant.lproj/Localizable.strings new file mode 100644 index 0000000000..30ecb69d7f --- /dev/null +++ b/src/MacVim/zh-Hant.lproj/Localizable.strings @@ -0,0 +1,13 @@ + + +/* Scroll backward button in tabs line */ +"scroll-tabs-backward" = "向後捲動"; + +/* Scroll forward button in tabs line */ +"scroll-tabs-forward" = "向前捲動"; + +// The strings below were generated from Apple localization glossaries (Traditional Chinese). +// See extract-specific-localised-strings.swift for details. +// Do no modify directly! + +"create-new-tab-button" = "新增標籤頁"; From 3f8e40538a4d42d4695025517732f4ddefde23cf Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Wed, 29 Jan 2025 17:14:36 -0800 Subject: [PATCH 89/93] MMTabline: Add right-to-left (RTL) locale support In RTL locales (e.g. Arabic, Hebrew), macOS lays everything out in the flipped direction, including most UI elements and native tabs. This change makes sure MacVim tabs will obey the same convention and behave intuitively in such locales. The buttons and UI elements in MMTab/MMTabline already automatically get flipped. However, the logic of handling the tabs placements, scrolling, and drag-and-drop use manual calculations and need to be fixed up. In order to keep scrolling stable, and for tabs animation to look correct and the same as the left-to-right, we simply flip the frames we use for tabs layout, by starting from 0 in X coordinate, and grow towards the negative range. This helps keep most of the logic the same while only needing to apply the X-flip adjustment in a couple places. Also, as a minor adjustment, make the default widths of the tab just a bit wider. --- src/MacVim/MMAppController.m | 4 +- src/MacVim/MMTabline/MMTabline.h | 4 +- src/MacVim/MMTabline/MMTabline.m | 180 +++++++++++++++++++++++++------ src/MacVim/MMVimView.m | 4 +- 4 files changed, 152 insertions(+), 40 deletions(-) diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index 116ee74c27..1dd4ac5a4e 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -174,8 +174,8 @@ + (void)registerDefaults NSDictionary *macvimDefaults = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:NO], MMNoWindowKey, - [NSNumber numberWithInt:120], MMTabMinWidthKey, - [NSNumber numberWithInt:200], MMTabOptimumWidthKey, + [NSNumber numberWithInt:130], MMTabMinWidthKey, + [NSNumber numberWithInt:210], MMTabOptimumWidthKey, [NSNumber numberWithBool:YES], MMShowAddTabButtonKey, [NSNumber numberWithBool:NO], MMShowTabScrollButtonsKey, [NSNumber numberWithInt:2], MMTextInsetLeftKey, diff --git a/src/MacVim/MMTabline/MMTabline.h b/src/MacVim/MMTabline/MMTabline.h index eb59034990..a43be7828b 100644 --- a/src/MacVim/MMTabline/MMTabline.h +++ b/src/MacVim/MMTabline/MMTabline.h @@ -55,8 +55,8 @@ - (void)selectTabAtIndex:(NSInteger)index; - (MMTab *)tabAtIndex:(NSInteger)index; - (void)scrollTabToVisibleAtIndex:(NSInteger)index; -- (void)scrollLeftOneTab; -- (void)scrollRightOneTab; +- (void)scrollBackwardOneTab; +- (void)scrollForwardOneTab; - (void)setTablineSelBackground:(NSColor *)back foreground:(NSColor *)fore; @end diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m index 9d24fa1604..ff90d46d01 100644 --- a/src/MacVim/MMTabline/MMTabline.m +++ b/src/MacVim/MMTabline/MMTabline.m @@ -8,10 +8,10 @@ CGFloat remainder; } TabWidth; -const CGFloat OptimumTabWidth = 220; -const CGFloat MinimumTabWidth = 100; -const CGFloat TabOverlap = 6; -const CGFloat ScrollOneTabAllowance = 0.25; // If we are showing 75+% of the tab, consider it to be fully shown when deciding whether to scroll to next tab. +static const CGFloat OptimumTabWidth = 200; +static const CGFloat MinimumTabWidth = 100; +static const CGFloat TabOverlap = 6; +static const CGFloat ScrollOneTabAllowance = 0.25; // If we are showing 75+% of the tab, consider it to be fully shown when deciding whether to scroll to next tab. static MMHoverButton* MakeHoverButton(MMTabline *tabline, MMHoverButtonImage imageType, NSString *tooltip, SEL action, BOOL continuous) { MMHoverButton *button = [MMHoverButton new]; @@ -44,8 +44,8 @@ @implementation MMTabline CGFloat _xOffsetForDrag; NSInteger _initialDraggedTabIndex; NSInteger _finalDraggedTabIndex; - MMHoverButton *_leftScrollButton; - MMHoverButton *_rightScrollButton; + MMHoverButton *_backwardScrollButton; + MMHoverButton *_forwardScrollButton; id _scrollWheelEventMonitor; } @@ -82,23 +82,40 @@ - (instancetype)initWithFrame:(NSRect)frameRect _scrollView.documentView = _tabsContainer; [self addSubview:_scrollView]; - _addTabButton = MakeHoverButton(self, MMHoverButtonImageAddTab, NSLocalizedString(@"create-new-tab-button", @"Create a new tab button"), @selector(addTabAtEnd), NO); - _leftScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollLeft, NSLocalizedString(@"scroll-tabs-backward", @"Scroll backward button in tabs line"), @selector(scrollLeftOneTab), YES); - _rightScrollButton = MakeHoverButton(self, MMHoverButtonImageScrollRight, NSLocalizedString(@"scroll-tabs-forward", @"Scroll forward button in tabs line"), @selector(scrollRightOneTab), YES); - - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[_leftScrollButton][_rightScrollButton]-5-[_scrollView]-5-[_addTabButton]" options:NSLayoutFormatAlignAllCenterY metrics:nil views:NSDictionaryOfVariableBindings(_scrollView, _leftScrollButton, _rightScrollButton, _addTabButton)]]; + _addTabButton = MakeHoverButton( + self, + MMHoverButtonImageAddTab, + NSLocalizedString(@"create-new-tab-button", @"Create a new tab button"), + @selector(addTabAtEnd), + NO); + _backwardScrollButton = MakeHoverButton( + self, + [self useRightToLeft] ? MMHoverButtonImageScrollRight : MMHoverButtonImageScrollLeft, + NSLocalizedString(@"scroll-tabs-backward", @"Scroll backward button in tabs line"), + @selector(scrollBackwardOneTab), + YES); + _forwardScrollButton = MakeHoverButton( + self, + [self useRightToLeft] ? MMHoverButtonImageScrollLeft : MMHoverButtonImageScrollRight, + NSLocalizedString(@"scroll-tabs-forward", @"Scroll forward button in tabs line"), + @selector(scrollForwardOneTab), + YES); + + [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[_backwardScrollButton][_forwardScrollButton]-5-[_scrollView]-5-[_addTabButton]" options:NSLayoutFormatAlignAllCenterY metrics:nil views:NSDictionaryOfVariableBindings(_scrollView, _backwardScrollButton, _forwardScrollButton, _addTabButton)]]; [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_scrollView]|" options:0 metrics:nil views:@{@"_scrollView":_scrollView}]]; - _tabScrollButtonsLeadingConstraint = [NSLayoutConstraint constraintWithItem:_leftScrollButton attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeading multiplier:1 constant:5]; + _tabScrollButtonsLeadingConstraint = [NSLayoutConstraint constraintWithItem:_backwardScrollButton attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeading multiplier:1 constant:5]; [self addConstraint:_tabScrollButtonsLeadingConstraint]; _addTabButtonTrailingConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:_addTabButton attribute:NSLayoutAttributeTrailing multiplier:1 constant:5]; [self addConstraint:_addTabButtonTrailingConstraint]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didScroll:) name:NSViewBoundsDidChangeNotification object:_scrollView.contentView]; + if ([self useRightToLeft]) { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateTabsContainerBoundsForRTL:) name:NSViewFrameDidChangeNotification object:_tabsContainer]; + } [self addScrollWheelMonitor]; - } return self; } @@ -194,7 +211,7 @@ - (void)setShowsTabScrollButtons:(BOOL)showsTabScrollButtons // (see -drawRect: in MMTab.m). if (_showsTabScrollButtons != showsTabScrollButtons) { _showsTabScrollButtons = showsTabScrollButtons; - _tabScrollButtonsLeadingConstraint.constant = showsTabScrollButtons ? 5 : -((NSWidth(_leftScrollButton.frame) * 2) + 5 + MMTabShadowBlurRadius); + _tabScrollButtonsLeadingConstraint.constant = showsTabScrollButtons ? 5 : -((NSWidth(_backwardScrollButton.frame) * 2) + 5 + MMTabShadowBlurRadius); } } @@ -244,8 +261,8 @@ - (void)setTablineSelFgColor:(NSColor *)color { _tablineSelFgColor = color; _addTabButton.fgColor = color; - _leftScrollButton.fgColor = color; - _rightScrollButton.fgColor = color; + _backwardScrollButton.fgColor = color; + _forwardScrollButton.fgColor = color; for (MMTab *tab in _tabs) tab.state = tab.state; } @@ -280,6 +297,7 @@ - (NSInteger)addTabAtIndex:(NSInteger)index NSRect frame = _tabsContainer.bounds; frame.size.width = index == _tabs.count ? t.width + t.remainder : t.width; frame.origin.x = index * (t.width - TabOverlap); + frame = [self flipRectRTL:frame]; MMTab *newTab = [[MMTab alloc] initWithFrame:frame tabline:self]; [_tabs insertObject:newTab atIndex:index]; @@ -383,6 +401,7 @@ - (void)updateTabsByTags:(NSInteger *)tags len:(NSUInteger)len delayTabResize:(B NSRect frame = _tabsContainer.bounds; frame.size.width = i == (len - 1) ? t.width + t.remainder : t.width; frame.origin.x = i * (t.width - TabOverlap); + frame = [self flipRectRTL:frame]; MMTab *newTab = [[MMTab alloc] initWithFrame:frame tabline:self]; newTab.tag = tag; [newTabs addObject:newTab]; @@ -533,7 +552,7 @@ - (void)setTablineSelBackground:(NSColor *)back foreground:(NSColor *)fore #pragma mark - Helpers -NSComparisonResult SortTabsForZOrder(MMTab *tab1, MMTab *tab2, void *draggedTab) +NSComparisonResult SortTabsForZOrder(MMTab *tab1, MMTab *tab2, void *draggedTab, BOOL rtl) { // Z-order, highest to lowest: dragged, selected, hovered, rightmost if (tab1 == (__bridge MMTab *)draggedTab) return NSOrderedDescending; if (tab2 == (__bridge MMTab *)draggedTab) return NSOrderedAscending; @@ -541,11 +560,27 @@ NSComparisonResult SortTabsForZOrder(MMTab *tab1, MMTab *tab2, void *draggedTab) if (tab2.state == MMTabStateSelected) return NSOrderedAscending; if (tab1.state == MMTabStateUnselectedHover) return NSOrderedDescending; if (tab2.state == MMTabStateUnselectedHover) return NSOrderedAscending; - if (NSMinX(tab1.frame) < NSMinX(tab2.frame)) return NSOrderedAscending; - if (NSMinX(tab1.frame) > NSMinX(tab2.frame)) return NSOrderedDescending; + if (rtl) { + if (NSMinX(tab1.frame) > NSMinX(tab2.frame)) return NSOrderedAscending; + if (NSMinX(tab1.frame) < NSMinX(tab2.frame)) return NSOrderedDescending; + } else { + if (NSMinX(tab1.frame) < NSMinX(tab2.frame)) return NSOrderedAscending; + if (NSMinX(tab1.frame) > NSMinX(tab2.frame)) return NSOrderedDescending; + } return NSOrderedSame; } +NSComparisonResult SortTabsForZOrderLTR(MMTab *tab1, MMTab *tab2, void *draggedTab) +{ + return SortTabsForZOrder(tab1, tab2, draggedTab, NO); +} + + +NSComparisonResult SortTabsForZOrderRTL(MMTab *tab1, MMTab *tab2, void *draggedTab) +{ + return SortTabsForZOrder(tab1, tab2, draggedTab, YES); +} + - (TabWidth)tabWidthForTabs:(NSInteger)numTabs { // Each tab (except the first) overlaps the previous tab by TabOverlap @@ -620,9 +655,17 @@ - (void)fixupCloseButtons - (void)fixupTabZOrder { - [_tabsContainer sortSubviewsUsingFunction:SortTabsForZOrder context:(__bridge void *)(_draggedTab)]; + if ([self useRightToLeft]) { + [_tabsContainer sortSubviewsUsingFunction:SortTabsForZOrderRTL + context:(__bridge void *)(_draggedTab)]; + } else { + [_tabsContainer sortSubviewsUsingFunction:SortTabsForZOrderLTR + context:(__bridge void *)(_draggedTab)]; + } } +/// The main layout function that calculates the tab positions and animate them +/// accordingly. Call this every time tabs have been added/removed/moved. - (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate delayResize:(BOOL)delayResize { if (!self.useAnimation) @@ -656,6 +699,7 @@ - (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate delayResize:(BOOL)delayResi frame.size.width = i == _tabs.count - 1 ? t.width + t.remainder : t.width; frame.origin.x = i != 0 ? i * (t.width - TabOverlap) : 0; } + frame = [self flipRectRTL:frame]; if (shouldAnimate) { [NSAnimationContext runAnimationGroup:^(NSAnimationContext * _Nonnull context) { context.allowsImplicitAnimation = YES; @@ -673,8 +717,20 @@ - (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate delayResize:(BOOL)delayResi NSRect frame = _tabsContainer.frame; frame.size.width = t.width * _tabs.count - TabOverlap * (_tabs.count - 1); frame.size.width = NSWidth(frame) < NSWidth(_scrollView.frame) ? NSWidth(_scrollView.frame) : NSWidth(frame); - if (shouldAnimate) _tabsContainer.animator.frame = frame; - else _tabsContainer.frame = frame; + const BOOL sizeDecreasing = NSWidth(frame) < NSWidth(_tabsContainer.frame); + if ([self useRightToLeft]) { + // In RTL mode we flip the X coords and grow from 0 to negative. + // See updateTabsContainerBoundsForRTL which auto-updates the + // bounds to match the frame. + frame.origin.x = -NSWidth(frame); + } + if (shouldAnimate && sizeDecreasing) { + // Need to animate to make sure we don't immediately get clamped by + // the new size if we are already scrolled all the way to the back. + _tabsContainer.animator.frame = frame; + } else { + _tabsContainer.frame = frame; + } [self updateTabScrollButtonsEnabledState]; } } @@ -684,6 +740,41 @@ - (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate [self fixupLayoutWithAnimation:shouldAnimate delayResize:NO]; } +#pragma mark - Right-to-left (RTL) support + +- (BOOL)useRightToLeft +{ + // MMTabs support RTL locales. In such locales user interface items are + // laid out from right to left. The layout of hover buttons and views are + // automatically flipped by AppKit, but we need to handle this manually in + // the tab placement logic since that is custom logic. + return self.userInterfaceLayoutDirection == NSUserInterfaceLayoutDirectionRightToLeft; +} + +- (void)updateTabsContainerBoundsForRTL:(NSNotification *)notification +{ + // In RTL mode, we grow the tabs container to the left. We want to preserve + // stability of the scroll view's bounds, and also have the tabs animate + // correctly. To do this, we have to make sure the container bounds matches + // the frame at all times. This "cancels out" the negative X offsets with + // each other and ease calculations. + // E.g. an MMTab with origin (-100,0) inside the _tabsContainer coordinate + // space will actually be (-100,0) in the scroll view as well. + // In LTR mode we don't need this, since _tabsContainer's origin is always + // at (0,0). + _tabsContainer.bounds = _tabsContainer.frame; +} + +- (NSRect)flipRectRTL:(NSRect)frame +{ + if ([self useRightToLeft]) { + // In right-to-left mode, we flip the X coordinates for all the tabs so + // they start at 0 and grow in the negative direction. + frame.origin.x = -NSMaxX(frame); + } + return frame; +} + #pragma mark - Mouse - (void)updateTrackingAreas @@ -796,9 +887,15 @@ - (void)mouseDragged:(NSEvent *)event [self fixupTabZOrder]; [_draggedTab setFrameOrigin:NSMakePoint(mouse.x - _xOffsetForDrag, 0)]; MMTab *selectedTab = _selectedTabIndex == -1 ? nil : _tabs[_selectedTabIndex]; + const BOOL rightToLeft = [self useRightToLeft]; [_tabs sortWithOptions:NSSortStable usingComparator:^NSComparisonResult(MMTab *t1, MMTab *t2) { - if (NSMinX(t1.frame) <= NSMinX(t2.frame)) return NSOrderedAscending; - if (NSMinX(t1.frame) > NSMinX(t2.frame)) return NSOrderedDescending; + if (rightToLeft) { + if (NSMaxX(t1.frame) >= NSMaxX(t2.frame)) return NSOrderedAscending; + if (NSMaxX(t1.frame) < NSMaxX(t2.frame)) return NSOrderedDescending; + } else { + if (NSMinX(t1.frame) <= NSMinX(t2.frame)) return NSOrderedAscending; + if (NSMinX(t1.frame) > NSMinX(t2.frame)) return NSOrderedDescending; + } return NSOrderedSame; }]; _selectedTabIndex = _selectedTabIndex == -1 ? -1 : [_tabs indexOfObject:selectedTab]; @@ -820,11 +917,18 @@ - (void)updateTabScrollButtonsEnabledState // on either side of _scrollView. NSRect clipBounds = _scrollView.contentView.bounds; if (NSWidth(_tabsContainer.frame) <= NSWidth(clipBounds)) { - _leftScrollButton.enabled = NO; - _rightScrollButton.enabled = NO; + _backwardScrollButton.enabled = NO; + _forwardScrollButton.enabled = NO; } else { - _leftScrollButton.enabled = clipBounds.origin.x > 0; - _rightScrollButton.enabled = clipBounds.origin.x + NSWidth(clipBounds) < NSMaxX(_tabsContainer.frame); + BOOL scrollLeftEnabled = NSMinX(clipBounds) > NSMinX(_tabsContainer.frame); + BOOL scrollRightEnabled = NSMaxX(clipBounds) < NSMaxX(_tabsContainer.frame); + if ([self useRightToLeft]) { + _backwardScrollButton.enabled = scrollRightEnabled; + _forwardScrollButton.enabled = scrollLeftEnabled; + } else { + _backwardScrollButton.enabled = scrollLeftEnabled; + _forwardScrollButton.enabled = scrollRightEnabled; + } } } @@ -874,14 +978,18 @@ - (void)scrollTabToVisibleAtIndex:(NSInteger)index } } -- (void)scrollLeftOneTab +- (void)scrollBackwardOneTab { NSRect clipBounds = _scrollView.contentView.animator.bounds; for (NSInteger i = _tabs.count - 1; i >= 0; i--) { NSRect tabFrame = _tabs[i].frame; if (!NSContainsRect(clipBounds, tabFrame)) { - CGFloat allowance = i == 0 ? 0 : NSWidth(tabFrame) * ScrollOneTabAllowance; - if (NSMinX(tabFrame) + allowance < NSMinX(clipBounds)) { + const CGFloat allowance = (i == 0) ? + 0 : NSWidth(tabFrame) * ScrollOneTabAllowance; + const BOOL outOfBounds = [self useRightToLeft] ? + NSMaxX(tabFrame) - allowance > NSMaxX(clipBounds) : + NSMinX(tabFrame) + allowance < NSMinX(clipBounds); + if (outOfBounds) { [self scrollTabToVisibleAtIndex:i]; break; } @@ -889,14 +997,18 @@ - (void)scrollLeftOneTab } } -- (void)scrollRightOneTab +- (void)scrollForwardOneTab { NSRect clipBounds = _scrollView.contentView.animator.bounds; for (NSInteger i = 0; i < _tabs.count; i++) { NSRect tabFrame = _tabs[i].frame; if (!NSContainsRect(clipBounds, tabFrame)) { - CGFloat allowance = i == _tabs.count - 1 ? 0 : NSWidth(tabFrame) * ScrollOneTabAllowance; - if (NSMaxX(tabFrame) - allowance > NSMaxX(clipBounds)) { + const CGFloat allowance = (i == _tabs.count - 1) ? + 0 : NSWidth(tabFrame) * ScrollOneTabAllowance; + const BOOL outOfBounds = [self useRightToLeft] ? + NSMinX(tabFrame) + allowance < NSMinX(clipBounds) : + NSMaxX(tabFrame) - allowance > NSMaxX(clipBounds); + if (outOfBounds) { [self scrollTabToVisibleAtIndex:i]; break; } diff --git a/src/MacVim/MMVimView.m b/src/MacVim/MMVimView.m index b696ac32ee..96c6273094 100644 --- a/src/MacVim/MMVimView.m +++ b/src/MacVim/MMVimView.m @@ -264,12 +264,12 @@ - (IBAction)scrollToCurrentTab:(id)sender - (IBAction)scrollBackwardOneTab:(id)sender { - [tabline scrollLeftOneTab]; + [tabline scrollBackwardOneTab]; } - (IBAction)scrollForwardOneTab:(id)sender { - [tabline scrollRightOneTab]; + [tabline scrollForwardOneTab]; } - (void)showTabline:(BOOL)on From 663fba9d0332529323d7d90bd14d9edd60a9ac44 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Fri, 31 Jan 2025 18:56:16 -0800 Subject: [PATCH 90/93] MMTabline: Add Vim colorscheme / window use tab fill color support Tabs can now use colors defined by the Vim colorscheme under the TabLine/TabLineFill/TabLineSel highlight groups. There are now 3 coloring modes available: default, automatic (the default mode that generates matching colors using foreground/background colors), and Vim colorscheme. The new mode looks quite nice in some colorschemes and allows user customization, but for some existing ones it doesn't quite look right as they were designed for non-GUI tabs, which is why it's not the default. MacVim window can now also use the tabline's fill color as the window background color, which allows the title bar to show as a cohesive whole when transparent title bar is set. This creates a nice look especially when the colorscheme is designed for this. Other tab coloring changes: - Tabs now support high contrast mode (macOS accessibility setting) now. The default colors will use higher contrast colors, and in all modes, the tabs will be drawn with an outline similar to other system native UI to aid visual differentiation. - Tabs will also show a dimmed text color when the window has lost focus, similar to other native title bar / tool bar UI elements. - Fixed default colors to look a little better. Previously the fill color and unselected tab background colors were the same. --- runtime/doc/gui_mac.txt | 13 +- runtime/doc/tags | 3 +- src/MacVim/Base.lproj/Preferences.xib | 72 ++++++++--- src/MacVim/MMAppController.m | 5 +- src/MacVim/MMBackend.h | 1 + src/MacVim/MMBackend.m | 11 ++ src/MacVim/MMTabline/MMTab.m | 22 ++-- src/MacVim/MMTabline/MMTabline.h | 18 ++- src/MacVim/MMTabline/MMTabline.m | 164 +++++++++++++++++++------- src/MacVim/MMVimController.m | 20 ++++ src/MacVim/MMVimView.h | 3 + src/MacVim/MMVimView.m | 73 +++++++++++- src/MacVim/MMWindowController.h | 5 +- src/MacVim/MMWindowController.m | 65 +++++++++- src/MacVim/MacVim.h | 1 + src/MacVim/Miscellaneous.h | 15 ++- src/MacVim/Miscellaneous.m | 12 +- src/MacVim/gui_macvim.m | 44 ++++++- src/highlight.c | 6 + src/proto/gui_macvim.pro | 1 + 20 files changed, 461 insertions(+), 93 deletions(-) diff --git a/runtime/doc/gui_mac.txt b/runtime/doc/gui_mac.txt index df2644f4e2..619c88a314 100644 --- a/runtime/doc/gui_mac.txt +++ b/runtime/doc/gui_mac.txt @@ -310,11 +310,6 @@ KEY VALUE ~ *MMScrollOneDirectionOnly* scroll along one axis only when using trackpad [bool] *MMSmoothResize* allow smooth resizing of MacVim window [bool] *MMShareFindPboard* share search text to Find Pasteboard [bool] -*MMShowAddTabButton* enable "add tab" button on tabline [bool] -*MMShowTabScrollButtons* enable tab scroll buttons on tabline [bool] -*MMTabMinWidth* minimum width of a tab [int] -*MMTabOptimumWidth* default width of a tab [int] -*MMDefaultTablineColors* use default colors instead of colorscheme for tabs [bool] *MMTextInsetBottom* text area offset in pixels [int] *MMTextInsetLeft* text area offset in pixels [int] *MMTextInsetRight* text area offset in pixels [int] @@ -327,6 +322,14 @@ KEY VALUE ~ *MMUpdaterPrereleaseChannel* opt-in to pre-release software update [bool] *MMShowWhatsNewOnStartup* show "What's New" after updating to new version [bool] +Tabs ~ +*MMTabColorsMode* use default/auto/colorscheme for tab colors [int] +*MMWindowUseTabBackgroundColor* use tabs background fill color as window color [bool] +*MMShowAddTabButton* enable "add tab" button on tabline [bool] +*MMShowTabScrollButtons* enable tab scroll buttons on tabline [bool] +*MMTabMinWidth* minimum width of a tab [int] +*MMTabOptimumWidth* default width of a tab [int] + As an example, if you have more than one mouse button and would wish to free up Ctrl-click so you can bind it to something else, then the appropriate command is: > diff --git a/runtime/doc/tags b/runtime/doc/tags index d8b5f59472..b55d15bddf 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5645,7 +5645,6 @@ MMAllowForceClickLookUp gui_mac.txt /*MMAllowForceClickLookUp* MMAppearanceModeSelection gui_mac.txt /*MMAppearanceModeSelection* MMCellWidthMultiplier gui_mac.txt /*MMCellWidthMultiplier* MMCmdLineAlignBottom gui_mac.txt /*MMCmdLineAlignBottom* -MMDefaultTablineColors gui_mac.txt /*MMDefaultTablineColors* MMDialogsTrackPwd gui_mac.txt /*MMDialogsTrackPwd* MMDisableLaunchAnimation gui_mac.txt /*MMDisableLaunchAnimation* MMDisableTablineAnimation gui_mac.txt /*MMDisableTablineAnimation* @@ -5666,6 +5665,7 @@ MMShowAddTabButton gui_mac.txt /*MMShowAddTabButton* MMShowTabScrollButtons gui_mac.txt /*MMShowTabScrollButtons* MMShowWhatsNewOnStartup gui_mac.txt /*MMShowWhatsNewOnStartup* MMSmoothResize gui_mac.txt /*MMSmoothResize* +MMTabColorsMode gui_mac.txt /*MMTabColorsMode* MMTabMinWidth gui_mac.txt /*MMTabMinWidth* MMTabOptimumWidth gui_mac.txt /*MMTabOptimumWidth* MMTextInsetBottom gui_mac.txt /*MMTextInsetBottom* @@ -5678,6 +5678,7 @@ MMTranslateCtrlClick gui_mac.txt /*MMTranslateCtrlClick* MMUpdaterPrereleaseChannel gui_mac.txt /*MMUpdaterPrereleaseChannel* MMUseMouseTime gui_mac.txt /*MMUseMouseTime* MMVerticalSplit gui_mac.txt /*MMVerticalSplit* +MMWindowUseTabBackgroundColor gui_mac.txt /*MMWindowUseTabBackgroundColor* MMZoomBoth gui_mac.txt /*MMZoomBoth* MS-DOS os_msdos.txt /*MS-DOS* MS-Windows os_win32.txt /*MS-Windows* diff --git a/src/MacVim/Base.lproj/Preferences.xib b/src/MacVim/Base.lproj/Preferences.xib index 1aa2e8057d..893ae01353 100644 --- a/src/MacVim/Base.lproj/Preferences.xib +++ b/src/MacVim/Base.lproj/Preferences.xib @@ -280,11 +280,11 @@ - + - + @@ -345,11 +345,11 @@ - + - + @@ -358,7 +358,7 @@ + - - - - - - - - - @@ -535,7 +569,7 @@ - + @@ -622,7 +656,7 @@ - + diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index 1dd4ac5a4e..89d347609e 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -178,6 +178,9 @@ + (void)registerDefaults [NSNumber numberWithInt:210], MMTabOptimumWidthKey, [NSNumber numberWithBool:YES], MMShowAddTabButtonKey, [NSNumber numberWithBool:NO], MMShowTabScrollButtonsKey, + [NSNumber numberWithInt:MMTabColorsModeAutomatic], + MMTabColorsModeKey, + [NSNumber numberWithBool:NO], MMWindowUseTabBackgroundColorKey, [NSNumber numberWithInt:2], MMTextInsetLeftKey, [NSNumber numberWithInt:1], MMTextInsetRightKey, [NSNumber numberWithInt:1], MMTextInsetTopKey, @@ -1238,7 +1241,7 @@ - (void)refreshAllAppearances - (void)refreshAllTabProperties { for (MMVimController *vc in vimControllers) { - [vc.windowController.vimView refreshTabProperties]; + [vc.windowController refreshTabProperties]; } } diff --git a/src/MacVim/MMBackend.h b/src/MacVim/MMBackend.h index 6a730a0f3f..e8271f2ded 100644 --- a/src/MacVim/MMBackend.h +++ b/src/MacVim/MMBackend.h @@ -62,6 +62,7 @@ - (void)setBackgroundColor:(int)color; - (void)setForegroundColor:(int)color; - (void)setSpecialColor:(int)color; +- (void)setTablineColors:(int[6])colors; - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg; - (NSConnection *)connection; - (NSDictionary *)actionDict; diff --git a/src/MacVim/MMBackend.m b/src/MacVim/MMBackend.m index 9f38769967..0d35f841a3 100644 --- a/src/MacVim/MMBackend.m +++ b/src/MacVim/MMBackend.m @@ -293,6 +293,17 @@ - (void)setSpecialColor:(int)color specialColor = MM_COLOR(color); } +- (void)setTablineColors:(int[6])colors +{ + unsigned tabColors[6]; + for (int i = 0; i < 6; i++) { + tabColors[i] = MM_COLOR(colors[i]); + } + NSMutableData *data = [NSMutableData data]; + [data appendBytes:&tabColors length:sizeof(tabColors)]; + [self queueMessage:SetTablineColorsMsgID data:data]; +} + - (void)setDefaultColorsBackground:(int)bg foreground:(int)fg { defaultBackgroundColor = MM_COLOR_WITH_TRANSP(bg,p_transp); diff --git a/src/MacVim/MMTabline/MMTab.m b/src/MacVim/MMTabline/MMTab.m index 1b6de407a9..235af717dc 100644 --- a/src/MacVim/MMTabline/MMTab.m +++ b/src/MacVim/MMTabline/MMTab.m @@ -3,9 +3,10 @@ #import "MMTabline.h" #import "MMHoverButton.h" -#import "MacVim.h" // for availability macros +// Only imported for AVAILABLE_MAC_OS +#import "MacVim.h" -#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13 +#if !defined(MAC_OS_X_VERSION_10_13) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13 typedef NSString * NSAnimatablePropertyKey; #endif @@ -46,7 +47,7 @@ - (instancetype)initWithFrame:(NSRect)frameRect tabline:(MMTabline *)tabline [self addSubview:_closeButton]; _titleLabel = [NSTextField new]; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11 +#if defined(MAC_OS_X_VERSION_10_11) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11 if (AVAILABLE_MAC_OS(10,11)) { _titleLabel.font = [NSFont systemFontOfSize:NSFont.smallSystemFontSize weight:NSFontWeightSemibold]; } else @@ -109,27 +110,29 @@ - (void)setFillColor:(NSColor *)fillColor - (void)setState:(MMTabState)state { + const BOOL hasFocus = (self.window == nil) || [self.window isKeyWindow]; + // Transitions to and from MMTabStateSelected // DO NOT animate so that UX feels snappier. if (state == MMTabStateSelected) { _closeButton.fgColor = _tabline.tablineSelFgColor; - _titleLabel.textColor = _tabline.tablineSelFgColor; + _titleLabel.textColor = hasFocus ? _tabline.tablineSelFgColor : _tabline.tablineUnfocusedSelFgColor; self.fillColor = _tabline.tablineSelBgColor; } else if (state == MMTabStateUnselected) { if (_state == MMTabStateSelected) { _closeButton.fgColor = _tabline.tablineFgColor; - _titleLabel.textColor = _tabline.tablineFgColor; + _titleLabel.textColor = hasFocus ? _tabline.tablineFgColor : _tabline.tablineUnfocusedFgColor; self.fillColor = _tabline.tablineBgColor; } else { _closeButton.animator.fgColor = _tabline.tablineFgColor; - _titleLabel.animator.textColor = _tabline.tablineFgColor; + _titleLabel.animator.textColor = hasFocus ? _tabline.tablineFgColor : _tabline.tablineUnfocusedFgColor; self.animator.fillColor = _tabline.tablineBgColor; } } else { // state == MMTabStateUnselectedHover _closeButton.animator.fgColor = _tabline.tablineSelFgColor; - _titleLabel.animator.textColor = _tabline.tablineSelFgColor; + _titleLabel.animator.textColor = hasFocus ? _tabline.tablineSelFgColor : _tabline.tablineUnfocusedSelFgColor; self.animator.fillColor = self.unselectedHoverColor; } _state = state; @@ -164,6 +167,11 @@ - (void)drawRect:(NSRect)dirtyRect [p transformUsingAffineTransform:transform]; } [p fill]; + NSColor *strokeColor = _tabline.tablineStrokeColor; + if (strokeColor != nil) { + [strokeColor set]; + [p stroke]; + } } @end diff --git a/src/MacVim/MMTabline/MMTabline.h b/src/MacVim/MMTabline/MMTabline.h index a43be7828b..98bef13bdf 100644 --- a/src/MacVim/MMTabline/MMTabline.h +++ b/src/MacVim/MMTabline/MMTabline.h @@ -19,11 +19,18 @@ @property (nonatomic) BOOL useAnimation; @property (nonatomic, readonly) NSInteger numberOfTabs; @property (nonatomic, retain, readonly) MMHoverButton *addTabButton; + @property (nonatomic, retain) NSColor *tablineBgColor; @property (nonatomic, retain) NSColor *tablineFgColor; @property (nonatomic, retain) NSColor *tablineSelBgColor; @property (nonatomic, retain) NSColor *tablineSelFgColor; @property (nonatomic, retain) NSColor *tablineFillFgColor; + +// Derived colors that cannot be set directly +@property (nonatomic, readonly) NSColor *tablineUnfocusedFgColor; +@property (nonatomic, readonly) NSColor *tablineUnfocusedSelFgColor; +@property (nonatomic, readonly) NSColor *tablineStrokeColor; + @property (nonatomic, weak) id delegate; /// Add a tab at the end. It's not selected automatically. @@ -57,7 +64,16 @@ - (void)scrollTabToVisibleAtIndex:(NSInteger)index; - (void)scrollBackwardOneTab; - (void)scrollForwardOneTab; -- (void)setTablineSelBackground:(NSColor *)back foreground:(NSColor *)fore; + +/// Sets the colors used by this tab bar explicitly. Pass nil to use default +/// colors based on the system light/dark modes. +- (void)setColorsTabBg:(NSColor *)tabBg tabFg:(NSColor *)tabFg + selBg:(NSColor *)selBg selFg:(NSColor *)selFg + fill:(NSColor *)fill; + +/// Lets the tabline calculate best colors to use based on background and +/// foreground colors of the selected tab. The colors cannot be nil. +- (void)setAutoColorsSelBg:(NSColor *)back fg:(NSColor *)fore; @end diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m index ff90d46d01..605aa6b1f4 100644 --- a/src/MacVim/MMTabline/MMTabline.m +++ b/src/MacVim/MMTabline/MMTabline.m @@ -1,6 +1,8 @@ #import #import #import "MMTabline.h" + +// Only imported for getCurrentAppearance() #import "Miscellaneous.h" typedef struct TabWidth { @@ -26,9 +28,20 @@ return button; } -static BOOL isDarkMode(NSAppearance *appearance) { - int flags = getCurrentAppearance(appearance); - return (flags == 1 || flags == 3); +static CGFloat calculateBrightness(NSColor *color) { + if (color.colorSpace.colorSpaceModel == NSColorSpaceModelRGB) { + // Calculate brightness according to a formula from + // the W3C that gives brightness as the eye perceives it. Then lighten + // or darken the default colors based on whether brightness is greater + // than 50% to achieve good visual contrast. + // www.w3.org/WAI/ER/WD-AERT/#color-contrast + CGFloat r, g, b; + [color getRed:&r green:&g blue:&b alpha:NULL]; + return r * 0.299 + g * 0.114 + b * 0.587; + } else if (color.colorSpace.colorSpaceModel == NSColorSpaceModelGray) { + return color.whiteComponent; + } + return 1; } @implementation MMTabline @@ -47,6 +60,7 @@ @implementation MMTabline MMHoverButton *_backwardScrollButton; MMHoverButton *_forwardScrollButton; id _scrollWheelEventMonitor; + AppearanceType _appearance; // cached appearance to avoid querying it every time } @synthesize tablineBgColor = _tablineBgColor; @@ -54,6 +68,8 @@ @implementation MMTabline @synthesize tablineSelBgColor = _tablineSelBgColor; @synthesize tablineSelFgColor = _tablineSelFgColor; @synthesize tablineFillFgColor = _tablineFillFgColor; +@synthesize tablineUnfocusedFgColor = _tablineUnfocusedFgColor; +@synthesize tablineUnfocusedSelFgColor = _tablineUnfocusedSelFgColor; - (instancetype)initWithFrame:(NSRect)frameRect { @@ -111,11 +127,15 @@ - (instancetype)initWithFrame:(NSRect)frameRect [self addConstraint:_addTabButtonTrailingConstraint]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didScroll:) name:NSViewBoundsDidChangeNotification object:_scrollView.contentView]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateTabStates) name:NSWindowDidBecomeKeyNotification object:self.window]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateTabStates) name:NSWindowDidResignKeyNotification object:self.window]; if ([self useRightToLeft]) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateTabsContainerBoundsForRTL:) name:NSViewFrameDidChangeNotification object:_tabsContainer]; } [self addScrollWheelMonitor]; + + _appearance = getCurrentAppearance(self.effectiveAppearance); } return self; } @@ -135,7 +155,8 @@ - (void)updateLayer - (void)viewDidChangeEffectiveAppearance { - for (MMTab *tab in _tabs) tab.state = tab.state; + _appearance = getCurrentAppearance(self.effectiveAppearance); + [self updateTabStates]; } - (void)viewDidHide @@ -217,39 +238,50 @@ - (void)setShowsTabScrollButtons:(BOOL)showsTabScrollButtons - (NSColor *)tablineBgColor { - return _tablineBgColor ?: isDarkMode(self.effectiveAppearance) - ? [NSColor colorWithWhite:0.2 alpha:1] - : [NSColor colorWithWhite:0.8 alpha:1]; + if (_tablineBgColor != nil) + return _tablineBgColor; + switch (_appearance) { + case AppearanceLight: + default: + return [NSColor colorWithWhite:0.8 alpha:1]; + case AppearanceDark: + return [NSColor colorWithWhite:0.2 alpha:1]; + case AppearanceLightHighContrast: + return [NSColor colorWithWhite:0.7 alpha:1]; + case AppearanceDarkHighContrast: + return [NSColor colorWithWhite:0.15 alpha:1]; + } } - (void)setTablineBgColor:(NSColor *)color { _tablineBgColor = color; - for (MMTab *tab in _tabs) tab.state = tab.state; + [self updateTabStates]; } - (NSColor *)tablineFgColor { - return _tablineFgColor ?: NSColor.disabledControlTextColor; + return _tablineFgColor ?: NSColor.secondaryLabelColor; } - (void)setTablineFgColor:(NSColor *)color { _tablineFgColor = color; - for (MMTab *tab in _tabs) tab.state = tab.state; + _tablineUnfocusedFgColor = nil; + [self updateTabStates]; } - (NSColor *)tablineSelBgColor { - return _tablineSelBgColor ?: isDarkMode(self.effectiveAppearance) - ? [NSColor colorWithWhite:0.4 alpha:1] - : NSColor.whiteColor; + return _tablineSelBgColor ?: (_appearance == AppearanceLight || _appearance == AppearanceLightHighContrast) + ? [NSColor colorWithWhite:0.95 alpha:1] + : [NSColor colorWithWhite:0.4 alpha:1]; } - (void)setTablineSelBgColor:(NSColor *)color { _tablineSelBgColor = color; - for (MMTab *tab in _tabs) tab.state = tab.state; + [self updateTabStates]; } - (NSColor *)tablineSelFgColor @@ -260,17 +292,18 @@ - (NSColor *)tablineSelFgColor - (void)setTablineSelFgColor:(NSColor *)color { _tablineSelFgColor = color; + _tablineUnfocusedSelFgColor = nil; _addTabButton.fgColor = color; _backwardScrollButton.fgColor = color; _forwardScrollButton.fgColor = color; - for (MMTab *tab in _tabs) tab.state = tab.state; + [self updateTabStates]; } - (NSColor *)tablineFillFgColor { - return _tablineFillFgColor ?: isDarkMode(self.effectiveAppearance) - ? [NSColor colorWithWhite:0.2 alpha:1] - : [NSColor colorWithWhite:0.8 alpha:1]; + return _tablineFillFgColor ?: (_appearance == AppearanceLight || _appearance == AppearanceLightHighContrast) + ? [NSColor colorWithWhite:0.85 alpha:1] + : [NSColor colorWithWhite:0.23 alpha:1]; } - (void)setTablineFillFgColor:(NSColor *)color @@ -279,6 +312,30 @@ - (void)setTablineFillFgColor:(NSColor *)color self.needsDisplay = YES; } +- (NSColor *)tablineUnfocusedFgColor +{ + return _tablineUnfocusedFgColor ?: _tablineFgColor ?: NSColor.tertiaryLabelColor; +} + +- (NSColor *)tablineUnfocusedSelFgColor +{ + return _tablineUnfocusedSelFgColor ?: _tablineSelFgColor ?: NSColor.tertiaryLabelColor; +} + +- (NSColor *)tablineStrokeColor +{ + if (_appearance == AppearanceLight || _appearance == AppearanceDark) + return nil; // non-high-contrast modes + + // High-contrast modes. Should stroke to make it easier to read. + NSColor *bgColor = self.tablineBgColor; + CGFloat brightness = calculateBrightness(bgColor); + if (brightness > 0.5) + return NSColor.blackColor; + else + return NSColor.whiteColor; +} + - (NSInteger)addTabAtEnd { return [self addTabAtIndex:(_tabs.count ? _tabs.count : 0)]; @@ -511,43 +568,59 @@ - (MMTab *)tabAtIndex:(NSInteger)index return _tabs[index]; } -- (void)setTablineSelBackground:(NSColor *)back foreground:(NSColor *)fore +- (void)setColorsTabBg:(NSColor *)tabBg tabFg:(NSColor *)tabFg + selBg:(NSColor *)selBg selFg:(NSColor *)selFg + fill:(NSColor *)fill { - // Reset to default tabline colors if user doesn't want auto-generated ones. - if ([NSUserDefaults.standardUserDefaults boolForKey:@"MMDefaultTablineColors"]) { - self.tablineBgColor = nil; - self.tablineFgColor = nil; - self.tablineSelBgColor = nil; - self.tablineSelFgColor = nil; - self.tablineFillFgColor = nil; - return; - } + // Don't use the property mutators as we just want to update the states in + // one go at the end. + _tablineSelBgColor = selBg; + _tablineSelFgColor = selFg; + _tablineBgColor = tabBg; + _tablineFgColor = tabFg; + _tablineFillFgColor = fill; + + _tablineUnfocusedFgColor = [_tablineFgColor blendedColorWithFraction:0.4 ofColor:_tablineBgColor]; + _tablineUnfocusedSelFgColor = [_tablineSelFgColor blendedColorWithFraction:0.38 ofColor:_tablineSelBgColor]; + + _addTabButton.fgColor = _tablineSelFgColor; + _backwardScrollButton.fgColor = _tablineSelFgColor; + _forwardScrollButton.fgColor = _tablineSelFgColor; + + [self updateTabStates]; + self.needsDisplay = YES; +} +- (void)setAutoColorsSelBg:(NSColor *)back fg:(NSColor *)fore; +{ // Set the colors for the tabline based on the default background and - // foreground colors. Calculate brightness according to a formula from - // the W3C that gives brightness as the eye perceives it. Then lighten - // or darken the default colors based on whether brightness is greater - // than 50% to achieve good visual contrast. - // www.w3.org/WAI/ER/WD-AERT/#color-contrast - CGFloat r, g, b, brightness; - [back getRed:&r green:&g blue:&b alpha:NULL]; - brightness = r * 0.299 + g * 0.114 + b * 0.587; - - self.tablineSelBgColor = back; + // foreground colors. + const CGFloat brightness = calculateBrightness(back); - self.tablineSelFgColor = (brightness > 0.5) + _tablineSelBgColor = back; + + _tablineSelFgColor = (brightness > 0.5) ? [fore blendedColorWithFraction:0.6 ofColor:NSColor.blackColor] : [fore blendedColorWithFraction:0.6 ofColor:NSColor.whiteColor]; + _addTabButton.fgColor = _tablineSelFgColor; + _backwardScrollButton.fgColor = _tablineSelFgColor; + _forwardScrollButton.fgColor = _tablineSelFgColor; - self.tablineBgColor = (brightness > 0.5) + _tablineBgColor = (brightness > 0.5) ? [back blendedColorWithFraction:0.16 ofColor:NSColor.blackColor] : [back blendedColorWithFraction:0.13 ofColor:NSColor.whiteColor]; - self.tablineFgColor = [self.tablineSelFgColor blendedColorWithFraction:0.5 ofColor:self.tablineBgColor]; + _tablineFgColor = [_tablineSelFgColor blendedColorWithFraction:0.5 ofColor:_tablineBgColor]; + + _tablineUnfocusedFgColor = [_tablineFgColor blendedColorWithFraction:0.4 ofColor:_tablineBgColor]; + _tablineUnfocusedSelFgColor = [_tablineSelFgColor blendedColorWithFraction:0.38 ofColor:_tablineSelBgColor]; - self.tablineFillFgColor = (brightness > 0.5) + _tablineFillFgColor = (brightness > 0.5) ? [back blendedColorWithFraction:0.25 ofColor:NSColor.blackColor] : [back blendedColorWithFraction:0.18 ofColor:NSColor.whiteColor]; + + [self updateTabStates]; + self.needsDisplay = YES; } #pragma mark - Helpers @@ -740,6 +813,11 @@ - (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate [self fixupLayoutWithAnimation:shouldAnimate delayResize:NO]; } +- (void)updateTabStates +{ + for (MMTab *tab in _tabs) tab.state = tab.state; +} + #pragma mark - Right-to-left (RTL) support - (BOOL)useRightToLeft @@ -943,7 +1021,7 @@ - (void)scrollTabToVisibleAtIndex:(NSInteger)index // faster animations. For example, the user might hold down the tab // scrolling buttons (causing them to repeatedly fire) or they might // rapidly click them. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 +#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 static NSTimeInterval lastTime = 0; struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); diff --git a/src/MacVim/MMVimController.m b/src/MacVim/MMVimController.m index df12bfa0f4..12fa382f12 100644 --- a/src/MacVim/MMVimController.m +++ b/src/MacVim/MMVimController.m @@ -968,6 +968,26 @@ - (void)handleMessage:(int)msgid data:(NSData *)data } } break; + case SetTablineColorsMsgID: + { + const void *bytes = [data bytes]; + unsigned argbTabBg = *((unsigned*)bytes); bytes += sizeof(unsigned); + unsigned argbTabFg = *((unsigned*)bytes); bytes += sizeof(unsigned); + unsigned argbFillBg = *((unsigned*)bytes); bytes += sizeof(unsigned); + unsigned argbFillFg = *((unsigned*)bytes); bytes += sizeof(unsigned); + unsigned argbSelBg = *((unsigned*)bytes); bytes += sizeof(unsigned); + unsigned argbSelFg = *((unsigned*)bytes); bytes += sizeof(unsigned); + + NSColor *tabBg = [NSColor colorWithRgbInt:argbTabBg]; + NSColor *tabFg = [NSColor colorWithRgbInt:argbTabFg]; + NSColor *fillBg = [NSColor colorWithRgbInt:argbFillBg]; + NSColor *fillFg = [NSColor colorWithRgbInt:argbFillFg]; + NSColor *selBg = [NSColor colorWithRgbInt:argbSelBg]; + NSColor *selFg = [NSColor colorWithRgbInt:argbSelFg]; + + [windowController setTablineColorsTabBg:tabBg tabFg:tabFg fillBg:fillBg fillFg:fillFg selBg:selBg selFg:selFg]; + } + break; case SetDefaultColorsMsgID: { const void *bytes = [data bytes]; diff --git a/src/MacVim/MMVimView.h b/src/MacVim/MMVimView.h index d29b75c63c..f1a49009b3 100644 --- a/src/MacVim/MMVimView.h +++ b/src/MacVim/MMVimView.h @@ -60,6 +60,9 @@ - (void)finishPlaceScrollbars; - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore; +- (void)setTablineColorsTabBg:(NSColor *)tabBg tabFg:(NSColor *)tabFg + fillBg:(NSColor *)fillBg fillFg:(NSColor *)fillFg + selBg:(NSColor *)selBg selFg:(NSColor *)selFg; - (void)viewWillStartLiveResize; - (void)viewDidEndLiveResize; diff --git a/src/MacVim/MMVimView.m b/src/MacVim/MMVimView.m index 96c6273094..9a7a5a4781 100644 --- a/src/MacVim/MMVimView.m +++ b/src/MacVim/MMVimView.m @@ -35,6 +35,15 @@ MMScrollerTypeBottom }; +typedef enum: NSInteger { + MMTabColorTypeTabBg = 0, + MMTabColorTypeTabFg, + MMTabColorTypeSelBg, + MMTabColorTypeSelFg, + MMTabColorTypeFill, + MMTabColorTypeCount +} MMTabColorType; + // TODO: Move! @interface MMScroller : NSScroller { @@ -72,6 +81,9 @@ - (void)liveResizeDidEnd; @implementation MMVimView +{ + NSColor *tabColors[MMTabColorTypeCount]; +} - (MMVimView *)initWithFrame:(NSRect)frame vimController:(MMVimController *)controller @@ -133,6 +145,9 @@ - (void)dealloc [tabline release]; [scrollbars release]; scrollbars = nil; + for (NSUInteger i = 0; i < MMTabColorTypeCount; i++) + [tabColors[i] release]; + // HACK! The text storage is the principal owner of the text system, but we // keep only a reference to the text view, so release the text storage // first (unless we are using the CoreText renderer). @@ -362,6 +377,7 @@ - (void)refreshTabProperties { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; tabline.showsTabScrollButtons = [ud boolForKey:MMShowTabScrollButtonsKey]; + [self updateTablineColors]; } - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type @@ -453,11 +469,36 @@ - (void)finishPlaceScrollbars } } +- (void)updateTablineColors +{ + NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; + MMTabColorsMode tabColorsMode = [ud integerForKey:MMTabColorsModeKey]; + if (tabColorsMode == MMTabColorsModeDefaultColors) { + [tabline setColorsTabBg:nil + tabFg:nil + selBg:nil + selFg:nil + fill:nil]; + } else if (tabColorsMode == MMTabColorsModeVimColorscheme) { + [tabline setColorsTabBg:tabColors[MMTabColorTypeTabBg] + tabFg:tabColors[MMTabColorTypeTabFg] + selBg:tabColors[MMTabColorTypeSelBg] + selFg:tabColors[MMTabColorTypeSelFg] + fill:tabColors[MMTabColorTypeFill]]; + } else { + // tabColorsMode == MMTabColorsModeAutomatic, but catch-all in case it's + // set to an out-of-range number. + NSColor *back = [[self textView] defaultBackgroundColor]; + NSColor *fore = [[self textView] defaultForegroundColor]; + [tabline setAutoColorsSelBg:back fg:fore]; + } + +} + - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore { [textView setDefaultColorsBackground:back foreground:fore]; - - [tabline setTablineSelBackground:back foreground:fore]; + [self updateTablineColors]; CALayer *backedLayer = [self layer]; if (backedLayer) { @@ -476,6 +517,21 @@ - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore [self setNeedsDisplay:YES]; } +- (void)setTablineColorsTabBg:(NSColor *)tabBg tabFg:(NSColor *)tabFg + fillBg:(NSColor *)fillBg fillFg:(NSColor *)fillFg + selBg:(NSColor *)selBg selFg:(NSColor *)selFg +{ + for (NSUInteger i = 0; i < MMTabColorTypeCount; i++) + [tabColors[i] release]; + tabColors[MMTabColorTypeTabBg] = [tabBg retain]; + tabColors[MMTabColorTypeTabFg] = [tabFg retain]; + tabColors[MMTabColorTypeSelBg] = [selBg retain]; + tabColors[MMTabColorTypeSelFg] = [selFg retain]; + tabColors[MMTabColorTypeFill] = [fillBg retain]; + (void)fillFg; // We don't use fillFg as we don't draw anything in the empty area + [self updateTablineColors]; +} + // -- MMTablineDelegate ---------------------------------------------- @@ -594,6 +650,19 @@ - (void)setFrame:(NSRect)frame - (void)viewDidChangeEffectiveAppearance { [vimController appearanceChanged:getCurrentAppearance(self.effectiveAppearance)]; + + NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; + if ([ud integerForKey:MMTabColorsModeKey] == MMTabColorsModeDefaultColors && + [ud boolForKey:MMWindowUseTabBackgroundColorKey]) + { + // Tab line default colors depends on system light/dark modes. We will + // need to notify the window as well if it is set up to use the tab bar + // colors. We need to schedule this for later because the tabline's + // effectAppearance gets changed *after* this method is called, so we + // need to delay the refresh or we would get stale data. + MMWindowController *winController = [vimController windowController]; + [winController performSelectorOnMainThread:@selector(refreshTabProperties) withObject:nil waitUntilDone:NO]; + } } @end // MMVimView diff --git a/src/MacVim/MMWindowController.h b/src/MacVim/MMWindowController.h index df932f0e98..544385f8c2 100644 --- a/src/MacVim/MMWindowController.h +++ b/src/MacVim/MMWindowController.h @@ -84,7 +84,10 @@ - (void)setBackgroundOption:(int)dark; - (void)refreshApperanceMode; - (void)updateResizeConstraints:(BOOL)resizeWindow; - +- (void)setTablineColorsTabBg:(NSColor *)tabBg tabFg:(NSColor *)tabFg + fillBg:(NSColor *)fillBg fillFg:(NSColor *)fillFg + selBg:(NSColor *)selBg selFg:(NSColor *)selFg; +- (void)refreshTabProperties; - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore; - (void)setFont:(NSFont *)font; - (void)setWideFont:(NSFont *)font; diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index e062796052..a583aa395f 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -71,6 +71,7 @@ #import "MMWindow.h" #import "MMWindowController.h" #import "Miscellaneous.h" +#import "MMTabline/MMTabline.h" // These have to be the same as in option.h @@ -672,11 +673,61 @@ - (void)refreshApperanceMode #endif } +- (void)setTablineColorsTabBg:(NSColor *)tabBg tabFg:(NSColor *)tabFg + fillBg:(NSColor *)fillBg fillFg:(NSColor *)fillFg + selBg:(NSColor *)selBg selFg:(NSColor *)selFg +{ + [vimView setTablineColorsTabBg:tabBg tabFg:tabFg fillBg:fillBg fillFg:fillFg selBg:selBg selFg:selFg]; + + if([[NSUserDefaults standardUserDefaults] boolForKey:MMWindowUseTabBackgroundColorKey]) { + if (!vimView.tabline.hidden) { + [self setWindowColorToTablineColor]; + } + } +} + +- (void)setWindowColorToTablineColor +{ + NSColor *defaultBg = vimView.textView.defaultBackgroundColor; + NSColor *tablineColor = vimView.tabline.tablineFillFgColor; + if (defaultBg.alphaComponent == 1.0) { + [self setWindowBackgroundColor:tablineColor]; + } else { + // Make sure 'transparency' Vim setting is preserved + NSColor *colorWithAlpha = [tablineColor colorWithAlphaComponent:defaultBg.alphaComponent]; + [self setWindowBackgroundColor:colorWithAlpha]; + } +} + +- (void)refreshTabProperties +{ + [vimView refreshTabProperties]; + NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; + if([ud boolForKey:MMWindowUseTabBackgroundColorKey] && !vimView.tabline.hidden) { + [self setWindowColorToTablineColor]; + } else { + [self setWindowBackgroundColor:vimView.textView.defaultBackgroundColor]; + } +} + - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore +{ + [vimView setDefaultColorsBackground:back foreground:fore]; + if([[NSUserDefaults standardUserDefaults] boolForKey:MMWindowUseTabBackgroundColorKey] && + !vimView.tabline.hidden) + { + [self setWindowColorToTablineColor]; + } + else { + [self setWindowBackgroundColor:back]; + } +} + +- (void)setWindowBackgroundColor:(NSColor *)back { // NOTE: This is called when the transparency changes so set the opacity // flag on the window here (should be faster if the window is opaque). - BOOL isOpaque = [back alphaComponent] == 1.0f; + const BOOL isOpaque = [back alphaComponent] == 1.0f; [decoratedWindow setOpaque:isOpaque]; if (fullScreenWindow) [fullScreenWindow setOpaque:isOpaque]; @@ -727,7 +778,7 @@ - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore // but if we are toggling the titlebar transparent option, we need to set // the window background color in order the title bar to be tinted correctly. if ([[NSUserDefaults standardUserDefaults] - boolForKey:MMTitlebarAppearsTransparentKey]) { + boolForKey:MMTitlebarAppearsTransparentKey]) { if ([back alphaComponent] != 0) { [decoratedWindow setBackgroundColor:back]; } else { @@ -739,8 +790,6 @@ - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore } } } - - [vimView setDefaultColorsBackground:back foreground:fore]; } - (void)setFont:(NSFont *)font @@ -871,6 +920,14 @@ - (void)showTabline:(BOOL)on [vimView showTabline:on]; [self updateTablineSeparator]; shouldMaximizeWindow = YES; + + if([[NSUserDefaults standardUserDefaults] boolForKey:MMWindowUseTabBackgroundColorKey]) { + if (on) { + [self setWindowColorToTablineColor]; + } else { + [self setWindowBackgroundColor:vimView.textView.defaultBackgroundColor]; + } + } } - (void)showToolbar:(BOOL)on size:(int)size mode:(int)mode diff --git a/src/MacVim/MacVim.h b/src/MacVim/MacVim.h index 515ebe8355..aa12b8c575 100644 --- a/src/MacVim/MacVim.h +++ b/src/MacVim/MacVim.h @@ -301,6 +301,7 @@ extern const char * const MMVimMsgIDStrings[]; MSG(SetWideFontMsgID) \ MSG(VimShouldCloseMsgID) \ MSG(SetDefaultColorsMsgID) \ + MSG(SetTablineColorsMsgID) \ MSG(ExecuteActionMsgID) \ MSG(DropFilesMsgID) \ MSG(DropStringMsgID) \ diff --git a/src/MacVim/Miscellaneous.h b/src/MacVim/Miscellaneous.h index 0d297dd094..a247b3f647 100644 --- a/src/MacVim/Miscellaneous.h +++ b/src/MacVim/Miscellaneous.h @@ -23,6 +23,8 @@ extern NSString *MMTabMaxWidthKey; extern NSString *MMTabOptimumWidthKey; extern NSString *MMShowAddTabButtonKey; extern NSString *MMShowTabScrollButtonsKey; +extern NSString *MMTabColorsModeKey; +extern NSString *MMWindowUseTabBackgroundColorKey; extern NSString *MMTextInsetLeftKey; extern NSString *MMTextInsetRightKey; extern NSString *MMTextInsetTopKey; @@ -104,6 +106,11 @@ enum MMAppearanceModeSelectionEnum { MMAppearanceModeSelectionBackgroundOption = 3, }; +typedef enum : NSInteger { + MMTabColorsModeDefaultColors = 0, ///< Use default colors based on macOS light/dark modes + MMTabColorsModeAutomatic, ///< Automatically derive tab colors based on foreground/background colors + MMTabColorsModeVimColorscheme, ///< Use Vim colorscheme TabLine/TabLineSel/TabLineFill colors +} MMTabColorsMode; enum { // These values are chosen so that the min text view size is not too small @@ -174,7 +181,13 @@ NSView *showHiddenFilesView(void); NSString *normalizeFilename(NSString *filename); NSArray *normalizeFilenames(NSArray *filenames); -int getCurrentAppearance(NSAppearance *appearance); +typedef enum : int { + AppearanceLight = 0, + AppearanceDark, + AppearanceLightHighContrast, + AppearanceDarkHighContrast, +} AppearanceType; +AppearanceType getCurrentAppearance(NSAppearance *appearance); // Pasteboard helpers NSPasteboardType getPasteboardFilenamesType(void); diff --git a/src/MacVim/Miscellaneous.m b/src/MacVim/Miscellaneous.m index 0b1e0523e2..17e9304238 100644 --- a/src/MacVim/Miscellaneous.m +++ b/src/MacVim/Miscellaneous.m @@ -19,6 +19,8 @@ NSString *MMTabOptimumWidthKey = @"MMTabOptimumWidth"; NSString *MMShowAddTabButtonKey = @"MMShowAddTabButton"; NSString *MMShowTabScrollButtonsKey = @"MMShowTabScrollButtons"; +NSString *MMTabColorsModeKey = @"MMTabColorsMode"; +NSString *MMWindowUseTabBackgroundColorKey = @"MMWindowUseTabBackgroundColor"; NSString *MMTextInsetLeftKey = @"MMTextInsetLeft"; NSString *MMTextInsetRightKey = @"MMTextInsetRight"; NSString *MMTextInsetTopKey = @"MMTextInsetTop"; @@ -305,9 +307,9 @@ - (NSInteger)tag -int +AppearanceType getCurrentAppearance(NSAppearance *appearance){ - int flag = 0; // for macOS 10.13 or earlier always return 0; + int flag = AppearanceLight; // for macOS 10.13 or earlier always return 0; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 if (@available(macOS 10.14, *)) { NSAppearanceName appearanceName = [appearance bestMatchFromAppearancesWithNames: @@ -316,11 +318,11 @@ - (NSInteger)tag , NSAppearanceNameAccessibilityHighContrastAqua , NSAppearanceNameAccessibilityHighContrastDarkAqua]]; if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua]) { - flag = 1; + flag = AppearanceDark; } else if ([appearanceName isEqualToString:NSAppearanceNameAccessibilityHighContrastAqua]) { - flag = 2; + flag = AppearanceLightHighContrast; } else if ([appearanceName isEqualToString:NSAppearanceNameAccessibilityHighContrastDarkAqua]) { - flag = 3; + flag = AppearanceDarkHighContrast; } } #endif diff --git a/src/MacVim/gui_macvim.m b/src/MacVim/gui_macvim.m index 3538acbbae..0d030f04ca 100644 --- a/src/MacVim/gui_macvim.m +++ b/src/MacVim/gui_macvim.m @@ -633,6 +633,17 @@ ASLogDebug(@"back=%ld norm=%ld", gui.def_back_pixel, gui.def_norm_pixel); + [[MMBackend sharedInstance] + setDefaultColorsBackground:gui.def_back_pixel + foreground:gui.def_norm_pixel]; +} + +/* + * Called when any highlight has been changed in general + */ + void +gui_mch_update_highlight(void) +{ // If using a highlight group for fullscreen background color we need to // update the app when a new color scheme has been picked. This function // technically wouldn't be called if a user manually set the relevant @@ -641,9 +652,34 @@ if (fuoptions_flags & FUOPT_BGCOLOR_HLGROUP) gui_mch_fuopt_update(); - [[MMBackend sharedInstance] - setDefaultColorsBackground:gui.def_back_pixel - foreground:gui.def_norm_pixel]; + // Update the GUI with tab colors + // We can cache the tabline syn IDs because they will never change. + static int tablineSynIds[3] = { 0 }; + char *tablineSynNames[3] = {"TabLine", "TabLineFill", "TabLineSel"}; + + BOOL hasTablineColors = YES; + int tablineColors[6] = { 0 }; + for (int i = 0; i < 3; i++) { + if (tablineSynIds[i] <= 0) + tablineSynIds[i] = syn_name2id((char_u *)tablineSynNames[i]); + if (tablineSynIds[i] > 0) { + guicolor_T bg, fg; + syn_id2colors(tablineSynIds[i], &fg, &bg); + tablineColors[i*2] = (int)bg; + tablineColors[i*2+1] = (int)fg; + } else { + hasTablineColors = NO; + } + } + if (hasTablineColors) { + // Cache the old colors just so we don't spam the IPC channel if the + // colors didn't actually change. + static int oldTablineColors[6] = { 0 }; + if (memcmp(oldTablineColors, tablineColors, sizeof(oldTablineColors)) != 0) { + memcpy(oldTablineColors, tablineColors, sizeof(oldTablineColors)); + [[MMBackend sharedInstance] setTablineColors:tablineColors]; + } + } } /* @@ -1995,6 +2031,8 @@ { if (!gui.in_use) return; + if (!p_fullscreen) + return; guicolor_T fg, bg; if (fuoptions_flags & FUOPT_BGCOLOR_HLGROUP) { diff --git a/src/highlight.c b/src/highlight.c index a04f158e09..0bf781ab9b 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -4069,6 +4069,12 @@ highlight_changed(void) #endif // USER_HIGHLIGHT +#if defined(FEAT_GUI) && defined(FEAT_GUI_MACVIM) + // MacVim needs to know about the other highlight colors other than just + // the default fg/bg colors. + if (gui.in_use) + gui_mch_update_highlight(); +#endif return OK; } diff --git a/src/proto/gui_macvim.pro b/src/proto/gui_macvim.pro index 869727d044..7d27521d5d 100644 --- a/src/proto/gui_macvim.pro +++ b/src/proto/gui_macvim.pro @@ -63,6 +63,7 @@ int gui_mch_haskey(char_u *name); void gui_mch_iconify(void); void gui_mch_invert_rectangle(int r, int c, int nr, int nc, int invert); void gui_mch_new_colors(void); +void gui_mch_update_highlight(void); void gui_mch_set_bg_color(guicolor_T color); int gui_mch_is_blinking(void); int gui_mch_is_blink_off(void); From 65c9fc5775715518b8d068425171d421e1386170 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Sat, 1 Feb 2025 00:20:59 -0800 Subject: [PATCH 91/93] ci: Don't run Vim non-src tests (indent/syntax etc) Currently Vim syntax tests are quite broken and keep failing in MacVim CI. There seems to be some Unicode / emoji handling bug causing tests to fail sporadically, and the syntax tests also spam the console output as they aren't redirecting output to /dev/null like normal Vim script tests. Just disable them for now until this is fixed. This should not cause much issues anyway. It's unlike MacVim will have any downstream syntax/indent bugs as those files are mostly merged from upstream as-is. --- .github/workflows/ci-macvim.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-macvim.yaml b/.github/workflows/ci-macvim.yaml index bc0ce94600..71a386d54c 100644 --- a/.github/workflows/ci-macvim.yaml +++ b/.github/workflows/ci-macvim.yaml @@ -375,14 +375,17 @@ jobs: - name: Test Vim if: startsWith(github.ref, 'refs/tags/') || !matrix.testgui - timeout-minutes: 25 + timeout-minutes: 30 run: | defaults delete org.vim.MacVim # Clean up stale states - make ${MAKE_BUILD_ARGS} test + # Currently we don't run any non-src tests, as syntax tests are fragile and prone to spamming escape codes. + # This needs to be investigated and fixed upstream. + # MacVim is unlikely to introduce breaking changes in runtime files anyway. + make ${MAKE_BUILD_ARGS} -C src test - name: Test Vim (GUI) if: startsWith(github.ref, 'refs/tags/') || matrix.testgui - timeout-minutes: 25 + timeout-minutes: 30 run: | defaults delete org.vim.MacVim # Clean up stale states make ${MAKE_BUILD_ARGS} -C src/testdir clean From 28bae8cefb9b85b9521e3cac30d7371153f01b00 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Sat, 1 Feb 2025 03:04:34 -0800 Subject: [PATCH 92/93] Don't sign PSMTabBarControl in code signing This has been removed and replaced by MMTabline which isn't a separate framework. --- src/MacVim/scripts/sign-developer-id | 1 - 1 file changed, 1 deletion(-) diff --git a/src/MacVim/scripts/sign-developer-id b/src/MacVim/scripts/sign-developer-id index 5deca2fabe..59cabea185 100755 --- a/src/MacVim/scripts/sign-developer-id +++ b/src/MacVim/scripts/sign-developer-id @@ -40,7 +40,6 @@ else codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework") fi set -x - codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/PSMTabBarControl.framework" codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Library/QuickLook/QLStephen.qlgenerator/Contents/MacOS/QLStephen" codesign -f -s "Developer ID Application" -o runtime --timestamp --entitlements $entitlements "$macvim_path/Contents/bin/xxd" codesign -f -s "Developer ID Application" -o runtime --timestamp --entitlements $entitlements "$macvim_path/Contents/MacOS/Vim" From 8ac49d696a7cb59f7bbadb6e25661b2821fb601e Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Fri, 31 Jan 2025 21:26:27 -0800 Subject: [PATCH 93/93] MacVim r180.2 (prerelease) Updated to Vim 9.1.1050 --- src/MacVim/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MacVim/Info.plist b/src/MacVim/Info.plist index 4a21ea5bd9..b6fac60005 100644 --- a/src/MacVim/Info.plist +++ b/src/MacVim/Info.plist @@ -1255,7 +1255,7 @@ CFBundleVersion - 180.1 + 180.2 LSApplicationCategoryType public.app-category.productivity NSAppTransportSecurity