mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 04:07:47 +00:00
scroll to top when found
This commit is contained in:
@@ -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());
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user