fix(autocomplete): treat newline as a hard boundary

This commit is contained in:
Will Miao
2026-03-28 19:29:30 +08:00
parent 1ed5eef985
commit e5152108ba
2 changed files with 40 additions and 1 deletions

View File

@@ -676,7 +676,8 @@ class AutoComplete {
_getHardBoundaryStart(beforeCursor = '') {
const lastComma = beforeCursor.lastIndexOf(',');
const lastAngle = beforeCursor.lastIndexOf('>');
return Math.max(lastComma, lastAngle) + 1;
const lastNewline = Math.max(beforeCursor.lastIndexOf('\n'), beforeCursor.lastIndexOf('\r'));
return Math.max(lastComma, lastAngle, lastNewline) + 1;
}
_getMetadataWidget() {