gabrielelana / vim-markdown

Markdown for Vim: a complete environment to create Markdown files with a syntax highlight that doesn't suck!
MIT License
740 stars 59 forks source link

syntax highlighting not syncing #30

Closed y2kbugger closed 8 years ago

y2kbugger commented 9 years ago

sometimes when typing lists, the hyphens dont get highlighted until i scroll, or run :syntax sync fromstart if i run just :syntax sync I get the following response in the status bar and the highlighting does not update.

syncing starts 2147483647 lines before top line

gabrielelana commented 9 years ago

That's strange, could be a vim bug, in the syntax file we already have syn sync fromstart which should do exactly what you do manually to fix the problem...

Maybe you have a personal configuration that disables syn sync fromstart in syntax files?

y2kbugger commented 9 years ago

seems exactly like this guy. https://github.com/justinmk/vim-syntax-extra/issues/4 I wonder what be had wrong with the config. On Apr 20, 2015 4:35 AM, "Gabriele Lana" notifications@github.com wrote:

That's strange, could be a vim bug, in the syntax file we already have syn sync fromstart which should do exactly what you do manually to fix the problem...

Maybe you have a personal configuration that disables syn sync fromstart in syntax files?

— Reply to this email directly or view it on GitHub https://github.com/gabrielelana/vim-markdown/issues/30#issuecomment-94393280 .

gabrielelana commented 9 years ago

@y2kbugger ask him and report here so that the next one with the same issue could find out :smile:

y2kbugger commented 9 years ago

I now notice that it only happens when editing at the end of the buffer, in fact if i move up and add a bullet to an earlier list, the highlight become correct in both places.

gabrielelana commented 9 years ago

Maybe it's a real bug in syntax file, can you create a "small" example that reproduce the issue? If you can it will be great, but before I advise you to try to remove your configuration from the equation :wink:

y2kbugger commented 9 years ago

looks like it is an actual bug somewhere, either with vim, or the vim-markdown. min.vimrc:

"setup for Vundle, the plugin manager
set nocompatible              " be iMproved, required
filetype off                  " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'gabrielelana/vim-markdown'
call vundle#end()
filetype plugin indent on    " required
"===============================================

" enable syntax highlighting
syntax enable

doesn't highlight even upon return to normal mode. image

syntax sync yields this: image

and syntax sync fromstart fixes this highlighting: image

when adding something below, a new bullet gets highlighted correctly and instantly: image

vim version 7.4.663

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

@y2kbugger could you try with the latest (715fa12ff651da838e58e7f88f18d47a1e611a7d) commit?

y2kbugger commented 9 years ago

almost, image to reproduce from fresh doc:

  1. add some bullets,
  2. <Enter><Enter><Enter>
  3. add a first bullet for a new list

There were also a few times that it glitched and didn't highlight that I couldn't reproduced in the time i spent, but iirc it happened when:

gabrielelana commented 9 years ago

@y2kbugger Thank you very much for your help, I'll look into that and I'll keep you posted

BTW markdown it's an ugly beast, all this is happening because detecting when a list item ends it's a nightmare :smile:

gabrielelana commented 8 years ago

Right now I'm unable to reproduce it so I'm going to close this issue