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

Completion for path with spaces failing #113

Open
Grueslayer opened this issue May 1, 2024 · 0 comments
Open

Completion for path with spaces failing #113

Grueslayer opened this issue May 1, 2024 · 0 comments

Comments

@Grueslayer
Copy link

Filenames needs to be handled differently for some characters (e.g. Space) in the commandline as argument.
Therefore a VimL function fnameescape() can been used. Some characters like Space or Exclamation Mark must be escaped by a backslash.

Let's assume you've a filename file with space.txt and want to open it, you've to write :e file\ with\ space.txt. This is like any Un*x shell behaviour. For windows, where backslash is used for directory structure, weirdly the backslash is still used for escaping those characters c:\dir\ with\ space\subdir\file\ with\ space.txt.

So the path completion must behave differently in the command line, the "standard" vim completion behaves as following:

c:\ and pressing <TAB> gives you a list with

  • c:\Program\ Files\
  • c:\Program\ Files\ (x86)\

and so on. When selection those the commandline would also read as displayed (and can be used).

When using cmp completion you'll see

  • c:\Program Files\
  • c:\Program Files (x86)\

without the escaped spaces.

==> You can not use this in your command line, because it reads that as two arguments (split by space) AND you can not go deeper in the file tree.

So for this case the path completion must call fnameescape() for each entry or you've to unescape the given string from the commandline give that to the path completer and fnameescape() the selected entry before replacing it.

I'm sure this is not a MS Win Problem only but haven't tested it on a Un*x based system.

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