Skip to content

Commit 286bd68

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents adfe7be + 083692d commit 286bd68

42 files changed

Lines changed: 424 additions & 144 deletions

Some content is hidden

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

runtime/autoload/dist/ft.vim

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,35 @@ export def FTbas()
7272

7373
# most frequent FreeBASIC-specific keywords in distro files
7474
var fb_keywords = '\c^\s*\%(extern\|var\|enum\|private\|scope\|union\|byref\|operator\|constructor\|delete\|namespace\|public\|property\|with\|destructor\|using\)\>\%(\s*[:=(]\)\@!'
75-
var fb_preproc = '\c^\s*\%(#\a\+\|option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\)'
75+
var fb_preproc = '\c^\s*\%(' ..
76+
# preprocessor
77+
'#\s*\a\+\|' ..
78+
# compiler option
79+
'option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\|' ..
80+
# metacommand
81+
'\%(''\|rem\)\s*\$lang\>\|' ..
82+
# default datatype
83+
'def\%(byte\|longint\|short\|ubyte\|uint\|ulongint\|ushort\)\>' ..
84+
'\)'
7685
var fb_comment = "^\\s*/'"
86+
7787
# OPTION EXPLICIT, without the leading underscore, is common to many dialects
7888
var qb64_preproc = '\c^\s*\%($\a\+\|option\s\+\%(_explicit\|_\=explicitarray\)\>\)'
7989

80-
var lines = getline(1, min([line("$"), 100]))
81-
82-
if match(lines, fb_preproc) > -1 || match(lines, fb_comment) > -1 || match(lines, fb_keywords) > -1
83-
setf freebasic
84-
elseif match(lines, qb64_preproc) > -1
85-
setf qb64
86-
elseif match(lines, ft_visual_basic_content) > -1
87-
setf vb
88-
else
89-
setf basic
90-
endif
90+
for lnum in range(1, min([line("$"), 100]))
91+
var line = getline(lnum)
92+
if line =~ ft_visual_basic_content
93+
setf vb
94+
return
95+
elseif line =~ fb_preproc || line =~ fb_comment || line =~ fb_keywords
96+
setf freebasic
97+
return
98+
elseif line =~ qb64_preproc
99+
setf qb64
100+
return
101+
endif
102+
endfor
103+
setf basic
91104
enddef
92105

93106
export def FTbtm()
@@ -126,6 +139,23 @@ export def FTcfg()
126139
endif
127140
enddef
128141

142+
export def FTcls()
143+
if exists("g:filetype_cls")
144+
exe "setf " .. g:filetype_cls
145+
return
146+
endif
147+
148+
if getline(1) =~ '^%'
149+
setf tex
150+
elseif getline(1)[0] == '#' && getline(1) =~ 'rexx'
151+
setf rexx
152+
elseif getline(1) == 'VERSION 1.0 CLASS'
153+
setf vb
154+
else
155+
setf st
156+
endif
157+
enddef
158+
129159
export def FTlpc()
130160
if exists("g:lpc_syntax_for_c")
131161
var lnum = 1

runtime/doc/filetype.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ variables can be used to overrule the filetype used for certain extensions:
143143
*.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
144144
*.bas g:filetype_bas |ft-basic-syntax|
145145
*.cfg g:filetype_cfg
146+
*.cls g:filetype_cls
146147
*.csh g:filetype_csh |ft-csh-syntax|
147148
*.dat g:filetype_dat
148149
*.frm g:filetype_frm |ft-form-syntax|

runtime/doc/options.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4306,7 +4306,10 @@ A jump table for the options with a short description can be found at |Q_op|.
43064306
b bold (termcap entry "md" and "me")
43074307
s standout (termcap entry "so" and "se")
43084308
u underline (termcap entry "us" and "ue")
4309-
c undercurl (termcap entry "Cs" and "Ce")
4309+
c undercurl (termcap entry "Us" and "Ce")
4310+
2 double underline (termcap entry "Ds" and "Ce")
4311+
d dotted underline (termcap entry "ds" and "Ce")
4312+
= dashed underline (termcap entry "Ds" and "Ce")
43104313
t strikethrough (termcap entry "Ts" and "Te")
43114314
n no highlighting
43124315
- no highlighting

