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

Can not open second file with space in filename #2252

Closed
getreu opened this issue Apr 24, 2022 · 7 comments
Closed

Can not open second file with space in filename #2252

getreu opened this issue Apr 24, 2022 · 7 comments
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@getreu
Copy link
Contributor

getreu commented Apr 24, 2022

Summary

After :vs one can correctly select files with a space in the filename with the cursor.
Instead of opening that file, hx splits the selection wrongly using a space delimiter and tries to open the words individually.

Reproduction Steps

I tried this:

  1. hx

  2. :vs hello world.md

I expected this to happen:

The file hello world.md opens.

Instead, this happened:

hx tries to open hello und world.md.

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

Platform

Linux Debian 11

Terminal Emulator

xfce4-terminal

Helix Version

helix 22.05-dev (a8cb466)

@getreu getreu added the C-bug Category: This is a bug label Apr 24, 2022
@the-mikedavis
Copy link
Member

Wrapping the file name in quotes ("hello world.md") or using a backslash before the space to escape it (hello\ world.md) only open the intended file.

I think it would make sense to have the file auto-complete insert the backslash version when completing.

@the-mikedavis the-mikedavis added the A-helix-term Area: Helix term improvements label Apr 24, 2022
@kirawi
Copy link
Member

kirawi commented Apr 24, 2022

For me, it still seems to open two new splits. Maybe you tried hx "hello world.txt" (which works) and not :vs "hello world.txt"?
Capture2

@the-mikedavis
Copy link
Member

Ah you caught me, I was using :o 😅

I just gave it a try with :vs though and it only opens the one split. I don't see the same behavior with it making multiple new splits 🤔

@getreu
Copy link
Contributor Author

getreu commented Apr 25, 2022

When you surround the filename (manually) with double quotes, the file opens as expected. Still, this is very confusing (and not ergonomic) because: when you scroll with [tab] through the file list, you expect [Enter] to open the file you just selected.
Instead it opens 2 or 3 empty splits
t-rec_1
.

@getreu
Copy link
Contributor Author

getreu commented Jun 10, 2022

Probably the easiest way to fix this is:

  • When selecting a filename with tab, it should be quoted automatically (e.g. "hello world.md") and only then copied into the bottom editor line (e.g. vs: "hello world.md").

@getreu
Copy link
Contributor Author

getreu commented Jun 10, 2022

#1231 is not a fix for this issue, but seems related.

@woojiq
Copy link
Contributor

woojiq commented Aug 3, 2023

Fixed by #4316

@gabydd gabydd closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

5 participants