comparison src/testdir/test_syntax.vim @ 17596:892b4ea3bad6 v8.1.1795

patch 8.1.1795: no syntax HL after splitting windows with :bufdo commit https://github.com/vim/vim/commit/c7f1e4002184903f4e12e429dd5c6ab731932f86 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 3 13:29:46 2019 +0200 patch 8.1.1795: no syntax HL after splitting windows with :bufdo Problem: No syntax HL after splitting windows with :bufdo. (Yasuhiro Matsumoto) Solution: Trigger Syntax autocommands in buffers that are active. (closes #4761)
author Bram Moolenaar <Bram@vim.org>
date Sat, 03 Aug 2019 13:30:07 +0200
parents 8e9e9124c7a2
children 4c7097a980a5
comparison
equal deleted inserted replaced
17595:50cc81726702 17596:892b4ea3bad6
580 redraw! 580 redraw!
581 redraw! 581 redraw!
582 call test_override("ALL", 0) 582 call test_override("ALL", 0)
583 bwipe! 583 bwipe!
584 endfunc 584 endfunc
585
586 func Test_syntax_after_bufdo()
587 call writefile(['/* aaa comment */'], 'Xaaa.c')
588 call writefile(['/* bbb comment */'], 'Xbbb.c')
589 call writefile(['/* ccc comment */'], 'Xccc.c')
590 call writefile(['/* ddd comment */'], 'Xddd.c')
591
592 let bnr = bufnr('%')
593 new Xaaa.c
594 badd Xbbb.c
595 badd Xccc.c
596 badd Xddd.c
597 exe "bwipe " . bnr
598 let l = []
599 bufdo call add(l, bufnr('%'))
600 call assert_equal(4, len(l))
601
602 syntax on
603
604 " This used to only enable syntax HL in the last buffer.
605 bufdo tab split
606 tabrewind
607 for tab in range(1, 4)
608 norm fm
609 call assert_equal(['cComment'], map(synstack(line("."), col(".")), 'synIDattr(v:val, "name")'))
610 tabnext
611 endfor
612
613 bwipe! Xaaa.c
614 bwipe! Xbbb.c
615 bwipe! Xccc.c
616 bwipe! Xddd.c
617 syntax off
618 call delete('Xaaa.c')
619 call delete('Xbbb.c')
620 call delete('Xccc.c')
621 call delete('Xddd.c')
622 endfunc