detached 87979c4

find: add ; and : as right-context boundaries; Alt+Enter centers match without closing overlay (Shift+Enter previous)

commit
87979c4af56bca8372b5130510aca611e10bb336
author
bamen · · 2025-09-09 21:29 UTC
committer
bamen · · 2025-09-09 18:52 UTC
parent
d736c5d
signature
unsigned
1 file · +11 -3
M pkg/webkit/ucm_js_cgo.go +11 -3
@@ -63,8 +63,16 @@ func getOmniboxScript() string {
6363 H.toggle(false);
6464 } else if (H.mode==='find' && e.key === 'Enter'){
6565 e.preventDefault();
66- if (e.shiftKey) { H.jump(-1); }
67- else { H.revealSelection(); H.close(); }
66+ if (e.shiftKey) {
67+ H.jump(-1);
68+ } else if (e.altKey) {
69+ // Center on current match but keep overlay open for further navigation
70+ H.revealSelection();
71+ } else {
72+ // Default: center and close
73+ H.revealSelection();
74+ H.close();
75+ }
6876 } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp'){
6977 e.preventDefault();
7078 const n = (H.mode==='find'? H.matches.length : H.suggestions.length);
@@ -162,7 +170,7 @@ func getOmniboxScript() string {
162170 H.highlightNodes.push({span, text: match});
163171 const leftCtx = before.nodeValue.slice(-30);
164172 let rightRaw = afterVal.slice(0, 30);
165- const boundaryIdx = rightRaw.search(/[.,-]/);
173+ const boundaryIdx = rightRaw.search(/[\.,;:\-]/);
166174 if (boundaryIdx !== -1) {
167175 rightRaw = rightRaw.slice(0, boundaryIdx+1);
168176 }
@@ -63,8 +63,16 @@ func getOmniboxScript() string {
63 H.toggle(false);63 H.toggle(false);
64 } else if (H.mode==='find' && e.key === 'Enter'){64 } else if (H.mode==='find' && e.key === 'Enter'){
65 e.preventDefault();65 e.preventDefault();
66- if (e.shiftKey) { H.jump(-1); }66+ if (e.shiftKey) {
67- else { H.revealSelection(); H.close(); }67+ H.jump(-1);
68+ } else if (e.altKey) {
69+ // Center on current match but keep overlay open for further navigation
70+ H.revealSelection();
71+ } else {
72+ // Default: center and close
73+ H.revealSelection();
74+ H.close();
75+ }
68 } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp'){76 } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp'){
69 e.preventDefault();77 e.preventDefault();
70 const n = (H.mode==='find'? H.matches.length : H.suggestions.length);78 const n = (H.mode==='find'? H.matches.length : H.suggestions.length);
@@ -162,7 +170,7 @@ func getOmniboxScript() string {
162 H.highlightNodes.push({span, text: match});170 H.highlightNodes.push({span, text: match});
163 const leftCtx = before.nodeValue.slice(-30);171 const leftCtx = before.nodeValue.slice(-30);
164 let rightRaw = afterVal.slice(0, 30);172 let rightRaw = afterVal.slice(0, 30);
165- const boundaryIdx = rightRaw.search(/[.,-]/);173+ const boundaryIdx = rightRaw.search(/[\.,;:\-]/);
166 if (boundaryIdx !== -1) {174 if (boundaryIdx !== -1) {
167 rightRaw = rightRaw.slice(0, boundaryIdx+1);175 rightRaw = rightRaw.slice(0, boundaryIdx+1);
168 }176 }

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