Hi,
I'm using manual syntax highlighting and discovered a bug when moving between
buffers. How to reproduce:

  1. Create files:

     $ cat >vimrc <<!
filetype on
syntax manual
!

     $ cat >1.vim <<!
echo 1
!

     $ cat >2.vim <<!
echo 2
!

  2. Run Vim:

     $ vim -N -u vimrc 1.vim 2.vim

  3. Enable syntax in the current buffer:

     :set syntax=ON

  4. Move to the next buffer and then back again:

     :bn | bp

  5. The syntax option is still enabled in the current buffer but no syntax
     highlighting is performed.

The attached patch solves this issue by setting the syntax option when the
FileType event is triggered.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/syntax/manual.vim b/runtime/syntax/manual.vim
index 5ea3731..a99451c 100644
--- a/runtime/syntax/manual.vim
+++ b/runtime/syntax/manual.vim
@@ -16,10 +16,11 @@ endif
 
 let syntax_manual = 1
 
-" Remove the connection between FileType and Syntax autocommands.
-if exists('#syntaxset')
-  au! syntaxset FileType
-endif
+" Set up the connection between FileType and Syntax autocommands.
+" This makes the syntax set when the file type is detected.
+augroup syntaxset
+  au! FileType *	exe "set syntax=" . &syntax
+augroup END
 
 " If the GUI is already running, may still need to install the FileType menu.
 " Don't do it when the 'M' flag is included in 'guioptions'.

Raspunde prin e-mail lui