detached 64df752

Merge pull request #152 from bnema/fix/ghosttext-min-input

fix(omnibox): delay ghost text until input
commit
64df752eea7e657e1e57ca282f01bb829eaa359b
author
bnema · · 2026-01-26 20:51 UTC
committer
GitHub · · 2026-01-26 20:51 UTC
merge of
f83af18 + f63d1aa · diff against the first parent
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
1 file · +7 -0
M internal/ui/component/omnibox.go +7 -0
@@ -30,6 +30,7 @@ const (
3030 defaultOmniboxPlaceholder = "Search history or enter URL… (! lists bangs)"
3131 ghostPositionRetryMs = 16
3232 ghostPositionMaxAttempts = 5
33+ minGhostInputLength = 1
3334 )
3435
3536 // ViewMode distinguishes history search from favorites display.
@@ -1084,6 +1085,7 @@ func (o *Omnibox) updateGhostFromSelectionWithInput(entryText string) {
10841085 idx := o.selectedIndex
10851086 mode := o.viewMode
10861087 bangMode := o.bangMode
1088+ hasNavigated := o.hasNavigated
10871089 suggestions := o.suggestions
10881090 favorites := o.favorites
10891091 o.mu.RUnlock()
@@ -1094,6 +1096,11 @@ func (o *Omnibox) updateGhostFromSelectionWithInput(entryText string) {
10941096 return
10951097 }
10961098
1099+ if utf8.RuneCountInString(entryText) < minGhostInputLength && !hasNavigated {
1100+ o.clearGhostTextIfInput(entryText)
1101+ return
1102+ }
1103+
10971104 if entryText != "" {
10981105 o.resolveGhostCompletion(entryText, mode, suggestions, favorites)
10991106 return
@@ -30,6 +30,7 @@ const (
30 defaultOmniboxPlaceholder = "Search history or enter URL… (! lists bangs)"30 defaultOmniboxPlaceholder = "Search history or enter URL… (! lists bangs)"
31 ghostPositionRetryMs = 1631 ghostPositionRetryMs = 16
32 ghostPositionMaxAttempts = 532 ghostPositionMaxAttempts = 5
33+ minGhostInputLength = 1
33 )34 )
34 35
35 // ViewMode distinguishes history search from favorites display.36 // ViewMode distinguishes history search from favorites display.
@@ -1084,6 +1085,7 @@ func (o *Omnibox) updateGhostFromSelectionWithInput(entryText string) {
1084 idx := o.selectedIndex1085 idx := o.selectedIndex
1085 mode := o.viewMode1086 mode := o.viewMode
1086 bangMode := o.bangMode1087 bangMode := o.bangMode
1088+ hasNavigated := o.hasNavigated
1087 suggestions := o.suggestions1089 suggestions := o.suggestions
1088 favorites := o.favorites1090 favorites := o.favorites
1089 o.mu.RUnlock()1091 o.mu.RUnlock()
@@ -1094,6 +1096,11 @@ func (o *Omnibox) updateGhostFromSelectionWithInput(entryText string) {
1094 return1096 return
1095 }1097 }
1096 1098
1099+ if utf8.RuneCountInString(entryText) < minGhostInputLength && !hasNavigated {
1100+ o.clearGhostTextIfInput(entryText)
1101+ return
1102+ }
1103+
1097 if entryText != "" {1104 if entryText != "" {
1098 o.resolveGhostCompletion(entryText, mode, suggestions, favorites)1105 o.resolveGhostCompletion(entryText, mode, suggestions, favorites)
1099 return1106 return

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close