From 135c5a97469179ba2dbc510bdf352323a073b361 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sun, 4 Oct 2020 12:28:12 +0200 Subject: [PATCH] abbr: Don't write an error if erasing nonexisting abbrs Fixes #7376. --- share/functions/abbr.fish | 1 - tests/checks/abbr.fish | 1 - 2 files changed, 2 deletions(-) diff --git a/share/functions/abbr.fish b/share/functions/abbr.fish index 3e70555bd..b68517645 100644 --- a/share/functions/abbr.fish +++ b/share/functions/abbr.fish @@ -109,7 +109,6 @@ function __fish_abbr_erase --no-scope-shadowing set -l abbr_var_name _fish_abbr_(string escape --style=var -- $abbr_name) if not set -q $abbr_var_name - printf ( _ "%s %s: No abbreviation named %s\n" ) abbr --erase $escaped_name >&2 set ret 4 # like `set -e doesnt_exist` end diff --git a/tests/checks/abbr.fish b/tests/checks/abbr.fish index 6c04268e4..c78107ff6 100644 --- a/tests/checks/abbr.fish +++ b/tests/checks/abbr.fish @@ -8,7 +8,6 @@ abbr | grep __abbr1 abbr --erase NOT_AN_ABBR abbr | grep __abbr1 # CHECK: abbr -a -U -- __abbr1 'alpha beta gamma' -# CHECKERR: abbr --erase: No abbreviation named NOT_AN_ABBR # Adding existing __abbr1 should be idempotent abbr __abbr1 alpha beta gamma