@codemirror/autocomplete 6.3.2 → 6.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +3 -4
- package/dist/index.js +7 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1136,7 +1136,8 @@ const baseTheme = view.EditorView.baseTheme({
|
|
|
1136
1136
|
display: "inline-block",
|
|
1137
1137
|
textAlign: "center",
|
|
1138
1138
|
paddingRight: ".6em",
|
|
1139
|
-
opacity: "0.6"
|
|
1139
|
+
opacity: "0.6",
|
|
1140
|
+
boxSizing: "content-box"
|
|
1140
1141
|
},
|
|
1141
1142
|
".cm-completionIcon-function, .cm-completionIcon-method": {
|
|
1142
1143
|
"&:after": { content: "'ƒ'" }
|
|
@@ -1238,8 +1239,8 @@ class Snippet {
|
|
|
1238
1239
|
positions.push(new FieldPos(found, lines.length, m.index, m.index + name.length));
|
|
1239
1240
|
line = line.slice(0, m.index) + name + line.slice(m.index + m[0].length);
|
|
1240
1241
|
}
|
|
1241
|
-
for (let esc; esc =
|
|
1242
|
-
line = line.slice(0, esc.index) + esc[1] +
|
|
1242
|
+
for (let esc; esc = /\\([{}])/.exec(line);) {
|
|
1243
|
+
line = line.slice(0, esc.index) + esc[1] + line.slice(esc.index + esc[0].length);
|
|
1243
1244
|
for (let pos of positions)
|
|
1244
1245
|
if (pos.line == lines.length && pos.from > esc.index) {
|
|
1245
1246
|
pos.from--;
|
|
@@ -1330,10 +1331,9 @@ The order of fields defaults to textual order, but you can add
|
|
|
1330
1331
|
numbers to placeholders (`${1}` or `${1:defaultText}`) to provide
|
|
1331
1332
|
a custom order.
|
|
1332
1333
|
|
|
1333
|
-
To include a literal
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
placeholder.
|
|
1334
|
+
To include a literal `{` or `}` in your template, put a backslash
|
|
1335
|
+
in front of it. This will be removed and the brace will not be
|
|
1336
|
+
interpreted as indicating a placeholder.
|
|
1337
1337
|
*/
|
|
1338
1338
|
function snippet(template) {
|
|
1339
1339
|
let snippet = Snippet.parse(template);
|
package/dist/index.d.ts
CHANGED
|
@@ -326,10 +326,9 @@ The order of fields defaults to textual order, but you can add
|
|
|
326
326
|
numbers to placeholders (`${1}` or `${1:defaultText}`) to provide
|
|
327
327
|
a custom order.
|
|
328
328
|
|
|
329
|
-
To include a literal
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
placeholder.
|
|
329
|
+
To include a literal `{` or `}` in your template, put a backslash
|
|
330
|
+
in front of it. This will be removed and the brace will not be
|
|
331
|
+
interpreted as indicating a placeholder.
|
|
333
332
|
*/
|
|
334
333
|
declare function snippet(template: string): (editor: {
|
|
335
334
|
state: EditorState;
|
package/dist/index.js
CHANGED
|
@@ -1132,7 +1132,8 @@ const baseTheme = /*@__PURE__*/EditorView.baseTheme({
|
|
|
1132
1132
|
display: "inline-block",
|
|
1133
1133
|
textAlign: "center",
|
|
1134
1134
|
paddingRight: ".6em",
|
|
1135
|
-
opacity: "0.6"
|
|
1135
|
+
opacity: "0.6",
|
|
1136
|
+
boxSizing: "content-box"
|
|
1136
1137
|
},
|
|
1137
1138
|
".cm-completionIcon-function, .cm-completionIcon-method": {
|
|
1138
1139
|
"&:after": { content: "'ƒ'" }
|
|
@@ -1234,8 +1235,8 @@ class Snippet {
|
|
|
1234
1235
|
positions.push(new FieldPos(found, lines.length, m.index, m.index + name.length));
|
|
1235
1236
|
line = line.slice(0, m.index) + name + line.slice(m.index + m[0].length);
|
|
1236
1237
|
}
|
|
1237
|
-
for (let esc; esc =
|
|
1238
|
-
line = line.slice(0, esc.index) + esc[1] +
|
|
1238
|
+
for (let esc; esc = /\\([{}])/.exec(line);) {
|
|
1239
|
+
line = line.slice(0, esc.index) + esc[1] + line.slice(esc.index + esc[0].length);
|
|
1239
1240
|
for (let pos of positions)
|
|
1240
1241
|
if (pos.line == lines.length && pos.from > esc.index) {
|
|
1241
1242
|
pos.from--;
|
|
@@ -1326,10 +1327,9 @@ The order of fields defaults to textual order, but you can add
|
|
|
1326
1327
|
numbers to placeholders (`${1}` or `${1:defaultText}`) to provide
|
|
1327
1328
|
a custom order.
|
|
1328
1329
|
|
|
1329
|
-
To include a literal
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
placeholder.
|
|
1330
|
+
To include a literal `{` or `}` in your template, put a backslash
|
|
1331
|
+
in front of it. This will be removed and the brace will not be
|
|
1332
|
+
interpreted as indicating a placeholder.
|
|
1333
1333
|
*/
|
|
1334
1334
|
function snippet(template) {
|
|
1335
1335
|
let snippet = Snippet.parse(template);
|