mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 19:03:38 +08:00
6ec0b583f5
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.
17 lines
374 B
Fish
17 lines
374 B
Fish
function __fish_paginate -d "Paginate the current command using the users default pager"
|
|
|
|
set -l cmd less
|
|
if set -q PAGER
|
|
echo $PAGER | read -at cmd
|
|
end
|
|
|
|
if test -z (commandline -j | string join '')
|
|
commandline -i $history[1]
|
|
end
|
|
|
|
if commandline -j | not string match -q -r "$cmd *\$"
|
|
commandline -aj " &| $cmd;"
|
|
end
|
|
|
|
end
|