@vscode/markdown-editor 0.0.2-57 → 0.0.2-58

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/dist/index.d.ts CHANGED
@@ -150,8 +150,12 @@ export declare class BlockQuoteAstNode extends BlockAstNodeBase {
150
150
  declare class BlockQuoteViewData {
151
151
  readonly ast: BlockQuoteAstNode;
152
152
  readonly content: readonly AnyViewData[];
153
+ /** False while a pending paragraph replaces the final marker-only line. */
154
+ readonly showFinalMarkerOnlyLine: boolean;
153
155
  readonly kind = "blockQuote";
154
- constructor(ast: BlockQuoteAstNode, content: readonly AnyViewData[]);
156
+ constructor(ast: BlockQuoteAstNode, content: readonly AnyViewData[],
157
+ /** False while a pending paragraph replaces the final marker-only line. */
158
+ showFinalMarkerOnlyLine: boolean);
155
159
  }
156
160
 
157
161
  /**
@@ -951,6 +955,7 @@ export declare class EditorController extends Disposable {
951
955
  private _executeEditCommand;
952
956
  private _runUndoableEdit;
953
957
  private _executeVisualCursorCommand;
958
+ private _cursorDown;
954
959
  private _setUserSelection;
955
960
  /** Move the cursor down one visual line (Arrow Down). */
956
961
  cursorDown(extend?: boolean): void;
@@ -1183,11 +1188,7 @@ export declare class EditorModel {
1183
1188
  * AST node for it, and park the caret at the gap start. No source edit is
1184
1189
  * applied — the blank line exists only in the view until it is materialized.
1185
1190
  */
1186
- armPendingParagraph(req: {
1187
- anchorBlock: BlockAstNode;
1188
- replaceRange: OffsetRange;
1189
- atEof: boolean;
1190
- }): void;
1191
+ armPendingParagraph(req: Omit<PendingParagraph, 'syntheticAst'>): void;
1191
1192
  /** Discard the pending paragraph (if any) without touching the source. */
1192
1193
  cancelPendingParagraph(): void;
1193
1194
  /**
@@ -2537,21 +2538,23 @@ declare class ParagraphViewData {
2537
2538
  }
2538
2539
 
2539
2540
  /**
2540
- * A *transient* editing state: the empty paragraph the user conjured by
2541
- * pressing Enter at the end of a paragraph. Markdown has no empty-paragraph
2542
- * node, so this never lives in {@link EditorModel['sourceText']} or the parsed
2543
- * {@link EditorModel.document} — it is pure edit intent that the view renders
2544
- * as a synthetic blank line and that the controller either *materializes* (the
2545
- * user types) or *cancels* (the user navigates away / backspaces).
2541
+ * A *transient* editing state: an empty paragraph adjacent to a real block.
2542
+ * Markdown has no empty-paragraph node, so this never lives in
2543
+ * {@link EditorModel['sourceText']} or the parsed {@link EditorModel.document}
2544
+ * — it is pure edit intent that the view renders as a synthetic blank line and
2545
+ * that the controller either *materializes* (the user types) or *cancels* (the
2546
+ * user navigates away / backspaces).
2546
2547
  */
2547
2548
  declare interface PendingParagraph {
2548
- /** The paragraph the blank line is rendered directly after. */
2549
+ /** The block the blank line is rendered directly after. */
2549
2550
  readonly anchorBlock: BlockAstNode;
2550
2551
  /**
2551
2552
  * Source region rewritten when the pending paragraph is materialized — the
2552
2553
  * gap between {@link anchorBlock}'s text and whatever follows it.
2553
2554
  */
2554
2555
  readonly replaceRange: OffsetRange;
2556
+ /** Whether materialized text needs a blank-line separator before it. */
2557
+ readonly separateFromPreviousBlock: boolean;
2555
2558
  /** Whether {@link replaceRange} ends at the end of the document. */
2556
2559
  readonly atEof: boolean;
2557
2560
  /**
@@ -2562,6 +2565,15 @@ declare interface PendingParagraph {
2562
2565
  readonly syntheticAst: ParagraphAstNode;
2563
2566
  }
2564
2567
 
2568
+ declare interface PendingParagraphResult {
2569
+ readonly kind: 'pending';
2570
+ readonly anchorBlock: BlockAstNode;
2571
+ readonly replaceRange: OffsetRange;
2572
+ /** Whether materialized text needs a blank-line separator before it. */
2573
+ readonly separateFromPreviousBlock: boolean;
2574
+ readonly atEof: boolean;
2575
+ }
2576
+
2565
2577
  /**
2566
2578
  * View-data for the transient empty paragraph (see `PendingParagraph` in the
2567
2579
  * model). It carries only the throwaway {@link ParagraphAstNode} that gives the
@@ -2730,12 +2742,7 @@ export declare type SmartEnterResult = {
2730
2742
  readonly kind: 'edit';
2731
2743
  readonly edit: StringEdit;
2732
2744
  readonly selection: Selection_2;
2733
- } | {
2734
- readonly kind: 'pending';
2735
- readonly anchorBlock: BlockAstNode;
2736
- readonly replaceRange: OffsetRange;
2737
- readonly atEof: boolean;
2738
- };
2745
+ } | PendingParagraphResult;
2739
2746
 
2740
2747
  /**
2741
2748
  * A run of {@link Token}s together with the exact {@link OffsetRange} they
@@ -3176,10 +3183,15 @@ export declare class VisualLine {
3176
3183
  * source offset (hidden-marker runs are appended last). So this scans all
3177
3184
  * runs rather than assuming any ordering:
3178
3185
  *
3179
- * - If some run *covers* `offset`, its own geometry places the caret
3180
- * (exact glyph boundary for text runs). In the active, markers-visible
3181
- * form every offset is covered, so this branch keeps distinct offsets
3182
- * distinct.
3186
+ * - A zero-source visual anchor owns its exact offset, so a marker-only line
3187
+ * wins over the preceding line's inclusive end boundary.
3188
+ * - Otherwise a run starting at `offset` owns that seam. This keeps an
3189
+ * out-of-flow prefix from placing the caret at its trailing edge when the
3190
+ * following body starts at a visually separate x.
3191
+ * - Otherwise, if some run *covers* `offset`, its own geometry places the
3192
+ * caret (exact glyph boundary for text runs). In the active,
3193
+ * markers-visible form every interior offset is covered, so this branch
3194
+ * keeps distinct offsets distinct.
3183
3195
  * - Otherwise `offset` sits in a gap — a hidden inline marker such as the
3184
3196
  * `**` of `**bold**`, or before/after the painted text. It snaps to the
3185
3197
  * seam between the source-nearest runs on either side: the right edge of