mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-19 13:01:15 -03:00
Do not treat newlines special in bigword movements
Improves on #7328. I believe this is the correct behavior, simply skip all whitespace before a word. Try with ./fish -C 'bind \ef forward-bigword; bind \eb backward-bigword; bind \ed kill-bigword; bind \cw backward-kill-bigword' Also unrelated formatting fixes. I don't think a CI failure on unformatted code is warranted but I wish it could do that behind the scenes.
This commit is contained in:
@@ -819,7 +819,7 @@ bool move_word_state_machine_t::consume_char_whitespace(wchar_t c) {
|
||||
case s_always_one: {
|
||||
consumed = true; // always consume the first character
|
||||
// If it's not whitespace, only consume those from here.
|
||||
if (!iswblank(c)) {
|
||||
if (!iswspace(c)) {
|
||||
state = s_graph;
|
||||
} else {
|
||||
// If it's whitespace, keep consuming whitespace until the graphs.
|
||||
@@ -828,7 +828,7 @@ bool move_word_state_machine_t::consume_char_whitespace(wchar_t c) {
|
||||
break;
|
||||
}
|
||||
case s_blank: {
|
||||
if (iswblank(c)) {
|
||||
if (iswspace(c)) {
|
||||
consumed = true; // consumed whitespace
|
||||
} else {
|
||||
state = s_graph;
|
||||
@@ -836,7 +836,7 @@ bool move_word_state_machine_t::consume_char_whitespace(wchar_t c) {
|
||||
break;
|
||||
}
|
||||
case s_graph: {
|
||||
if (!iswblank(c)) {
|
||||
if (!iswspace(c)) {
|
||||
consumed = true; // consumed printable non-space
|
||||
} else {
|
||||
state = s_end;
|
||||
|
||||
Reference in New Issue
Block a user