@codemirror/language 0.19.7 → 0.19.8
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 +6 -0
- package/dist/index.cjs +4 -2
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -822,9 +822,11 @@ class IndentContext {
|
|
|
822
822
|
*/
|
|
823
823
|
lineAt(pos, bias = 1) {
|
|
824
824
|
let line = this.state.doc.lineAt(pos);
|
|
825
|
-
let { simulateBreak } = this.options;
|
|
825
|
+
let { simulateBreak, simulateDoubleBreak } = this.options;
|
|
826
826
|
if (simulateBreak != null && simulateBreak >= line.from && simulateBreak <= line.to) {
|
|
827
|
-
if (
|
|
827
|
+
if (simulateDoubleBreak && simulateBreak == pos)
|
|
828
|
+
return { text: "", from: pos };
|
|
829
|
+
else if (bias < 0 ? simulateBreak < pos : simulateBreak <= pos)
|
|
828
830
|
return { text: line.text.slice(simulateBreak - line.from), from: simulateBreak };
|
|
829
831
|
else
|
|
830
832
|
return { text: line.text.slice(0, simulateBreak - line.from), from: line.from };
|
package/dist/index.js
CHANGED
|
@@ -818,9 +818,11 @@ class IndentContext {
|
|
|
818
818
|
*/
|
|
819
819
|
lineAt(pos, bias = 1) {
|
|
820
820
|
let line = this.state.doc.lineAt(pos);
|
|
821
|
-
let { simulateBreak } = this.options;
|
|
821
|
+
let { simulateBreak, simulateDoubleBreak } = this.options;
|
|
822
822
|
if (simulateBreak != null && simulateBreak >= line.from && simulateBreak <= line.to) {
|
|
823
|
-
if (
|
|
823
|
+
if (simulateDoubleBreak && simulateBreak == pos)
|
|
824
|
+
return { text: "", from: pos };
|
|
825
|
+
else if (bias < 0 ? simulateBreak < pos : simulateBreak <= pos)
|
|
824
826
|
return { text: line.text.slice(simulateBreak - line.from), from: simulateBreak };
|
|
825
827
|
else
|
|
826
828
|
return { text: line.text.slice(0, simulateBreak - line.from), from: line.from };
|