Skip to content

Commit

Permalink
🐛 Make sure to use builtin history in case if user redefined it
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiborisov committed Aug 31, 2022
1 parent a268c89 commit 36f4b91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion functions/_sponge_on_preexec.fish
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function _sponge_on_preexec --on-event fish_preexec \

set --global _sponge_current_command $command

history search --case-sensitive --exact --max=1 --null $command \
builtin history search --case-sensitive --exact --max=1 --null $command \
| read --local --null found_entries

# If a command is in the history and in the queue, ignore it, like if it wasn’t in the history
Expand Down
4 changes: 2 additions & 2 deletions functions/_sponge_remove_from_history.fish
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function _sponge_remove_from_history

while test (count $_sponge_queue) -gt $sponge_delay
history delete --case-sensitive --exact -- $_sponge_queue[-1]
builtin history delete --case-sensitive --exact -- $_sponge_queue[-1]
set --erase _sponge_queue[-1]
end

history save
builtin history save
end

0 comments on commit 36f4b91

Please sign in to comment.