Skip to content

Commit 841c6ab

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 4dd814b + e764d1b commit 841c6ab

Some content is hidden

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

111 files changed

+3737
-3116
lines changed

runtime/doc/builtin.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,7 +2996,7 @@ funcref({name} [, {arglist}] [, {dict}])
29962996
Can also be used as a |method|: >
29972997
GetFuncname()->funcref([arg])
29982998
<
2999-
*function()* *partial* *E700* *E922* *E923*
2999+
*function()* *partial* *E700* *E923*
30003000
function({name} [, {arglist}] [, {dict}])
30013001
Return a |Funcref| variable that refers to function {name}.
30023002
{name} can be the name of a user defined function or an
@@ -8665,8 +8665,9 @@ sort({list} [, {how} [, {dict}]]) *sort()* *E702*
86658665

86668666
When {how} is given and it is 'n' then all items will be
86678667
sorted numerical (Implementation detail: this uses the
8668-
strtod() function to parse numbers, Strings, Lists, Dicts and
8669-
Funcrefs will be considered as being 0).
8668+
strtod() function to parse numbers. Strings, Lists, Dicts and
8669+
Funcrefs will be considered as being 0). Note that this won't
8670+
sort a list of strings with numbers!
86708671

86718672
When {how} is given and it is 'N' then all items will be
86728673
sorted numerical. This is like 'n' but a string containing

runtime/doc/options.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4290,6 +4290,8 @@ A jump table for the options with a short description can be found at |Q_op|.
42904290
T:DiffText,>:SignColumn,-:Conceal,
42914291
B:SpellBad,P:SpellCap,R:SpellRare,
42924292
L:SpellLocal,+:Pmenu,=:PmenuSel,
4293+
[:PmenuKind,]:PmenuKindSel,
4294+
{:PmenuExtra,}:PmenuExtraSel,
42934295
x:PmenuSbar,X:PmenuThumb,*:TabLine,
42944296
#:TabLineSel,_:TabLineFill,!:CursorColumn,
42954297
.:CursorLine,o:ColorColumn,q:QuickFixLine,
@@ -4346,6 +4348,10 @@ A jump table for the options with a short description can be found at |Q_op|.
43464348
|hl-SpellLocal| L word from other region |spell|
43474349
|hl-Pmenu| + popup menu normal line
43484350
|hl-PmenuSel| = popup menu selected line
4351+
|hl-PmenuKind| [ popup menu "kind" normal line
4352+
|hl-PmenuKindSel| ] popup menu "kind" selected line
4353+
|hl-PmenuExtra| { popup menu "kind" normal line
4354+
|hl-PmenuExtraSel| } popup menu "kind" selected line
43494355
|hl-PmenuSbar| x popup menu scrollbar
43504356
|hl-PmenuThumb| X popup menu scrollbar thumb
43514357

runtime/doc/syntax.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5452,6 +5452,14 @@ Normal Normal text.
54525452
Pmenu Popup menu: Normal item.
54535453
*hl-PmenuSel*
54545454
PmenuSel Popup menu: Selected item.
5455+
*hl-PmenuKind*
5456+
PmenuKind Popup menu: Normal item "kind".
5457+
*hl-PmenuKindSel*
5458+
PmenuKindSel Popup menu: Selected item "kind".
5459+
*hl-PmenuExtra*
5460+
PmenuExtra Popup menu: Normal item "extra text".
5461+
*hl-PmenuExtraSel*
5462+
PmenuExtraSel Popup menu: Selected item "extra text".
54555463
*hl-PmenuSbar*
54565464
PmenuSbar Popup menu: Scrollbar.
54575465
*hl-PmenuThumb*

runtime/doc/vim9.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ function, the function does not need to be defined more than once: >
340340
341341
Variable declarations with :var, :final and :const ~
342342
*vim9-declaration* *:var* *E1079*
343-
*E1017* *E1020* *E1054* *E1087* *E1108* *E1124*
343+
*E1017* *E1020* *E1054* *E1087* *E1124*
344344
Local variables need to be declared with `:var`. Local constants need to be
345345
declared with `:final` or `:const`. We refer to both as "variables" in this
346346
section.
@@ -1664,8 +1664,8 @@ type, it can not be used in Vim9 script.
16641664

