1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

Update snippet insertion to not insert parenthesis

This commit is contained in:
Andrew Kingston 2024-03-14 14:10:37 +00:00
parent f8690a6bd9
commit 0e94caafcb

View file

@ -271,13 +271,12 @@ export const insertBinding = (view, from, to, text, mode) => {
}
export const insertSnippet = (view, from, to, text) => {
const parsedInsert = `${text}()`
let cursorPos = from + parsedInsert.length - 1
let cursorPos = from + text.length
view.dispatch({
changes: {
from,
to,
insert: parsedInsert,
insert: text,
},
selection: {
anchor: cursorPos,