fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerPrepare to not localize private function descriptionsd835c5252

master
786 B28 linesraw
1# localization: tier1
2# Depending on cursor position and current mode, either search backward or move up one line"
3function up-or-search -d "Search back or move cursor up 1 line"
4    # If we are already in search mode, continue
5    if commandline --search-mode
6        commandline -f history-search-backward
7        return
8    end
9
10    # If we are navigating the pager, then up always navigates
11    if commandline --paging-mode
12        commandline -f up-line
13        return
14    end
15
16    # We are not already in search mode.
17    # If we are on the top line, start search mode,
18    # otherwise move up
19    set -l lineno (commandline -L)
20
21    switch $lineno
22        case 1
23            commandline -f history-search-backward
24
25        case '*'
26            commandline -f up-line
27    end
28end