16651665
*E1211* *E1217* *E1218* *E1219* *E1220* *E1221*
16661666
*E1222* *E1223* *E1224* *E1225* *E1226* *E1227*
1667-
*E1228* *E1238* *E1250* *E1251* *E1252* *E1253*
1668-
*E1256* *E1297* *E1298* *E1301*
1667+
*E1228* *E1238* *E1250* *E1251* *E1252* *E1256*
1668+
*E1297* *E1298* *E1301*
16691669
Types are checked for most builtin functions to make it easier to spot
16701670
mistakes.
16711671

runtime/filetype.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ au BufNewFile,BufRead *.mch,*.ref,*.imp setf b
205205
au BufNewFile,BufRead *.bas call dist#ft#FTbas()
206206
au BufNewFile,BufRead *.bi,*.bm call dist#ft#FTbas()
207207

208+
" Bass
209+
au BufNewFile,BufRead *.bass setf bass
210+
208211
" Visual Basic Script (close to Visual Basic) or Visual Basic .NET
209212
au BufNewFile,BufRead *.vb,*.vbs,*.dsm,*.ctl setf vb
210213

@@ -274,6 +277,9 @@ endif
274277
au BufNewFile,BufRead *.c call dist#ft#FTlpc()
275278
au BufNewFile,BufRead *.lpc,*.ulpc setf lpc
276279

280+
" Cairo
281+
au BufNewFile,BufRead *.cairo setf cairo
282+
277283
" Calendar
278284
au BufNewFile,BufRead calendar setf calendar
279285

@@ -1396,6 +1402,9 @@ au BufNewFile,BufRead *.occ setf occam
13961402
" Octave
13971403
au BufNewFile,BufRead octave.conf,.octaverc,octaverc setf octave
13981404

1405+
" Odin
1406+
au BufNewFile,BufRead *.odin setf odin
1407+
13991408
" Omnimark
14001409
au BufNewFile,BufRead *.xom,*.xin setf omnimark
14011410

@@ -2103,6 +2112,9 @@ au BufNewFile,BufRead tags setf tags
21032112
" TAK
21042113
au BufNewFile,BufRead *.tak setf tak
21052114

2115+
" Unx Tal
2116+
au BufNewFile,BufRead *.tal setf tal
2117+
21062118
" Task
21072119
au BufRead,BufNewFile {pending,completed,undo}.data setf taskdata
21082120
au BufRead,BufNewFile *.task setf taskedit

runtime/import/dist/vimhighlight.vim

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
vim9script
2+
3+
# Maintainer: github user lacygoill
4+
# Last Change: 2023 Mar 08
5+
6+
# Init {{{1
7+
8+
const LINK: string = '->'
9+
10+
# Interface {{{1
11+
export def HighlightTest() # {{{2
12+
# Open a new window if the current one isn't empty
13+
if line('$') != 1 || getline(1) != ''
14+
new
15+
endif
16+
17+
edit Highlight\ test
18+
19+
# `:help scratch-buffer`
20+
&l:bufhidden = 'hide'
21+
&l:buftype = 'nofile'
22+
&l:swapfile = false
23+
24+
var report: list<string> =<< trim END
25+
Highlighting groups for various occasions
26+
-----------------------------------------
27+
END
28+
29+
var various_groups: list<string> = GetVariousGroups()
30+
->filter((_, group: string): bool => group->hlexists() && !group->IsCleared())
31+
->sort()
32+
->uniq()
33+
34+
report->extend(various_groups->FollowChains())
35+
36+
var language_section: list<string> =<< trim END
37+
38+
Highlighting groups for language syntaxes
39+
-----------------------------------------
40+
END
41+
report->extend(language_section)
42+
43+
var syntax_groups: list<string> = getcompletion('', 'highlight')
44+
->filter((_, group: string): bool =>
45+
various_groups->index(group) == -1
46+
&& !group->IsCleared()
47+
&& group !~ '^HighlightTest')
48+
49+
# put the report
50+
report
51+
->extend(syntax_groups->FollowChains())
52+
->setline(1)
53+
54+
# highlight the group names
55+
execute $'silent! global /^\w\+\%(\%(\s*{LINK}\s*\)\w\+\)*$/ Highlight({bufnr('%')})'
56+
57+
cursor(1, 1)
58+
enddef
59+
# }}}1
60+
# Core {{{1
61+
def Highlight(buf: number) # {{{2
62+
var lnum: number = line('.')
63+
for group: string in getline('.')->split($'\s*{LINK}\s*')
64+
silent! prop_type_add($'highlight-test-{group}', {
65+
bufnr: buf,
66+
highlight: group,
67+
combine: false,
68+
})
69+
prop_add(lnum, col('.'), {
70+
length: group->strlen(),
71+
type: $'highlight-test-{group}'
72+
})
73+
search('\<\w\+\>', '', lnum)
74+
endfor
75+
enddef
76+
# }}}1
77+
# Util {{{1
78+
def IsCleared(name: string): bool # {{{2
79+
return name
80+
->hlget()
81+
->get(0, {})
82+
->get('cleared')
83+
enddef
84+
85+
def FollowChains(groups: list<string>): list<string> # {{{2
86+
# A group might be linked to another, which itself might be linked...
87+
# We want the whole chain, for every group.
88+
var chains: list<string>
89+
for group: string in groups
90+
var target: string = group->LinksTo()
91+
var chain: string = group
92+
while !target->empty()
93+
chain ..= $' {LINK} {target}'
94+
target = target->LinksTo()
95+
endwhile
96+
var a_link_is_cleared: bool = chain
97+
->split($'\s*{LINK}\s*')
98+
->indexof((_, g: string): bool => g->IsCleared()) >= 0
99+
if a_link_is_cleared
100+
continue
101+
endif
102+
chains->add(chain)
103+
endfor
104+
return chains
105+
enddef
106+
107+
def LinksTo(group: string): string # {{{2
108+
return group
109+
->hlget()
110+
->get(0, {})
111+
->get('linksto', '')
112+
enddef
113+
114+
def GetVariousGroups(): list<string> # {{{2
115+
return getcompletion('hl-', 'help')
116+
->filter((_, helptag: string): bool => helptag =~ '^hl-\w\+$')
117+
->map((_, helptag: string) => helptag->substitute('^hl-', '', ''))
118+
->extend(range(1, 9)->map((_, n: number) => $'User{n}'))
119+
enddef

runtime/syntax/hitest.vim

Lines changed: 4 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,10 @@
11
" Vim syntax file
22
" Language: none; used to see highlighting
3-
" Maintainer: Ronald Schild <rs@scutum.de>
4-
" Last Change: 2019 Jun 06
5-
" Version: 5.4n.1
6-
" Additional Changes By: Lifepillar, Bram
3+
" Maintainer: github user lacygoill
4+
" Last Change: 2023 Mar 08
75

86
" To see your current highlight settings, do
97
" :so $VIMRUNTIME/syntax/hitest.vim
108