runtime/doc/syntax.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5002,14 +5002,18 @@ the same syntax file on all terminals, and use the optimal highlighting.
50025002
1. highlight arguments for normal terminals
50035003

50045004
*bold* *underline* *undercurl*
5005-
*inverse* *italic* *standout*
5006-
*nocombine* *strikethrough*
5005+
*underdouble* *underdotted*
5006+
*underdashed* *inverse* *italic*
5007+
*standout* *nocombine* *strikethrough*
50075008
term={attr-list} *attr-list* *highlight-term* *E418*
50085009
attr-list is a comma-separated list (without spaces) of the
50095010
following items (in any order):
50105011
bold
50115012
underline
50125013
undercurl not always available
5014+
underdouble not always available
5015+
underdotted not always available
5016+
underdashed not always available
50135017
strikethrough not always available
50145018
reverse
50155019
inverse same as reverse
@@ -5020,6 +5024,7 @@ term={attr-list} *attr-list* *highlight-term* *E418*
50205024

50215025
Note that "bold" can be used here and by using a bold font. They
50225026
have the same effect.
5027+
*underline-codes*
50235028
"undercurl" is a curly underline. When "undercurl" is not possible
50245029
then "underline" is used. In general "undercurl" and "strikethrough"
50255030
are only available in the GUI and some terminals. The color is set
@@ -5028,6 +5033,17 @@ term={attr-list} *attr-list* *highlight-term* *E418*
50285033
let &t_Cs = "\e[4:3m"
50295034
let &t_Ce = "\e[4:0m"
50305035
5036+
< "underdouble" is a double underline, "underdotted" is a dotted
5037+
underline and "underdashed" is a dashed underline. These are only
5038+
supported by some terminals. If your terminal supports them you may
5039+
have to specify the codes like this: >
5040+
let &t_Us = "\e[4:2m"
5041+
let &t_ds = "\e[4:4m"
5042+
let &t_Ds = "\e[4:5m"
5043+
< They are reset with |t_Ce|, the same as curly underline (undercurl).
5044+
When t_Us, t_ds or t_Ds is not set then underline will be used as a
5045+
fallback.
5046+
50315047

50325048
start={term-list} *highlight-start* *E422*
50335049
stop={term-list} *term-list* *highlight-stop*

runtime/doc/term.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,11 @@ OUTPUT CODES *terminal-output-codes*
372372

373373
Added by Vim (there are no standard codes for these):
374374
t_AU set underline color (ANSI) *t_AU* *'t_AU'*
375-
t_Ce undercurl end *t_Ce* *'t_Ce'*
376-
t_Cs undercurl mode *t_Cs* *'t_Cs'*
375+
t_Ce undercurl and underline end *t_Ce* *'t_Ce'*
376+
t_Cs undercurl (curly underline) mode *t_Cs* *'t_Cs'*
377+
t_Us double underline mode *t_Us* *'t_Us'*
378+
t_ds dotted underline mode *t_ds* *'t_ds'*
379+
t_Ds dashed underline mode *t_Ds* *'t_Ds'*
377380
t_Te strikethrough end *t_Te* *'t_Te'*
378381
t_Ts strikethrough mode *t_Ts* *'t_Ts'*
379382
t_IS set icon text start *t_IS* *'t_IS'*

runtime/doc/xxd.1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ Stop after writing
113113
.RI < len >
114114
octets.
115115
.TP
116+
.I "\-n name " | " \-name name"
117+
Override the variable name output when \-i is used. The array is named
118+
\fIname\fP and the length is named \fIname\fP_len.
119+
.TP
116120
.I \-o offset
117121
Add
118122
.RI < offset >

