Skip to content

Commit 8eb7523

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.1.0251: Filetype test fails
Problem: Filetype test fails. Solution: Move detection by name before detection by extension. Improve TextChanged test and remove wrong test and fix a typo in a comment (zeertzjq). closes: #14373 Signed-off-by: zeertzjq <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent cbb92b5 commit 8eb7523

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

runtime/filetype.vim

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,10 @@ au BufNewFile,BufRead *.lrc setf lyrics
523523
au BufNewFile,BufRead *.quake,cm3.cfg setf m3quake
524524
au BufNewFile,BufRead m3makefile,m3overrides setf m3build
525525

526+
" Many Python tools use dosini as their config, like setuptools, pudb, coverage
527+
" (must be before *.cfg)
528+
au BufNewFile,BufRead setup.cfg,pudb.cfg,.coveragerc setf dosini
529+
526530
" Quake
527531
au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake
528532
au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake
@@ -1045,9 +1049,6 @@ au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl setf fgl
10451049
" .INI file for MSDOS
10461050
au BufNewFile,BufRead *.ini,*.INI setf dosini
10471051

1048-
" Many python tools use dosini as their config, such as setuptools, pudb, coverage
1049-
au BufNewFile,BufRead setup.cfg,pudb.cfg,.coveragerc setf dosini
1050-
10511052
" SysV Inittab
10521053
au BufNewFile,BufRead inittab setf inittab
10531054

@@ -1182,6 +1183,9 @@ au BufNewFile,BufRead *.sig call dist#ft#FTsig()
11821183
" LDAP LDIF
11831184
au BufNewFile,BufRead *.ldif setf ldif
11841185

1186+
" Luadoc, Ldoc (must be before *.ld)
1187+
au BufNewFile,BufRead config.ld setf lua
1188+
11851189
" Ld loader
11861190
au BufNewFile,BufRead *.ld,*/ldscripts/* setf ld
11871191

@@ -1271,9 +1275,6 @@ au BufNewFile,BufRead .luacheckrc setf lua
12711275
" Luarocks
12721276
au BufNewFile,BufRead *.rockspec,rock_manifest setf lua
12731277

1274-
" Luadoc, Ldoc
1275-
au BufNewFile,BufRead config.ld setf lua
1276-
12771278
" Linden Scripting Language (Second Life)
12781279
au BufNewFile,BufRead *.lsl call dist#ft#FTlsl()
12791280

src/edit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ edit(
847847
// ins_redraw() triggers TextChangedI only when no characters
848848
// are in the typeahead buffer, so reset curbuf->b_last_changedtick only
849849
// if the TextChangedI was not blocked by char_avail() (e.g. using :norm!)
850-
// and the TextChangeDI autocommand has been trigered
850+
// and the TextChangedI autocommand has been triggered.
851851
if (!char_avail() && curbuf->b_last_changedtick_i == CHANGEDTICK(curbuf))
852852
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
853853
return (c == Ctrl_O);

src/testdir/test_autocmd.vim

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3734,11 +3734,6 @@ func Test_Changed_ChangedI()
37343734
call feedkeys("yypi\<esc>", 'tnix')
37353735
call assert_equal('', g:autocmd_i)
37363736

3737-
" TextChanged should only trigger if change was done in Normal mode
3738-
let g:autocmd_n = ''
3739-
call feedkeys("ibar\<esc>", 'tnix')
3740-
call assert_equal('', g:autocmd_n)
3741-
37423737
" If change is a mix of Normal and Insert modes, TextChangedI should trigger
37433738
func s:validate_mixed_textchangedi(keys)
37443739
call feedkeys("ifoo\<esc>", 'tnix')
@@ -4532,20 +4527,30 @@ endfunc
45324527

45334528
" Test TextChangedI and TextChanged
45344529
func Test_Changed_ChangedI_2()
4530+
" Run this test in a terminal because it requires running the main loop.
45354531
CheckRunVimInTerminal
45364532
call writefile(['one', 'two', 'three'], 'XTextChangedI2', 'D')
45374533
let before =<< trim END
4538-
autocmd TextChanged,TextChangedI * call writefile([b:changedtick], 'XTextChangedI3')
4534+
let [g:autocmd_n, g:autocmd_i] = ['','']
4535+
4536+
func TextChangedAutocmd(char)
4537+
let g:autocmd_{tolower(a:char)} = a:char .. b:changedtick
4538+
call writefile([g:autocmd_n, g:autocmd_i], 'XTextChangedI3')
4539+
endfunc
4540+
4541+
au TextChanged <buffer> :call TextChangedAutocmd('N')
4542+
au TextChangedI <buffer> :call TextChangedAutocmd('I')
4543+
45394544
nnoremap <CR> o<Esc>
45404545
call writefile([], 'XTextChangedI3')
45414546
END
45424547

45434548
call writefile(before, 'Xinit', 'D')
45444549
let buf = RunVimInTerminal('-S Xinit XtextChangedI2', {})
4550+
call WaitForAssert({-> assert_true(filereadable('XTextChangedI3'))})
45454551
call term_sendkeys(buf, "\<cr>")
4546-
call term_wait(buf)
4552+
call WaitForAssert({-> assert_equal(['N4', ''], readfile('XTextChangedI3'))})
45474553
call StopVimInTerminal(buf)
4548-
call assert_equal(['4'], readfile('XTextChangedI3'))
45494554

45504555
call delete('XTextChangedI3')
45514556
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
251,
707709
/**/
708710
250,
709711
/**/

0 commit comments

Comments
 (0)