Closed jtrees closed 3 years ago
- I open kakoune from zsh, not sure if that matters.
This should not matter if you set KAKOUNE_POSIX_SHELL
environment variable or if your sh
simlinked to bash
.
The buffer is modified. The first line looks like this: harliegxvclice
This is definitively unexpected. I'll try to look into this at the weekend.
Sorry, wasn't able to look at it during past weekend.
I've tried this now, and I can't reproduce the bug:
https://asciinema.org/a/zET23SMUJycvZal3XhCHjFfdU
Can you provide a bit more details on your configuration? A fzf.kak config for example, or better a minimal kakrc, which reproduces this bug?
Ah, the minimal kakrc was a good idea. I was able to identify the problematic config and found a workaround too:
source "%val{config}/plugins/plug.kak/rc/plug.kak"
plug "andreyorst/fzf.kak" defer fzf-sk-grep %{
set-option global fzf_sk_grep_command "rg"
}
To be honest, I don't really understand why the config shouldn't be deferred. According to the docs...
Each .kak file provides a Kakoune module, so any settings which alter variable values should be wrapped in ModuleLoaded hook.
... which I thought I was doing.
And it seems weird to me that setting the config too late or too early should result in this behaviour anyway. If that's really the issue shouldn't I just end up with the default grep command instead? It's all very strange...
EDIT: Oops, turns out the "workaround" I thought I found really did just leave me with the default grep command. Seems the issue is with the grep command itself.
EDIT 2: Found an even shorter config to reproduce.
Oooooh. The real issue was that I wasn't outputting the line number in the grep command. rg -n
works as expected.
Sorry for wasting your time.
Thanks again for looking in to this and getting me on the right track.
Sorry for wasting your time.
It's ok :)
I still wonder why this changed the buffer, contents, might need a better guard somewhere, that verifies that grep results are correctly formatted. But I'm glad that this is fixed for you now
Problem description
Steps to reproduce
cd $(mktemp -d)
echo "alice\nbob\ncharlie" > foo.txt
kak
char<ret>
What should happen
foo.txt
should be opened in a new bufferfoo.txt
without modificationschar
on line three should be selectedWhat happens instead
foo.txt
is opened in a new bufferharliegxvclice
harliegxvc[l]ice
Environment information
Kakoune version:
Kakoune v2020.09.01
OS version: NixOS 21.05sh
executable version:GNU bash, version 4.4.23(1)-release (x86_64-unknown-linux-gnu)
zsh version*:zsh 5.8 (x86_64-pc-linux-gnu)
fzf version:0.27.1
sk version:0.9.4
rg version:12.1.1
* I open kakoune from zsh, not sure if that matters.
EDIT: Added rg version.