@blankdotpage/cake 0.1.52 → 0.1.53
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../../src/cake/extensions/heading/heading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../../src/cake/extensions/heading/heading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,oBAAoB,CAAC;AA2W5B,eAAO,MAAM,gBAAgB,EAAE,aAwM9B,CAAC"}
|
|
@@ -185,7 +185,10 @@ function handleLineBreakInHeading(state) {
|
|
|
185
185
|
if (beforeCursor.trim().length === 0) {
|
|
186
186
|
const nextSource = source.slice(0, lineStart) + "\n" + source.slice(lineStart);
|
|
187
187
|
const next = runtime.createState(nextSource);
|
|
188
|
-
|
|
188
|
+
// Match native textarea behavior when pressing Enter at line start:
|
|
189
|
+
// insert a newline above and keep the caret with the moved line.
|
|
190
|
+
const caretSourcePos = lineStart + 1;
|
|
191
|
+
const caretCursor = next.map.sourceToCursor(caretSourcePos, "forward");
|
|
189
192
|
return {
|
|
190
193
|
source: nextSource,
|
|
191
194
|
selection: {
|