Wednesday, April 26, 2017

Syntax highlighting problem when foldmethod=syntax is set

Hi,

I have noticed a problem with syntax highlighting when using the
following .vimrc (minimal to reproduce the thing):
#v+
syntax on
set nocompatible
set foldmethod=syntax
set nofoldenable
#v-

I am not sure if it is a bug or a feature because I rarely use folding
but I suspect the former.

With foldmethod=syntax making a comment (in C in this example) has the
following effect:
- /* makes many lines below to be colored as a comment,
- the comment body follows,
- after closing the comment with */ only the next line regains proper
colors but other lines below remain being colored like a comment.

Without setting foldmethod=syntax highlighting works properly.

I have made some screenshots to visualize the problem:
http://wodny.org/download/vim-bug/

Should I fix something in my mindset or should I file a bug? Write on
vim_dev?



VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 13 2017 01:36:41)
Included patches: 1-488, 576
Extra patches: 8.0.0322, 8.0.0056
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by jamessan@debian.org
Huge version with GTK2 GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
+balloon_eval +float +mouse_urxvt -tag_any_white
+browse +folding +mouse_xterm +tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent +gettext -mzscheme +textobjects
+clientserver -hangul_input +netbeans_intg +title
+clipboard +iconv +path_extra +toolbar
+cmdline_compl +insert_expand +perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con_gui +lua +rightleft +windows
+diff +menu +ruby +writebackup
+digraphs +mksession +scrollbind +X11
+dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent +xim
+emacs_tags +mouseshape -sniff +xsmp_interact
+eval +mouse_dec +startuptime +xterm_clipboard
+ex_extra +mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop +xpm


--
Marcin Szewczyk
http://wodny.org

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: