diff --git a/src/builtins/abbr.cpp b/src/builtins/abbr.cpp index 31f10264c..99e065972 100644 --- a/src/builtins/abbr.cpp +++ b/src/builtins/abbr.cpp @@ -103,6 +103,10 @@ static int abbr_show(const abbr_options_t &, io_streams_t &streams) { comps.push_back(L"--regex"); comps.push_back(escape_string(abbr.key)); } + if (abbr.position != abbrs_position_t::command) { + comps.push_back(L"--position"); + comps.push_back(L"anywhere"); + } if (abbr.set_cursor_marker.has_value()) { comps.push_back(L"--set-cursor=" + escape_string(*abbr.set_cursor_marker)); } diff --git a/tests/checks/abbr.fish b/tests/checks/abbr.fish index 17612d53b..36518297f 100644 --- a/tests/checks/abbr.fish +++ b/tests/checks/abbr.fish @@ -156,9 +156,11 @@ abbr --show abbr --add nonregex_name foo abbr --add regex_name --regex 'A[0-9]B' bar +abbr --add !! --position anywhere --function replace_history abbr --show # CHECK: abbr -a -- nonregex_name foo # CHECK: abbr -a --regex 'A[0-9]B' -- regex_name bar +# CHECK: abbr -a --position anywhere --function -- !! replace_history abbr --erase (abbr --list) abbr --add bogus --position never stuff