mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge remote-tracking branch 'vim/master'
This commit is contained in:
@@ -1129,7 +1129,7 @@ au BufNewFile,BufRead *.dpr setf pascal
|
||||
" PDF
|
||||
au BufNewFile,BufRead *.pdf setf pdf
|
||||
|
||||
" PCMK - HAE - crm configure edit
|
||||
" PCMK - HAE - crm configure edit
|
||||
au BufNewFile,BufRead *.pcmk setf pcmk
|
||||
|
||||
" Perl
|
||||
@@ -1893,8 +1893,11 @@ au BufNewFile,BufRead *.yy,*.yxx,*.y++ setf yacc
|
||||
" Yacc or racc
|
||||
au BufNewFile,BufRead *.y call dist#ft#FTy()
|
||||
|
||||
" Yaml or Raml
|
||||
au BufNewFile,BufRead *.yaml,*.yml,*.raml setf yaml
|
||||
" Yaml
|
||||
au BufNewFile,BufRead *.yaml,*.yml setf yaml
|
||||
|
||||
" Raml
|
||||
au BufNewFile,BufRead *.raml setf raml
|
||||
|
||||
" yum conf (close enough to dosini)
|
||||
au BufNewFile,BufRead */etc/yum.conf setf dosini
|
||||
@@ -2107,7 +2110,7 @@ au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')
|
||||
au BufNewFile,BufRead *.text,README setf text
|
||||
|
||||
" Help files match *.txt but should have a last line that is a modeline.
|
||||
au BufNewFile,BufRead *.txt
|
||||
au BufNewFile,BufRead *.txt
|
||||
\ if getline('$') !~ 'vim:.*ft=help'
|
||||
\| setf text
|
||||
\| endif
|
||||
|
||||
+5
-2
@@ -1048,7 +1048,10 @@ doESCkey:
|
||||
|
||||
if (ins_esc(&count, cmdchar, nomove))
|
||||
{
|
||||
if (cmdchar != 'r' && cmdchar != 'v')
|
||||
// When CTRL-C was typed got_int will be set, with the result
|
||||
// that the autocommands won't be executed. When mapped got_int
|
||||
// is not set, but let's keep the behavior the same.
|
||||
if (cmdchar != 'r' && cmdchar != 'v' && c != Ctrl_C)
|
||||
ins_apply_autocmds(EVENT_INSERTLEAVE);
|
||||
did_cursorhold = FALSE;
|
||||
return (c == Ctrl_O);
|
||||
@@ -2418,7 +2421,7 @@ has_compl_option(int dict_opt)
|
||||
int
|
||||
vim_is_ctrl_x_key(int c)
|
||||
{
|
||||
/* Always allow ^R - let it's results then be checked */
|
||||
// Always allow ^R - let its results then be checked
|
||||
if (c == Ctrl_R)
|
||||
return TRUE;
|
||||
|
||||
|
||||
@@ -1409,3 +1409,33 @@ func Test_edit_alt()
|
||||
bwipe XAltFile
|
||||
call delete('XAltFile')
|
||||
endfunc
|
||||
|
||||
func Test_leave_insert_autocmd()
|
||||
new
|
||||
au InsertLeave * let g:did_au = 1
|
||||
let g:did_au = 0
|
||||
call feedkeys("afoo\<Esc>", 'tx')
|
||||
call assert_equal(1, g:did_au)
|
||||
call assert_equal('foo', getline(1))
|
||||
|
||||
let g:did_au = 0
|
||||
call feedkeys("Sbar\<C-C>", 'tx')
|
||||
call assert_equal(0, g:did_au)
|
||||
call assert_equal('bar', getline(1))
|
||||
|
||||
inoremap x xx<Esc>
|
||||
let g:did_au = 0
|
||||
call feedkeys("Saax", 'tx')
|
||||
call assert_equal(1, g:did_au)
|
||||
call assert_equal('aaxx', getline(1))
|
||||
|
||||
inoremap x xx<C-C>
|
||||
let g:did_au = 0
|
||||
call feedkeys("Sbbx", 'tx')
|
||||
call assert_equal(0, g:did_au)
|
||||
call assert_equal('bbxx', getline(1))
|
||||
|
||||
bwipe!
|
||||
au! InsertLeave
|
||||
iunmap x
|
||||
endfunc
|
||||
|
||||
@@ -495,6 +495,7 @@ let s:filename_checks = {
|
||||
\ 'xslt': ['file.xsl', 'file.xslt'],
|
||||
\ 'yacc': ['file.yy', 'file.yxx', 'file.y++'],
|
||||
\ 'yaml': ['file.yaml', 'file.yml'],
|
||||
\ 'raml': ['file.raml'],
|
||||
\ 'z8a': ['file.z8a'],
|
||||
\ 'zimbu': ['file.zu'],
|
||||
\ 'zimbutempl': ['file.zut'],
|
||||
|
||||
@@ -105,8 +105,11 @@ func Test_filter_commands()
|
||||
unlet test_filter_c
|
||||
|
||||
" Test filtering :set command
|
||||
let helplang=&helplang
|
||||
set helplang=en
|
||||
let res = join(split(execute("filter /^help/ set"), "\n")[1:], " ")
|
||||
call assert_match('^\s*helplang=\w*$', res)
|
||||
let &helplang=helplang
|
||||
|
||||
" Test filtering :llist command
|
||||
call setloclist(0, [{"filename": "/path/vim.c"}, {"filename": "/path/vim.h"}, {"module": "Main.Test"}])
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
" Tests for parsing the modeline.
|
||||
|
||||
func Test_modeline_invalid()
|
||||
" This was reading before allocated memory.
|
||||
" This was reading allocated memory in the past.
|
||||
call writefile(['vi:0', 'nothing'], 'Xmodeline')
|
||||
let modeline = &modeline
|
||||
set modeline
|
||||
call assert_fails('split Xmodeline', 'E518:')
|
||||
let &modeline = modeline
|
||||
bwipe!
|
||||
call delete('Xmodeline')
|
||||
endfunc
|
||||
|
||||
@@ -9,7 +9,7 @@ func Test_suspend()
|
||||
|
||||
let buf = term_start('/bin/sh')
|
||||
" Wait for shell prompt.
|
||||
call WaitForAssert({-> assert_match('$ $', term_getline(buf, '.'))})
|
||||
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
|
||||
|
||||
call term_sendkeys(buf, v:progpath
|
||||
\ . " --clean -X"
|
||||
@@ -26,7 +26,7 @@ func Test_suspend()
|
||||
\ "\<C-Z>"]
|
||||
" Suspend and wait for shell prompt.
|
||||
call term_sendkeys(buf, suspend_cmd)
|
||||
call WaitForAssert({-> assert_match('$ $', term_getline(buf, '.'))})
|
||||
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
|
||||
|
||||
" Without 'autowrite', buffer should not be written.
|
||||
call assert_equal(0, filereadable('Xfoo'))
|
||||
@@ -40,7 +40,7 @@ func Test_suspend()
|
||||
call assert_equal(0, filereadable('Xfoo'))
|
||||
call term_sendkeys(buf, ":suspend\<CR>")
|
||||
" Wait for shell prompt.
|
||||
call WaitForAssert({-> assert_match('$ $', term_getline(buf, '.'))})
|
||||
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
|
||||
call assert_equal(['foo'], readfile('Xfoo'))
|
||||
call term_sendkeys(buf, "fg\<CR>")
|
||||
call WaitForAssert({-> assert_equal(' 1 foo', term_getline(buf, '.'))})
|
||||
|
||||
@@ -490,14 +490,17 @@ func Test_terminal_cwd_failure()
|
||||
call assert_fails("call term_start(&shell, {'cwd': 'Xdir'})", 'E475:')
|
||||
|
||||
" Case 3: Directory exists but is not accessible.
|
||||
call mkdir('Xdir', '', '0600')
|
||||
" return early if the directory permissions could not be set properly
|
||||
if getfperm('Xdir')[2] == 'x'
|
||||
call delete('Xdir', 'rf')
|
||||
return
|
||||
" Skip this for root, it will be accessible anyway.
|
||||
if $USER != 'root'
|
||||
call mkdir('XdirNoAccess', '', '0600')
|
||||
" return early if the directory permissions could not be set properly
|
||||
if getfperm('XdirNoAccess')[2] == 'x'
|
||||
call delete('XdirNoAccess', 'rf')
|
||||
return
|
||||
endif
|
||||
call assert_fails("call term_start(&shell, {'cwd': 'XdirNoAccess'})", 'E475:')
|
||||
call delete('XdirNoAccess', 'rf')
|
||||
endif
|
||||
call assert_fails("call term_start(&shell, {'cwd': 'Xdir'})", 'E475:')
|
||||
call delete('Xdir', 'rf')
|
||||
endfunc
|
||||
|
||||
func Test_terminal_servername()
|
||||
|
||||
@@ -807,6 +807,18 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
509,
|
||||
/**/
|
||||
508,
|
||||
/**/
|
||||
507,
|
||||
/**/
|
||||
506,
|
||||
/**/
|
||||
505,
|
||||
/**/
|
||||
504,
|
||||
/**/
|
||||
503,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user