Open zzantares opened 8 years ago
Do you have any suspicion of why is this happening @syl20bnr? I could try to look in to this but I don't where or what to search in the code.
Thanks.
This happens because of the temporary insertion of the first letter of the escape sequence.
Some modes automatically indent code whenever you insert a character, and aggressive-indent-mode will let you get that behavior even in modes that don't.
I think you're probably dealing with one of those.
Thanks @NateEag so the problem is in the mode itself? I'll look in to that.
Thanks.
@ZzAntares That's my belief, anyway. I have not actually tested your scenario myself.
However, the insert-first-keystroke-then-delete-it-on-second-one behavior has been causing me similar frustrations with my hacked version of aggressive-fill-mode.
My unpolished changes to aggressive-fill-mode make it fill after every character insertion.
Thus, when the first letter of my escape sequence gets inserted, it triggers a fill, which happens with the character in place.
On the next keystroke, the j is erased, which does not trigger a fill, and thus leaves my paragraph filled slightly wrong.
It also bites me if I escape after entering a blank line below a paragraph. The temporary character makes fill-paragraph see the line as not blank, then filling is triggered, so the j is moved up a line, then deleted, effectively erasing the blank line I just entered.
That's not really related to this issue - just wanted to explain the reasons behind my diagnosis. Your issue sounds very similar to the ones I've been having, so I assume it's the same cause.
I don't have a good solution for either case at the moment, just this analysis.
addendum - I realized today that the paragraph removal I was seeing was due to a mistake I made while trying to eliminate the first problem I described. I thought I'd reverted the bad change, but apparently it stuck around somehow.
The above is probably still useful in understanding the behavior described in this issue, but the second behavior was not something that would have been reproducible outside my personal config.
We may be able to fix this by temporarily inhibiting minor modes that auto-intend things on insertion.
If you can provide a quick repro step I should be able to identify the minor mode and provide a fix.
Le vendredi 4 novembre 2016, Nate Eagleson notifications@github.com a écrit :
addendum - I realized today that the paragraph removal I was seeing was due to a mistake I made while trying to eliminate the first problem I described. I thought I'd reverted the bad change, but apparently it stuck around somehow.
The above is probably still useful in understanding the behavior described in this issue, but the second behavior was not something that would have been reproducible outside my personal config.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/syl20bnr/evil-escape/issues/69#issuecomment-258450976, or mute the thread https://github.com/notifications/unsubscribe-auth/ABL5kdJ9xvU3f6whDTsu03Aop0uh7AHPks5q60WAgaJpZM4JBqIj .
-syl20bnr-
Thanks @syl20bnr, here is what I did to reproduce the issue outside of my own emacs:
evil
and evil-escape
, eval this settings:(evil-mode 1)
(evil-escape-mode 1)
(setq-default evil-escape-key-sequence "kj")
(setq-default evil-escape-delay 0.3)
(global-set-key (kbd "<escape>") 'evil-escape)
.py
or a .rb
file and insert something()
RET
(so closing parenthesis )
should now be in its own line)escape-key-sequence
defined (kj
in this case), the closing parenthesis will move.If you repeat the steps but escaping with ESC
the closing parenthesis does not move, this is the preferred behavior.
Thanks!
Do we have some kind of workaround for this issue?
For the record, I no longer use evil-escape
, I've accustomed my self to use C-[
, my Ctrl
key is my caps lock and the right pinky is very near the [
so it feels very natural. Needless to say that the behavior described is no longer an issue for me.
Hi, I'm having a little annoyance when using the
evil-escape-key-sequence
, basically when I dokj
the indentation on the current line is modified. In the following animation I just want to add the close parenthesis)
in it's own line but keep it currently indented, so I just doRET
and the)
gets correctly indented but as soon as I escapekj
the)
moves out.In the animation I do a second test but now pressing
ESC
and you can see it works fine without moving out the)
, so it's only happening when using the key sequence.Is there any magic setting I could use to avoid this effect?
Thanks