Closed rnpnr closed 7 months ago
I have now rebased that patch by João on the top of this PR as https://git.sr.ht/~mcepl/vis/commit/09e25541cace . I think it is sufficiently obvious and simple thing, which can only help. If not here, then I will probably send it to the list, when you merge this PR.
I made a couple changes to remove some differences between the two modes:
For the second point vis-complete
has some edge case that causes the name of the current directory to be added if invoked as vis-complete --file ''
but that can be fixed separately.
I have now rebased that patch by João on the top of this PR as https://git.sr.ht/~mcepl/vis/commit/09e25541cace
Thinking about it again this doesn't belong in complete-filename.lua
. It should be made in vis-open
just like how vis-complete
handles ~
separately.
I have now rebased that patch by João on the top of this PR as https://git.sr.ht/~mcepl/vis/commit/09e25541cace
Thinking about it again this doesn't belong in
complete-filename.lua
. It should be made invis-open
just like howvis-complete
handles~
separately.
Looking at the code:
local cmdfmt = "vis-complete --file '%s'"
if expand then cmdfmt = "vis-open -- '%s'*" end
Shouldn’t be fixed in both?
Shouldn’t be fixed in both?
Sorry I mean in the shell scripts themselves. vis-complete
already handles it. It just needs to be added to vis-open
.
Shouldn’t be fixed in both?
Sorry I mean in the shell scripts themselves.
vis-complete
already handles it. It just needs to be added tovis-open
.
Actually, can you reproduce it? Even without João’s commit, vis-open ~/.bashrc
does what it should?
Actually, can you reproduce it?
Yes, when invoked inside vis via <C-x><C-o>
because ~
isn't expanded before being passed to vis-open
. I see the argument for having it be a part of complete-filename.lua
but in that case the special handling should be removed from ~vis-filename
~ vis-complete
.
I think I will just apply this since it cleans up the docs and simplifies a few things and leave it up to someone else to propose a change for expanding ~
.
because
~
isn't expanded before being passed tovis-open
And why should it matter when I have shown that vis-open ~/filename
works as expected?
why should it matter when I have shown that
vis-open ~/filename
works as expected?
It doesn't if invoked inside vis. Open a new file and do i~/<C-x><C-f>
and it will expand to your home directory. Now do i~/<C-x><C-o>
and nothing will happen.
There are probably more things to simplify but at least this makes it easier to see what exactly is different between
<C-x><C-f>
and<C-x><C-o>
.closes #1146
Comments on how to simplify this more would be appreciated!