mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
chore: fix test
This commit is contained in:
@@ -572,6 +572,15 @@ test.describe('CodeEditor — undo (Cmd-Z) survives a tab switch', () => {
|
|||||||
} finally {
|
} finally {
|
||||||
handlersSlot.change = savedChange;
|
handlersSlot.change = savedChange;
|
||||||
}
|
}
|
||||||
|
// Mirror real typing: a user's cursor lands at the end of the text
|
||||||
|
// they just typed, and CM5 scrolls the cursor into view. Without
|
||||||
|
// this, the viewport stays parked at the top, and on shorter
|
||||||
|
// viewports (e.g. macOS CI) the last appended line falls outside
|
||||||
|
// the rendered range — CM virtualizes off-viewport lines, so the
|
||||||
|
// sentinel is in the doc but not in the DOM, and `toContainText`
|
||||||
|
// can't see it.
|
||||||
|
const last = doc.lastLine();
|
||||||
|
editor.setCursor({ line: last, ch: doc.getLine(last).length });
|
||||||
// `_onEdit` only reads `editor.getValue()`; the change descriptor
|
// `_onEdit` only reads `editor.getValue()`; the change descriptor
|
||||||
// arg is unused, so passing null is safe.
|
// arg is unused, so passing null is safe.
|
||||||
savedChange.forEach((handler: (cm: unknown, change: unknown) => void) => {
|
savedChange.forEach((handler: (cm: unknown, change: unknown) => void) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user