scroll to top when found

This commit is contained in:
chromoxdor
2025-07-25 19:15:21 +02:00
parent e6d27c2ba1
commit 086eed28e7
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -832,12 +832,13 @@ var isSame;
cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
if (!cursor.find(rev)) return;
}
// Highlight current match
//cXd Highlight current match
highlightCurrentMatch(cursor.from(), cursor.to());
cm.setSelection(cursor.from(), cursor.to());
cm.scrollIntoView({ from: cursor.from(), to: cursor.to() }, 20);
//cm.scrollIntoView({ from: cursor.from(), to: cursor.to() }, 20);
cm.scrollTo(null, cm.charCoords(cursor.from(), 'local').top); // cXd scroll line to top
state.posFrom = cursor.from();
state.posTo = cursor.to();
if (callback) callback(cursor.from(), cursor.to());
+1 -1
View File
File diff suppressed because one or more lines are too long