gazorby / fish-abbreviation-tips

💡 Help you remembering your abbreviations
MIT License
299 stars 7 forks source link

`__abbr_tips_init` not running automatically #17

Closed gczarnocki closed 2 years ago

gczarnocki commented 3 years ago

Question

Hello! First of all, thanks for this plugin for Fish, really appreciated. Helps when using lots of aliases.

I have a question about __abbr_tips_init because it seems that it's not running automatically when I modify my aliases:

I've added an abbreviation: abbr -a -U -- g 'git' and running git doesn't show abbr:

(...)
See 'git help git' for an overview of the system.

After running __abbr_tips_init, it's shown:

See 'git help git' for an overview of the system.

💡 g => git

My Fish version:

fish, version 3.3.1

System version:

Manjaro 21 Ornara

neofetch 
██████████████████  ████████   ...
██████████████████  ████████   ----------------- 
██████████████████  ████████   OS: Manjaro Linux x86_64 
██████████████████  ████████   Host: ...
████████            ████████   Kernel: 5.10.59-1-MANJARO 
████████  ████████  ████████   Uptime: 2 days, 22 hours, 4 mins 
████████  ████████  ████████   Packages: 1283 (pacman) 
████████  ████████  ████████   Shell: fish 3.3.1 
████████  ████████  ████████   Resolution: 1920x1080, 1920x1080 
████████  ████████  ████████   DE: Plasma 5.22.4 
████████  ████████  ████████   WM: KWin 
████████  ████████  ████████   Theme: Breath2 2021 Dark [Plasma], Breath [GTK2/3] 
████████  ████████  ████████   Icons: [Plasma], breath2 [GTK2/3] 
████████  ████████  ████████   Terminal: vscode

Fisher plugins:

jorgebucaran/fisher
PatrickF1/fzf.fish
jethrokuan/z
gazorby/fish-abbreviation-tips
danhper/fish-ssh-agent

I haven't seen anything in documentation about running this above command manually and I am wondering if there's some problem on my end.

gazorby commented 3 years ago

Hi @gczarnocki

__abbr_tips_init is only called once when plugin is installed to generate tips for existing aliases. Then a function is called each time you type a command and checks when you are using abbr -a to add a new abbreviation, and if so, tips are updated.

gazorby commented 3 years ago

I'm able to reproduce this bug, it seems that using -U and -- to pass arguments prevents the plugin to detect that you are adding a new abbreviation

Using abbr -a g 'git' should works

gazorby commented 3 years ago

e877e28835681e387e55ea2bfa5003271b036a00 on master should fix this. You should now be able to pass any options to abbr along with arguments

@gczarnocki can you confirm?