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:
Johannes Altmanninger
2020-09-27 17:53:18 +02:00
parent 791d23502f
commit e8859b4ce2
2 changed files with 10 additions and 5 deletions

View File

@@ -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;