-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
xreadline by word movement #1971
base: master
Are you sure you want to change the base?
Conversation
Can you explain each of the behavioural changes for me to take a call? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested, but some cursory review.
1a1580a
to
1c1211b
Compare
I've pushed some changes:
@jarun do you want |
c667a3a
to
c945f85
Compare
I added Meta-b, Meta-f conforming to https://www.gnu.org/software/bash/manual/bash.html#index-forward_002dword-_0028M_002df_0029 as well as the corresponding deletion commands, M-d and M-bspc. They move cursor by word boundary, where a word is defined to be composed of letters and digits. |
I hadn't considered unicode, but could isspace be turned into something to include all the other non-word (non alphanum) characters within ascii range as well? |
What meaningful difference does it make? |
the word boundaries differ, do they not? many filenames have underscores in them, or dashes. navigating between those is the whole point of these movements. paths contain slashes, same thing. also: strictly speaking, Ctrl-w explicitly differs from Meta-bspc by what it considers a word boundary. whitespace vs non-alphanumerical (including unicode, not sure if it distinguishes between unicode "special characters" and the rest off the top of my head). edit: there's also |
added M-b, M-f, M-d, M-bspc according to GNU readline specifications.
c945f85
to
d6b1b80
Compare
Ok, I see. I've switched to
I've left out
Yes, I thought about it just now as well. |
We can keep it the same as readline. |
when there's multiple spaces, the previous logic didn't erase them, e.g: a word | < before a word | < after Ctrl-w this patch brings the behavior closer to readline's: a word | < before a | < after Ctrl-w this also slightly changes the behavior since '/' is no longer considered a boundary.
Okay, done. @doremiyeon can you test it out and make sure everything still works as intended? |
is this useful? added by-word navigation and deletion bindings for xreadline()