You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ok this is a little confusing to write out because we're dealing with literally writing out things that would normally signify a key press.
to reproduce bug type these two expressions out in kakoune
:exec i<control r literal char># written like exec i then insert the <c-r> char by pressing <c-v><c-r> then adding # after
:exec i<c-r># when written char for char literally
these output different results
Outcome
output of first expression
-> writes # at each cursor
output of second expression
-> writes the index of the cursor at each cursor
Expectations
both expressions should write the index of each cursor at each cursor
the <c-r> literal character should be evaluated the same as literally typing out <c-r>
Additional information
I've already tried enclosing the expressions in quotes, it doesn't make a difference
The text was updated successfully, but these errors were encountered:
The syntax that execute-keys parses does not represent a byte-string, or even a string of Unicode codepoints, it represents a sequence of key-presses (with the caveat that printable characters are assumed to be "whichever key produces that character", to avoid getting stuck in the weeds of keyboard layouts). So even though ASCII happens to encode Control-R as \x12, execute-keys chooses to represent it as <c-r> for consistency with all the key-presses that ASCII doesn't encode, like <s-tab> and <a-n>.
I don't think this is a bug, as such. To avoid confusion in the future, it might be a good idea for execute-keys to throw an error if it gets unexpected control characters, just like it throws an error if it gets an unexpected modifier (<m-x>) or an unexpected function key (<f99>).
Version of Kakoune
v2024.05.10
Reproducer
Ok this is a little confusing to write out because we're dealing with literally writing out things that would normally signify a key press.
to reproduce bug type these two expressions out in kakoune
:exec i<control r literal char>#
written likeexec i
then insert the<c-r>
char by pressing<c-v><c-r>
then adding#
after:exec i<c-r>#
when written char for char literallythese output different results
Outcome
output of first expression
-> writes
#
at each cursoroutput of second expression
-> writes the index of the cursor at each cursor
Expectations
both expressions should write the index of each cursor at each cursor
the
<c-r>
literal character should be evaluated the same as literally typing out<c-r>
Additional information
I've already tried enclosing the expressions in quotes, it doesn't make a difference
The text was updated successfully, but these errors were encountered: