mirror of
https://github.com/dvorka/hstr.git
synced 2025-01-06 15:08:13 +08:00
Fixed #95 (the first selection item choosen on ENTER+nothing selected) by manual merge of tbabej's pull request.
This commit is contained in:
parent
157a8bf466
commit
17eac61060
2 changed files with 14 additions and 1 deletions
2
dist/github-env.sh
vendored
2
dist/github-env.sh
vendored
|
@ -5,6 +5,6 @@ export GH_RELEASE_DIR=~/p/hstr/release
|
||||||
export GH_DISTRO_DIR=${GH_RELEASE_DIR}/release-${NOW}
|
export GH_DISTRO_DIR=${GH_RELEASE_DIR}/release-${NOW}
|
||||||
|
|
||||||
export HHVERSION="1.14"
|
export HHVERSION="1.14"
|
||||||
export GH_MSG="GitHub release automation."
|
export GH_MSG="Keyboard search and improved highlighted."
|
||||||
|
|
||||||
# eof
|
# eof
|
||||||
|
|
13
src/hstr.c
13
src/hstr.c
|
@ -958,6 +958,19 @@ void loop_to_select(Hstr *hstr)
|
||||||
case K_ENTER:
|
case K_ENTER:
|
||||||
case KEY_ENTER:
|
case KEY_ENTER:
|
||||||
executeResult=TRUE;
|
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 K_TAB:
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
case KEY_RIGHT:
|
case KEY_RIGHT:
|
||||||
|
|
Loading…
Reference in a new issue