continue-custom/core/nextEdit/utils.ts
Jacob Kim 6430a84c5c
fix: next edit renders that should render decorations will render them properly (#7160)
* fix: passing next edit requests will render things

* chore: remove comment

* feat: skip whitespace only deletions

* feat: add a utility function for checking if a diff is a whitespace only deletion

* feat: add test for next edit utils

* feat: move filtering to NextEditProvider

* fix: escape newline properly

* feat: make jump decoration more visible

* feat: remove redundant escapes

* fix: undo the escapeSVG

* fix: update tests

* fix: use proper line heights

* fix: place the SVG at the end of the line

* fix: handle cases where the completion is a single line

* feat: improve next edit UI (#7167)

* fix: use proper line heights

* fix: place the SVG at the end of the line

* fix: handle cases where the completion is a single line

* fix: allocate more memory for the GUI build step

* fix: set flag as node options

* fix: jump scrolls only after accepting

* fix: update jump manager vitest
2025-08-15 15:18:17 -04:00

23 lines
463 B
TypeScript

import { DiffLine } from "..";
export function isNextEditTest(): boolean {
const enabled = process.env.NEXT_EDIT_TEST_ENABLED;
if (enabled === "false") {
return false;
}
if (enabled === "true") {
return true;
}
return false;
}
export function isWhitespaceOnlyDeletion(diffLines: DiffLine[]): boolean {
return diffLines.every(
(diff) =>
diff.type === "old" &&
(diff.line.trim() === "" || /^\s+$/.test(diff.line)),
);
}