Fixed #95 (the first selection item choosen on ENTER+nothing selected) by manual merge of tbabej's pull request.

This commit is contained in:
Martin Dvorak 2014-12-20 10:11:23 +01:00
parent 157a8bf466
commit 17eac61060
2 changed files with 14 additions and 1 deletions

2
dist/github-env.sh vendored
View file

@ -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

View file

@ -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: