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

Avoid invalid expression and type mismatch #491

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Avoid invalid expression and type mismatch #491

wants to merge 1 commit into from

Conversation

davebv
Copy link

@davebv davebv commented Oct 16, 2013

Invalid expression error is produced when trying to open certain tags: This avoids the error:

Error detected while processing function 57_AcceptSelection:
line 30:
E685: Internal error: get_tv_string_buf()
E15: Invalid expression: type == 'dict' ? [{ 'action': md, 'line': line, 'icr': icr }] : [md, line]
line 31:
E121: Undefined variable: actargs
E116: Invalid arguments for function call

Invalid expression error is produced when trying to open certain tags
@@ -1084,8 +1084,11 @@ fu! s:AcceptSelection(action)
let type = exttype == 'dict' ? exttype : 'list'
en
en
let actargs = type == 'dict' ? [{ 'action': md, 'line': line, 'icr': icr }]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid expression error was triggered with this line.

@kien
Copy link
Owner

kien commented Oct 16, 2013

Can you provide steps to reproduce the error? Does updating Vim help? It looks like the parser confuses the colons in the Dictionary with operators.

@davebv
Copy link
Author

davebv commented Oct 16, 2013

To reproduce the error:

  1. Create tags file in ctags
  2. :CtrlPTags
  3. Search for any tag and try to open it.
  4. Error pops up.

Tested with vim 7.1

@kien
Copy link
Owner

kien commented Oct 16, 2013

Thanks! I can't reproduce it in Vim 7.1.0 to 7.4.0, but in 7.0.0. Looks like it's an old bug with the parser when Dictionary was new. I use ternary operators often, however, so I may have to change a few other places as well.

@davebv
Copy link
Author

davebv commented Oct 16, 2013

Thank you for the quick response! 👍

@d11wtq
Copy link

d11wtq commented Aug 8, 2014

@davebv is this still an issue? Wondering if this needs merging into https://github.com/ctrlpvim/ctrlp.vim or not.

@davebv
Copy link
Author

davebv commented Sep 15, 2014

I believe this will help when using dictionaries in Vim. I have problems with 7.1 but cannot reproduce it in newer versions.

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 this pull request may close these issues.

None yet

3 participants