Skip to content

Commit 5382526

Browse files
committed
[enh] add support for arrow keys as hotkeys - closes asciimoo#10
1 parent 7b850f6 commit 5382526

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type Rule struct {
5757

5858
type Aliases map[string]string
5959

60-
var hotkeyKeyRe *regexp.Regexp = regexp.MustCompile("^((ctrl|alt|meta)\\+)?([a-z0-9/?]|enter|tab)$")
60+
var hotkeyKeyRe *regexp.Regexp = regexp.MustCompile("^((ctrl|alt|meta)\\+)?([a-z0-9/?]|enter|tab|arrow(up|down|right|left))$")
6161
var hotkeyActions = []string{
6262
"select_previous_result",
6363
"select_next_result",

server/static/js/search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ const tips = [
4040
'Use <code>*</code> for partial match.<br />Prefixing word with <code>-</code> excludes matching documents.',
4141
'Click on the three dots near the result URL to specify priority queries for that result.',
4242
'Press <code>enter</code> to open the first result.',
43-
'Use <code>alt+k</code> and <code>alt+j</code> to navigate between results.',
43+
'Use <code>alt+k</code> and <code>alt+j</code> to navigate between results.', // TODO replace keybindings to configured hotkeys
4444
'Press <code>alt+o</code> to open current search query in your configured search engine.',
45-
'Use <code>url:</code> prefix to search only in the URL field. E.g.: <code>url:*github* hister</code>.',
45+
'Use <code>url:</code> prefix to search only in the URL field. E.g.: <code>url:*github* hister</code>.', // TODO replace keybindings to configured hotkeys
4646
'Set hister to your default search engine in your browser to access it with ease.',
4747
'Start search query with <code>!!</code> to open the query in your configured search engine',
4848
];

0 commit comments

Comments
 (0)