Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vsushkov opened this issue Sep 12, 2011 · 3 comments · Fixed by #117
Closed

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

vsushkov opened this issue Sep 12, 2011 · 3 comments · Fixed by #117

Comments

@vsushkov
Copy link

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: `
  • 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)
@MarcWeber
Copy link
Collaborator

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.

@idbrii
Copy link

idbrii commented Jan 19, 2013

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
    static_cast<${1}>(${2})${3}

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.

Versions:
snipmate
472affc status update
tlib/
58122ab addon-info
mw-utils/
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.)

@ajzafar
Copy link
Collaborator

ajzafar commented Mar 19, 2013

This should be fixed in bbae0a6.

@ajzafar ajzafar closed this as completed Mar 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants