On Sat, Aug 27, 2011 at 12:18 AM, Sergey Khorev <[email protected]>wrote:
> > I copied the above line into a new buffer, so only line in > > the buffer. Same incorrect behavior (with matchparen enabled). > > Can you try usual troubleshooting steps, i.e. > > vim -U NONE -u NONE -N -c "filetype on | syntax on | set ft=scheme" > > Now paste your line. Does % work ok? > Yes. > If so try :ru plugin/matchparen.vim and see whether it breaks anything or > not. > Now highlighting appears and everything works correctly. Starting vim normally like so: vim generate.scm and with this .vimrc set nocp filetype on syntax on Also results in correct behavior (the filetype detection correctly identifies this file as 'scheme' and sets the ft option properly -- I checked it with :set). However, if I remove the 'syntax on' from .vimrc: set nocp filetype on the highlighting behavior is incorrect, but % works correctly!! My original .vimrc had neither the 'filetype on' nor the 'syntax on' commands. Adding them fixes the problem. I'm grateful to you for helping me solve this. Many thanks. I would offer the following comment, though. Perhaps editing scheme/lisp code is not a primary focus of vim, but it is supported. I'm a very experienced computer professional (now retired after 45 years of writing code -- much of it OS (IBM CP/67, PDP-10 Tenex and Tops20, Mach) internals in assembly language and C -- and managing software projects large and small) and it is by no means clear to me how I could have solved this without your help. There may be a bug or two here (e.g, why do % and highlighting go their separate ways when only 'filetype on' is specified?) and/or perhaps inadequate documentation on the issue of % and paren highlighting. It's also possible I just haven't dug hard enough in the documentation, though when % did not work correctly, I did the obvious -- I read :help %, which was of no help in dealing with this particular problem (no mention of filetype detection or syntax highlighting and certainly no mention anywhere that I have found that 'syntax on' is critical to getting the highlighting right, even though highlighting works without it, incorrectly, despite vim knowing it's editing scheme). The vimbook was not helpful either, though I realize it's pretty old. In my opinion, this should all work correctly by default (by this I mean that filetype detection should be on by default and the highlighting ought to work correctly without turning full syntax coloring on, which I'm guessing more would not want on by default) and not require a research project. If I can find the time (retired != not busy), I will have a look at the code and see if I can untangle this. I would also ask that people familiar with this code have a look, too. Again, thanks very much for your help. /Don > > -- > Sergey Khorev > http://sites.google.com/site/khorser > Can anybody think of a good tagline I can steal? > > -- > 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 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