runtime/filetype.vim

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,9 @@ au BufNewFile,BufRead *.hsm setf hamster
789789
" Handlebars
790790
au BufNewFile,BufRead *.hbs setf handlebars
791791

792+
" Hare
793+
au BufNewFile,BufRead *.ha setf hare
794+
792795
" Haskell
793796
au BufNewFile,BufRead *.hs,*.hsc,*.hs-boot,*.hsig setf haskell
794797
au BufNewFile,BufRead *.lhs setf lhaskell
@@ -1795,16 +1798,11 @@ au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill
17951798
au BufNewFile,BufRead .slrnrc setf slrnrc
17961799
au BufNewFile,BufRead *.score setf slrnsc
17971800

1798-
" Smalltalk (and TeX)
1801+
" Smalltalk
17991802
au BufNewFile,BufRead *.st setf st
1800-
au BufNewFile,BufRead *.cls
1801-
\ if getline(1) =~ '^%' |
1802-
\ setf tex |
1803-
\ elseif getline(1)[0] == '#' && getline(1) =~ 'rexx' |
1804-
\ setf rexx |
1805-
\ else |
1806-
\ setf st |
1807-
\ endif
1803+
1804+
" Smalltalk (and Rexx, TeX, and Visual Basic)
1805+
au BufNewFile,BufRead *.cls call dist#ft#FTcls()
18081806

18091807
" Smarty templates
18101808
au BufNewFile,BufRead *.tpl setf smarty

src/buffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,8 +1008,8 @@ free_buffer_stuff(
10081008
#ifdef FEAT_NETBEANS_INTG
10091009
netbeans_file_killed(buf);
10101010
#endif
1011-
map_clear_int(buf, MAP_ALL_MODES, TRUE, FALSE); // clear local mappings
1012-
map_clear_int(buf, MAP_ALL_MODES, TRUE, TRUE); // clear local abbrevs
1011+
map_clear_mode(buf, MAP_ALL_MODES, TRUE, FALSE); // clear local mappings
1012+
map_clear_mode(buf, MAP_ALL_MODES, TRUE, TRUE); // clear local abbrevs
10131013
VIM_CLEAR(buf->b_start_fenc);
10141014
}
10151015

src/crypt.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ typedef struct {
7373
char_u *p2, int last);
7474
} cryptmethod_T;
7575

76+
static int crypt_sodium_init(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len);
77+
static long crypt_sodium_buffer_decode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last);
78+
static long crypt_sodium_buffer_encode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last);
79+
7680
// index is method_nr of cryptstate_T, CRYPT_M_*
7781
static cryptmethod_T cryptmethods[CRYPT_M_COUNT] = {
7882
// PK_Zip; very weak
@@ -850,7 +854,7 @@ crypt_append_msg(
850854
}
851855
}
852856

853-
int
857+
static int
854858
crypt_sodium_init(
855859
cryptstate_T *state UNUSED,
856860
char_u *key UNUSED,
@@ -1030,7 +1034,7 @@ crypt_sodium_decode(
10301034
* Encrypt "from[len]" into "to[len]".
10311035
* "from" and "to" can be equal to encrypt in place.
10321036
*/
1033-
long
1037+
static long
10341038
crypt_sodium_buffer_encode(
10351039
cryptstate_T *state UNUSED,
10361040
char_u *from UNUSED,
@@ -1080,7 +1084,7 @@ crypt_sodium_buffer_encode(
10801084
* Decrypt "from[len]" into "to[len]".
10811085
* "from" and "to" can be equal to encrypt in place.
10821086
*/
1083-
long
1087+
static long
10841088
crypt_sodium_buffer_decode(
10851089
cryptstate_T *state UNUSED,
10861090
char_u *from UNUSED,

src/evalfunc.c

Lines changed: 19 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ static void f_getregtype(typval_T *argvars, typval_T *rettv);
7575
static void f_gettagstack(typval_T *argvars, typval_T *rettv);
7676
static void f_gettext(typval_T *argvars, typval_T *rettv);
7777
static void f_haslocaldir(typval_T *argvars, typval_T *rettv);
78-
static void f_hasmapto(typval_T *argvars, typval_T *rettv);
7978
static void f_hlID(typval_T *argvars, typval_T *rettv);
8079
static void f_hlexists(typval_T *argvars, typval_T *rettv);
8180
static void f_hostname(typval_T *argvars, typval_T *rettv);
@@ -6688,40 +6687,6 @@ f_haslocaldir(typval_T *argvars, typval_T *rettv)
66886687
rettv->vval.v_number = 0;
66896688
}
66906689

6691-
/*
6692-
* "hasmapto()" function
6693-
*/
6694-
static void
6695-
f_hasmapto(typval_T *argvars, typval_T *rettv)
6696-
{
6697-
char_u *name;
6698-
char_u *mode;
6699-
char_u buf[NUMBUFLEN];
6700-
int abbr = FALSE;
6701-
6702-
if (in_vim9script()
6703-
&& (check_for_string_arg(argvars, 0) == FAIL
6704-
|| check_for_opt_string_arg(argvars, 1) == FAIL
6705-
|| (argvars[1].v_type != VAR_UNKNOWN
6706-
&& check_for_opt_bool_arg(argvars, 2) == FAIL)))
6707-
return;
6708-
6709-
name = tv_get_string(&argvars[0]);
6710-
if (argvars[1].v_type == VAR_UNKNOWN)
6711-
mode = (char_u *)"nvo";
6712-
else
6713-
{
6714-
mode = tv_get_string_buf(&argvars[1], buf);
6715-
if (argvars[2].v_type != VAR_UNKNOWN)
6716-
abbr = (int)tv_get_bool(&argvars[2]);
6717-
}
6718-
6719-
if (map_to_exists(name, mode, abbr))
6720-
rettv->vval.v_number = TRUE;
6721-
else
6722-
rettv->vval.v_number = FALSE;
6723-
}
6724-
67256690
/*
67266691
* "highlightID(name)" function
67276692
*/
@@ -10174,14 +10139,27 @@ f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv)
1017410139
break;
1017510140

1017610141
case 'u':
10177-
if (TOLOWER_ASC(what[1]) == 'l') // ul
10178-
p = highlight_color(id, what, modec);
10179-
else if (STRLEN(what) <= 5 || TOLOWER_ASC(what[5]) != 'c')
10142+
if (STRLEN(what) >= 9)
10143+
{
10144+
if (TOLOWER_ASC(what[5]) == 'l')
1018010145
// underline
10181-
p = highlight_has_attr(id, HL_UNDERLINE, modec);
10182-
else
10146+
p = highlight_has_attr(id, HL_UNDERLINE, modec);
10147+
else if (TOLOWER_ASC(what[5]) != 'd')
1018310148
// undercurl
10184-
p = highlight_has_attr(id, HL_UNDERCURL, modec);
10149+
p = highlight_has_attr(id, HL_UNDERCURL, modec);
10150+
else if (TOLOWER_ASC(what[6]) != 'o')
10151+
// underdashed
10152+
p = highlight_has_attr(id, HL_UNDERDASHED, modec);
10153+
else if (TOLOWER_ASC(what[7]) == 'u')
10154+
// underdouble
10155+
p = highlight_has_attr(id, HL_UNDERDOUBLE, modec);
10156+
else
10157+
// underdotted
10158+
p = highlight_has_attr(id, HL_UNDERDOTTED, modec);
10159+
}
10160+
else
10161+
// ul
10162+
p = highlight_color(id, what, modec);
1018510163
break;
1018610164
}
1018710165

0 commit comments

Comments
 (0)