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

Comment detecting problem in the command source #53

Open
ouuan opened this issue May 8, 2021 · 0 comments
Open

Comment detecting problem in the command source #53

ouuan opened this issue May 8, 2021 · 0 comments

Comments

@ouuan
Copy link

ouuan commented May 8, 2021

As stated in https://vimhelp.org/cmdline.txt.html#:comment:

It is not possible to add a comment to a shell command ":!cmd" or to the ":map" command and a few others (mainly commands that expect expressions), that see the '"' as part of their argument:"

But in handleExSourceCommand, this is not considered:

// remove comment
int i = nextline.lastIndexOf('"');
if (i != -1)
nextline = nextline.remove(i, nextline.size() - i);

This was originally discovered in cpeditor/cpeditor#828, where nnoremap <Space>c :norm ggVG"+ is sourced and becomes ggVG without "+.

A quick fix is to detect whether the " is at the start of a WORD, and maybe also add a special check for map. But it will be better if FakeVim can strictly follow how Vim does this.

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

No branches or pull requests

1 participant