-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behaviour with find_till_char when on last character of a non-empty line #4065
Comments
Note that while what I might consider "expected" may not be the actual intended behaviour, if you go through my test cases I'm pretty sure you'll agree there's some sort of inconsistency going on, so something unexpected in any case. Surely how it behaves on a given line should not be affected by the contents of the following line. |
There doesn't seem to be any inconsistent behaviour here; if we think of the newlines as any other character and view the example as one line:
Place the cursor on
Place the cursor on the third line, on the third
Place the cursor on
Place the cursor on
|
The part of this I thought was buggy:
in Helix gives
where in Kakoune it gives
Helix moves to the next next instance if the next instance follows immediately and Kakoune does not (see this block). It looks like this is an intentional difference though: #891 (comment). So @Omnikar's explanation is spot-on 👍 |
Thanks guys. The fundamental problem here was me continuing to think of the "find till" selection as directly involving the character (in this case newline) rather than selecting up to the character, and not paying close attention to the subtle difference in behaviour between when it selects the current line's newline because it's selecting up to the newline on the following blank line, vs when it's earlier on the line and just selects till but not including the current line's newline. Turning on |
Summary
Using
t
(find_till_char) withEnter
when on the last character of a line behaves unexpectedly. If on a line where the following line is completely empty it appears to work, but if the following line is non-empty then it actually selects until the end of that line, not the one you're on.Reproduction Steps
Using this example:
Place cursor on 1 and
t
Enter
and you select up to 2. Place cursor on 2 and it selects just the 2 (as expected). Cursor on line 3 and it selects till 4 (also as expected). Cursor on 4 behaves (incorrectly?) like 1. Cursor on 5 (i.e. the x) selects till 6 (also notPlatform
Linux
Terminal Emulator
putty
Helix Version
22.08.1-125-g5b5f1bd3
The text was updated successfully, but these errors were encountered: