Skip to content

Commit fdb10af

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 91aa372 + 0b38f54 commit fdb10af

9 files changed

Lines changed: 75 additions & 17 deletions

File tree

runtime/filetype.vim

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ au BufNewFile,BufRead *.dpr setf pascal
11291129
" PDF
11301130
au BufNewFile,BufRead *.pdf setf pdf
11311131

1132-
" PCMK - HAE - crm configure edit
1132+
" PCMK - HAE - crm configure edit
11331133
au BufNewFile,BufRead *.pcmk setf pcmk
11341134

11351135
" Perl
@@ -1893,8 +1893,11 @@ au BufNewFile,BufRead *.yy,*.yxx,*.y++ setf yacc
18931893
" Yacc or racc
18941894
au BufNewFile,BufRead *.y call dist#ft#FTy()
18951895

1896-
" Yaml or Raml
1897-
au BufNewFile,BufRead *.yaml,*.yml,*.raml setf yaml
1896+
" Yaml
1897+
au BufNewFile,BufRead *.yaml,*.yml setf yaml
1898+
1899+
" Raml
1900+
au BufNewFile,BufRead *.raml setf raml
18981901

18991902
" yum conf (close enough to dosini)
19001903
au BufNewFile,BufRead */etc/yum.conf setf dosini
@@ -2107,7 +2110,7 @@ au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')
21072110
au BufNewFile,BufRead *.text,README setf text
21082111

21092112
" Help files match *.txt but should have a last line that is a modeline.
2110-
au BufNewFile,BufRead *.txt
2113+
au BufNewFile,BufRead *.txt
21112114
\ if getline('$') !~ 'vim:.*ft=help'
21122115
\| setf text
21132116
\| endif

src/edit.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,10 @@ edit(
10481048

10491049
if (ins_esc(&count, cmdchar, nomove))
10501050
{
1051-
if (cmdchar != 'r' && cmdchar != 'v')
1051+
// When CTRL-C was typed got_int will be set, with the result
1052+
// that the autocommands won't be executed. When mapped got_int
1053+
// is not set, but let's keep the behavior the same.
1054+
if (cmdchar != 'r' && cmdchar != 'v' && c != Ctrl_C)
10521055
ins_apply_autocmds(EVENT_INSERTLEAVE);
10531056
did_cursorhold = FALSE;
10541057
return (c == Ctrl_O);
@@ -2418,7 +2421,7 @@ has_compl_option(int dict_opt)
24182421
int
24192422
vim_is_ctrl_x_key(int c)
24202423
{
2421-
/* Always allow ^R - let it's results then be checked */
2424+
// Always allow ^R - let its results then be checked
24222425
if (c == Ctrl_R)
24232426
return TRUE;
24242427

src/testdir/test_edit.vim

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,3 +1409,33 @@ func Test_edit_alt()
14091409
bwipe XAltFile
14101410
call delete('XAltFile')
14111411
endfunc
1412+
1413+
func Test_leave_insert_autocmd()
1414+
new
1415+
au InsertLeave * let g:did_au = 1
1416+
let g:did_au = 0
1417+
call feedkeys("afoo\<Esc>", 'tx')
1418+
call assert_equal(1, g:did_au)
1419+
call assert_equal('foo', getline(1))
1420+
1421+
let g:did_au = 0
1422+
call feedkeys("Sbar\<C-C>", 'tx')
1423+
call assert_equal(0, g:did_au)
1424+
call assert_equal('bar', getline(1))
1425+
1426+
inoremap x xx<Esc>
1427+
let g:did_au = 0
1428+
call feedkeys("Saax", 'tx')
1429+
call assert_equal(1, g:did_au)
1430+
call assert_equal('aaxx', getline(1))
1431+
1432+
inoremap x xx<C-C>
1433+
let g:did_au = 0
1434+
call feedkeys("Sbbx", 'tx')
1435+
call assert_equal(0, g:did_au)
1436+
call assert_equal('bbxx', getline(1))
1437+
1438+
bwipe!
1439+
au! InsertLeave
1440+
iunmap x
1441+
endfunc

src/testdir/test_filetype.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ let s:filename_checks = {
495495
\ 'xslt': ['file.xsl', 'file.xslt'],
496496
\ 'yacc': ['file.yy', 'file.yxx', 'file.y++'],
497497
\ 'yaml': ['file.yaml', 'file.yml'],
498+
\ 'raml': ['file.raml'],
498499
\ 'z8a': ['file.z8a'],
499500
\ 'zimbu': ['file.zu'],
500501
\ 'zimbutempl': ['file.zut'],

src/testdir/test_filter_cmd.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ func Test_filter_commands()
105105
unlet test_filter_c
106106

107107
" Test filtering :set command
108+
let helplang=&helplang
109+
set helplang=en
108110
let res = join(split(execute("filter /^help/ set"), "\n")[1:], " ")
109111
call assert_match('^\s*helplang=\w*$', res)
112+
let &helplang=helplang
110113

111114
" Test filtering :llist command
112115
call setloclist(0, [{"filename": "/path/vim.c"}, {"filename": "/path/vim.h"}, {"module": "Main.Test"}])

src/testdir/test_modeline.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
" Tests for parsing the modeline.
22

33
func Test_modeline_invalid()
4-
" This was reading before allocated memory.
4+
" This was reading allocated memory in the past.
55
call writefile(['vi:0', 'nothing'], 'Xmodeline')
6+
let modeline = &modeline
7+
set modeline
68
call assert_fails('split Xmodeline', 'E518:')
9+
let &modeline = modeline
710
bwipe!
811
call delete('Xmodeline')
912
endfunc

src/testdir/test_suspend.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ func Test_suspend()
99

1010
let buf = term_start('/bin/sh')
1111
" Wait for shell prompt.
12-
call WaitForAssert({-> assert_match('$ $', term_getline(buf, '.'))})
12+
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
1313

1414
call term_sendkeys(buf, v:progpath
1515
\ . " --clean -X"
@@ -26,7 +26,7 @@ func Test_suspend()
2626
\ "\<C-Z>"]
2727
" Suspend and wait for shell prompt.
2828
call term_sendkeys(buf, suspend_cmd)
29-
call WaitForAssert({-> assert_match('$ $', term_getline(buf, '.'))})
29+
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
3030

3131
" Without 'autowrite', buffer should not be written.
3232
call assert_equal(0, filereadable('Xfoo'))
@@ -40,7 +40,7 @@ func Test_suspend()
4040
call assert_equal(0, filereadable('Xfoo'))
4141
call term_sendkeys(buf, ":suspend\<CR>")
4242
" Wait for shell prompt.
43-
call WaitForAssert({-> assert_match('$ $', term_getline(buf, '.'))})
43+
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
4444
call assert_equal(['foo'], readfile('Xfoo'))
4545
call term_sendkeys(buf, "fg\<CR>")
4646
call WaitForAssert({-> assert_equal(' 1 foo', term_getline(buf, '.'))})

src/testdir/test_terminal.vim

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -490,14 +490,17 @@ func Test_terminal_cwd_failure()
490490
call assert_fails("call term_start(&shell, {'cwd': 'Xdir'})", 'E475:')
491491

492492
" Case 3: Directory exists but is not accessible.
493-
call mkdir('Xdir', '', '0600')
494-
" return early if the directory permissions could not be set properly
495-
if getfperm('Xdir')[2] == 'x'
496-
call delete('Xdir', 'rf')
497-
return
493+
" Skip this for root, it will be accessible anyway.
494+
if $USER != 'root'
495+
call mkdir('XdirNoAccess', '', '0600')
496+
" return early if the directory permissions could not be set properly
497+
if getfperm('XdirNoAccess')[2] == 'x'
498+
call delete('XdirNoAccess', 'rf')
499+
return
500+
endif
501+
call assert_fails("call term_start(&shell, {'cwd': 'XdirNoAccess'})", 'E475:')
502+
call delete('XdirNoAccess', 'rf')
498503
endif
499-
call assert_fails("call term_start(&shell, {'cwd': 'Xdir'})", 'E475:')
500-
call delete('Xdir', 'rf')
501504
endfunc
502505

503506
func Test_terminal_servername()

src/version.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,18 @@ static char *(features[]) =
807807

808808
static int included_patches[] =
809809
{ /* Add new patch number below this line */
810+
/**/
811+
509,
812+
/**/
813+
508,
814+
/**/
815+
507,
816+
/**/
817+
506,
818+
/**/
819+
505,
820+
/**/
821+
504,
810822
/**/
811823
503,
812824
/**/

0 commit comments

Comments
 (0)