Closed aaronjensen closed 4 years ago
ping @abo-abo just in case you have an idea if anything has changed in this area.
I believe the problem was introduced here: https://github.com/emacs-evil/evil/pull/985
(evil-set-initial-state 'ivy-occur-grep-mode 'normal)
seems to work around it, but i'm not sure that's the right way.
(evil-set-initial-state 'ivy-occur-grep-mode 'normal) seems to work around it, but i'm not sure that's the right way.
Looks like a problem in evil
config; I think above is the correct solution.
Thanks for responding @abo-abo. Is there a hook for when ivy-occur-grep goes from read-only to writable and back? I may be able to set states in that case
Doesn't (evil-set-initial-state 'ivy-occur-grep-mode 'normal)
solve your problem?
Yes, it does, but ideally it would be in motion state unless the buffer is writable. So the idea is would be to have motion state be the default as it is now but change to normal when switching to non Read only.
I'm not very familiar with evil
. But I think that ivy-occur
buffers should be treated similarly to dired
buffers. Both have ways of becoming editable, but they are primarily in their own normal modes with commands not related to evil
.
Thanks, I believe dired is "evilified". I'm not too familiar w/ how to set that up or what the right thing to do here is so I'll wait for @syl20bnr or someone else to have time to chime in. Thanks!
I am also having issues, even with (evil-set-initial-state 'ivy-occur-grep-mode 'normal)
. I remember my workflow below working previously.
For example,
thingToEdit
in buffer of interestSPC /
M-n
C-c C-o
/thingToEdit RET
cursor now on thingToEdit
in ivy-occur buffercw
but instead of change-word, c
now calls ivy-occur-toggle-calling
Navigating to thingToEdit
by moving manually with wbhjkl
, followed by cw
seems to work though.
EDIT: as described below, the above sequence never worked, and I was confused about the behavior of C-c C-o
, C-x C-q
and w
.
Hey @opsound, C-c C-o
opens a read-only ivy-occur buffer. It is and never was expected that this would be editable. C-c C-e
opens it editable or you could make it editable with C-x C-q
or w
after C-c C-o
. This explains why navigating in a way that includes w
makes it editable.
In other words, what you're describing is the expected behavior. Hope that helps.
@aaronjensen Ah - good call. w
changing the buffer to be editable explains my confusion. I had thought that C-c C-o
had new behavior that didn't require C-x C-q
.
Should be solved by #10873 now, thanks for the report and for the help everyone.
The issue is back now since that fix has been reverted
@et2010
can you elaborate when is it reverted? (in which commit)
Description :octocat:
ivy-occur is no longer editable
Reproduction guide :beetle:
SPC /
C-c C-e
c w
for example)If you disable evil-mode, you can edit it
Observed behaviour: :eyes: :broken_heart: You can't edit the buffer, it uses the normal occur map which doesn't have any change commands in evil.
Expected behaviour: :heart: :smile: You can edit the buffer
System Info :computer: