src/tokenizer: Add ":@" to the list of non-path-component chars

This makes kill-path-component stop there.

Fixes #5841.
This commit is contained in:
Fabian Homborg 2019-04-26 19:07:33 +02:00
parent ebf1914a35
commit 009ecfd7e6
3 changed files with 20 additions and 1 deletions

View file

@ -638,7 +638,7 @@ bool move_word_state_machine_t::consume_char_punctuation(wchar_t c) {
bool move_word_state_machine_t::is_path_component_character(wchar_t c) {
// Always treat separators as first. All this does is ensure that we treat ^ as a string
// character instead of as stderr redirection, which I hypothesize is usually what is desired.
return tok_is_string_character(c, true) && !std::wcschr(L"/={,}'\"", c);
return tok_is_string_character(c, true) && !std::wcschr(L"/={,}'\":@", c);
}
bool move_word_state_machine_t::consume_char_path_components(wchar_t c) {

View file

@ -271,3 +271,20 @@ expect_prompt -re {ctrl-o seen} {
} unmatched {
puts stderr "ctrl-o not seen"
}
# \x17 is ctrl-w.
send "echo git@github.com:fish-shell/fish-shell"
send "\x17\x17\r"
expect_prompt -re {git@github.com:} {
puts "ctrl-w stops at :"
} unmatched {
puts stderr "ctrl-w does not stop at :"
}
send "echo git@github.com:fish-shell/fish-shell"
send "\x17\x17\x17\r"
expect_prompt -re {git@} {
puts "ctrl-w stops at @"
} unmatched {
puts stderr "ctrl-w does not stop at @"
}

View file

@ -20,3 +20,5 @@ emacs transpose words, 100ms timeout: short delay
emacs transpose words, 100ms timeout: long delay
ctrl-v seen
ctrl-o seen
ctrl-w stops at :
ctrl-w stops at @