diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0040d872c..9e7845869 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -194,8 +194,7 @@ Interactive improvements - The interactive reader now allows ending a line in a logical operators (``&&`` and ``||``) instead of complaining about a missing command (This was already syntactically valid, but interactive sessions didn't know about it yet). - The prompt is reprinted after a background job exits (:issue:`1018`). -- fish no longer inserts a space after a completion ending in ``.`` or - ``,`` is accepted (:issue:`6928`). +- fish no longer inserts a space after a completion ending in ``.``, ``,`` or ``-`` is accepted (:issue:`6928`). - If a filename is invalid when first pressing Tab, but becomes valid, it will be completed properly on the next attempt (:issue:`6863`). - ``help string match/replace/`` will show the help for string subcommands (:issue:`6786`). - ``fish_key_reader`` sets the exit status to 0 when used with ``--help`` or ``--version`` (:issue:`6964`). diff --git a/src/complete.cpp b/src/complete.cpp index c37b24ae4..a6f182aa9 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -196,7 +196,7 @@ static complete_flags_t resolve_auto_space(const wcstring &comp, complete_flags_ if (flags & COMPLETE_AUTO_SPACE) { new_flags &= ~COMPLETE_AUTO_SPACE; size_t len = comp.size(); - if (len > 0 && (std::wcschr(L"/=@:.,", comp.at(len - 1)) != nullptr)) + if (len > 1 && (std::wcschr(L"/=@:.,-", comp.at(len - 1)) != nullptr)) new_flags |= COMPLETE_NO_SPACE; } return new_flags; diff --git a/src/reader.cpp b/src/reader.cpp index 7180cdeee..e85c53306 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1868,7 +1868,7 @@ static uint32_t get_best_rank(const completion_list_t &comp) { /// /// - If the list is empty, flash the terminal. /// - If the list contains one element, write the whole element, and if the element does not end on -/// a '/', '@', ':', '.', ',' or a '=', also write a trailing space. +/// a '/', '@', ':', '.', ',', '-' or a '=', also write a trailing space. /// - If the list contains multiple elements, insert their common prefix, if any and display /// the list in the pager. Depending on terminal size and the length of the list, the pager /// may either show less than a screenfull and exit or use an interactive pager to allow the