Incorrect highlighting after autocompletion with C-N or C-P #43

vsushkov opened this Issue Sep 12, 2011 · 3 comments

4 participants


Incorrect highlighting (visual-mode selecting) after autocompletion with C-N or C-P. To reproduce the issue, do the following:

  • create a php file.
  • paste this text: <?php $foo = 'foobar';
  • type foreach and hit the Tab
  • variable will be highlighted, type foo and press C-P. foobar will be substituted.
  • press Tab
  • oops. incorrect highlight (s $va instead of value)

PHP highlighting is slow. Some tweaks like synmaxcol etc can influence the result.
Try pressing ctrl-l (which should repaint), maybe it is just good enough for your exceptional case.
I'm personally not interested enough to fix it. If you want to give it a try a fast fix could be adding make vim repaint or refresh syntax at the end of the snippet or such eg using :redraw command or "syn off | syn on". (untested)
I don't think we should use such command in all cases though.

@ajzafar ajzafar added a commit to ajzafar/vim-snipmate that referenced this issue Oct 5, 2011
@ajzafar ajzafar Update the snippet when jumping to the next stop 9adecbe

I think I'm having the same issue as @vsushkov. It's not the syntax highlighting, it's the text used for selection mode. (After each Tab snipmate highlights any text in the snippet: ${2:this_text})

Occurs for both of these snippets:

snippet dbprint Label debug prints
    Print("${1:Module/Name}", "${2:message}\n"${3:, }${4});${5}
snippet cast Static Cast

Only occurs when I do completion while updating a placeholder: type dbprint<tab>Sni<C-n>/Ver<C-n><tab> and I get something like Print("Snippets/Verbose", "message\n", ) but instead of message being selected, ", "mes is selected. Now snipmats tabstops are incorrect and I can't use them to complete the snippet.

Occurs on Windows in Vim 7.3.

472affc status update
58122ab addon-info
0c5612f adding filter_list required by vim-addon-mru, vim-addon-toc

May be related to #33 .

Oh, and @ajzafar's patch no longer applies. (From converting plugin to autoload and other changes.)


This should be fixed in bbae0a6.

@ajzafar ajzafar closed this Mar 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment