From 6ec0b583f5095eb8632fc473a82352d0309e0ad7 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 16 Sep 2020 23:20:31 +0200 Subject: [PATCH] __fish_paginate: move the cursor to end of recalled commandline When pressing \ep on an empty commandline, the cursor would stay at the beginning of the commandline. Move it to the end of the previous command, this feels a bit more natural. --- share/functions/__fish_paginate.fish | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/share/functions/__fish_paginate.fish b/share/functions/__fish_paginate.fish index 696c6137a..219046706 100644 --- a/share/functions/__fish_paginate.fish +++ b/share/functions/__fish_paginate.fish @@ -6,11 +6,10 @@ function __fish_paginate -d "Paginate the current command using the users defaul end if test -z (commandline -j | string join '') - commandline -a $history[1] + commandline -i $history[1] end - if commandline -j | string match -q -r -v "$cmd *\$" - + if commandline -j | not string match -q -r "$cmd *\$" commandline -aj " &| $cmd;" end