11-
" save global options and registers
12-
let s:hidden = &hidden
13-
let s:lazyredraw = &lazyredraw
14-
let s:more = &more
15-
let s:report = &report
16-
let s:whichwrap = &whichwrap
17-
let s:shortmess = &shortmess
18-
let s:wrapscan = &wrapscan
19-
let s:register_a = @a
20-
let s:register_se = @/
21-
22-
" set global options
23-
set hidden lazyredraw nomore report=99999 shortmess=aoOstTW wrapscan
24-
set whichwrap&
25-
26-
" print current highlight settings into register a
27-
redir @a
28-
silent highlight
29-
redir END
30-
31-
" Open a new window if the current one isn't empty
32-
if line("$") != 1 || getline(1) != ""
33-
new
34-
endif
35-
36-
" edit temporary file
37-
edit Highlight\ test
38-
39-
" set local options
40-
setlocal autoindent noexpandtab formatoptions=t shiftwidth=18 noswapfile tabstop=18
41-
let &textwidth=&columns
42-
43-
" insert highlight settings
44-
% delete
45-
put a
46-
47-
" remove cleared groups
48-
silent! g/ cleared$/d
49-
50-
" remove the colored xxx items
51-
g/xxx /s///e
52-
53-
" remove color settings (not needed here)
54-
global! /links to/ substitute /\s.*$//e
55-
56-
" Move split 'links to' lines to the same line
57-
% substitute /^\(\w\+\)\n\s*\(links to.*\)/\1\t\2/e
58-
59-
" move linked groups to the end of file
60-
global /links to/ move $
61-
62-
" move linked group names to the matching preferred groups
63-
" TODO: this fails if the group linked to isn't defined
64-
% substitute /^\(\w\+\)\s*\(links to\)\s*\(\w\+\)$/\3\t\2 \1/e
65-
silent! global /links to/ normal mz3ElD0#$p'zdd
66-
67-
" delete empty lines
68-
global /^ *$/ delete
69-
70-
" precede syntax command
71-
% substitute /^[^ ]*/syn keyword &\t&/
72-
73-
" execute syntax commands
74-
syntax clear
75-
% yank a
76-
@a
77-
78-
" remove syntax commands again
79-
% substitute /^syn keyword //
80-
81-
" pretty formatting
82-
global /^/ exe "normal Wi\<CR>\t\eAA\ex"
83-
global /^\S/ join
84-
85-
" find out first syntax highlighting
86-
let b:various = &highlight.',:Normal,:Cursor,:,'
87-
let b:i = 1
88-
while b:various =~ ':'.substitute(getline(b:i), '\s.*$', ',', '')
89-
let b:i = b:i + 1
90-
if b:i > line("$") | break | endif
91-
endwhile
92-
93-
" insert headlines
94-
call append(0, "Highlighting groups for various occasions")
95-
call append(1, "-----------------------------------------")
96-
97-
if b:i < line("$")-1
98-
let b:synhead = "Syntax highlighting groups"
99-
if exists("hitest_filetypes")
100-
redir @a
101-
let
102-
redir END
103-
let @a = substitute(@a, 'did_\(\w\+\)_syn\w*_inits\s*#1', ', \1', 'g')
104-
let @a = substitute(@a, "\n\\w[^\n]*", '', 'g')
105-
let @a = substitute(@a, "\n", '', 'g')
106-
let @a = substitute(@a, '^,', '', 'g')
107-
if @a != ""
108-
let b:synhead = b:synhead." - filetype"
109-
if @a =~ ','
110-
let b:synhead = b:synhead."s"
111-
endif
112-
let b:synhead = b:synhead.":".@a
113-
endif
114-
endif
115-
call append(b:i+1, "")
116-
call append(b:i+2, b:synhead)
117-
call append(b:i+3, substitute(b:synhead, '.', '-', 'g'))
118-
endif
119-
120-
" remove 'hls' highlighting
121-
nohlsearch
122-
normal 0
123-
124-
" we don't want to save this temporary file
125-
set nomodified
126-
127-
" the following trick avoids the "Press RETURN ..." prompt
128-
0 append
129-
.
130-
131-
" restore global options and registers
132-
let &hidden = s:hidden
133-
let &lazyredraw = s:lazyredraw
134-
let &more = s:more
135-
let &report = s:report
136-
let &shortmess = s:shortmess
137-
let &whichwrap = s:whichwrap
138-
let &wrapscan = s:wrapscan
139-
let @a = s:register_a
140-
141-
" restore last search pattern
142-
call histdel("search", -1)
143-
let @/ = s:register_se
144-
145-
" remove variables
146-
unlet s:hidden s:lazyredraw s:more s:report s:shortmess
147-
unlet s:whichwrap s:wrapscan s:register_a s:register_se
148-
149-
" vim: ts=8
9+
import 'dist/vimhighlight.vim'
10+
call vimhighlight.HighlightTest()

0 commit comments

Comments
 (0)