소스 검색

[visual] Improve cursor position in empty list items (#20611)

GitOrigin-RevId: 08a83b509e217573f680ca4a635d9480ade9b1ae
Alf Eaton 1 년 전
부모
커밋
6f8a9a0f81

+ 1 - 1
services/web/frontend/js/features/source-editor/extensions/toolbar/lists.ts

@@ -69,7 +69,7 @@ const wrapRangeInList = (
   ]
 
   // map through the prefix
-  range = EditorSelection.cursor(range.to).map(state.changes(changes), 1)
+  range = EditorSelection.cursor(range.to, -1).map(state.changes(changes), 1)
 
   changes.push({
     from: toLine.to,

+ 1 - 1
services/web/frontend/js/features/source-editor/extensions/visual/visual-keymap.ts

@@ -110,7 +110,7 @@ export const visualKeymap = Prec.highest(
 
               return {
                 changes: { from, insert },
-                range: EditorSelection.cursor(pos),
+                range: EditorSelection.cursor(pos, -1),
               }
             }