From 17eac610603882509137bf12206822562e791ba9 Mon Sep 17 00:00:00 2001 From: Martin Dvorak Date: Sat, 20 Dec 2014 10:11:23 +0100 Subject: [PATCH] Fixed #95 (the first selection item choosen on ENTER+nothing selected) by manual merge of tbabej's pull request. --- dist/github-env.sh | 2 +- src/hstr.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dist/github-env.sh b/dist/github-env.sh index 1e5533b..0cc9b25 100755 --- a/dist/github-env.sh +++ b/dist/github-env.sh @@ -5,6 +5,6 @@ export GH_RELEASE_DIR=~/p/hstr/release export GH_DISTRO_DIR=${GH_RELEASE_DIR}/release-${NOW} export HHVERSION="1.14" -export GH_MSG="GitHub release automation." +export GH_MSG="Keyboard search and improved highlighted." # eof diff --git a/src/hstr.c b/src/hstr.c index 9beb9bb..699ad6b 100644 --- a/src/hstr.c +++ b/src/hstr.c @@ -958,6 +958,19 @@ void loop_to_select(Hstr *hstr) case K_ENTER: case KEY_ENTER: executeResult=TRUE; + if(selectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) { + result=hstr->selection[selectionCursorPosition]; + if(hstr->historyView==HH_VIEW_FAVORITES) { + favorites_choose(hstr->favorites,result); + } + } + else { + if (hstr->selectionSize > 0) { + result=hstr->selection[0]; + } + } + done=TRUE; + break; case K_TAB: case KEY_LEFT: case KEY_RIGHT: