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

[BUG] :e <directory> #5274

Open
donaldcallen opened this issue Jan 16, 2025 · 3 comments
Open

[BUG] :e <directory> #5274

donaldcallen opened this issue Jan 16, 2025 · 3 comments
Labels

Comments

@donaldcallen
Copy link

Version of Kakoune

Kakoune 2024.05.18

Reproducer

Enter :e and then begin typing a directory that is in the current directory. When the correct directory appears in the bar above the command area, press tab. You will get the entire directory name followed by '/', but the contents of the directory do not appear. However, instead of pressing tab to complete the dirname, you type the rest of it instead, followed by the /, you are now shown the contents of the directory. So the same characters (the dirname + /) follow the :e in both cases, but the outcomes are very different. Furthermore, in the first case (where the contents of the directory are not shown), if you press up-arrow or right-arrow, the contents of the directory will be shown. Where is this documented? I was not able to find it.

Outcome

Already described above.

Expectations

I expect the same argument to :e, however you arrive at it, to produce the same outcome -- the contents of the directory.

Additional information

I'm running kak on an up-to-date Arch Linux system.

@Parasrah
Copy link
Contributor

@donaldcallen I believe this is intentional as part of how the tab completion works. Imagine we have a directory structure like so:

.
├── foo
│   ├── first.txt
│   └── second.txt
└── foot
    ├── fourth.txt
    └── third.txt

3 directories, 4 files

And we open kakoune in this directory. Let's imagine that we want to navigate to foot/third.txt, so we start typing fo<tab>. We now have an auto-completion for both foo and foot, with foo being selected. That's not what we want, so we again insert <tab>. Now foot is selected.

However, what if we knew we wanted foo/first.txt? We could use tab-completion to complete and select the directory via :e fo<tab><c-y>, or we could type out the full directory name with a slash: :e foo/. The slash indicates in this case that you are "selecting" that directory, similar to <c-y>, as by inserting a slash it is asserting that you do indeed intend to open a file in that dir. The helpful thing for the completion engine to do in this case is list the nodes in said directory.

Speaking for myself, I think the current behavior is what I want kakaoune to do, and I don't imagine you're going to find many proponents of changing it.

@donaldcallen
Copy link
Author

Yes, you are right. When you enter enough of the directory name to be unambiguous, it does the right thing. Thanks for setting me straight on this.

@krobelus
Copy link
Contributor

krobelus commented Jan 16, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants