Skip to content

Commit 014dd12

Browse files
authored
Merge pull request #23 from appsoftwareltd/outliner-behaviours
Outliner behaviours
2 parents f53330f + bf84b81 commit 014dd12

15 files changed

Lines changed: 2405 additions & 117 deletions

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ All notable changes to AS Notes will be documented here.
1010
- Feature: Detects conflicting Markdown Inline Editor extensions and offers to disable them.
1111
- Feature: Outliner mode awareness -- bullet markers and checkbox syntax always remain visible when outliner mode is active.
1212

13+
## [2.3.1] - 2026-03-31
14+
15+
- Feature: Improved page / wikilink rename merge behaviours.
16+
- Feature: Mermaid / LaTeX rendering in published HTML (static site rendering).
17+
18+
## [2.3.0] - 2026-03-28
19+
20+
- Feature: Integration of inline markdown editing.
21+
1322
## [2.2.9] - 2026-03-24
1423

1524
- Feature: Improved default themes for static HTML publishing.

TECHNICAL.md

Lines changed: 160 additions & 19 deletions
Large diffs are not rendered by default.

vs-code-extension/package.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,18 +252,33 @@
252252
{
253253
"command": "as-notes.outlinerIndent",
254254
"key": "tab",
255-
"when": "editorLangId == markdown && as-notes.outlinerMode && as-notes.onBulletLine"
255+
"when": "editorLangId == markdown && as-notes.outlinerMode && (as-notes.onOutlinerBranchLine || as-notes.insideOutlinerFenceContent)"
256256
},
257257
{
258258
"command": "as-notes.outlinerOutdent",
259259
"key": "shift+tab",
260-
"when": "editorLangId == markdown && as-notes.outlinerMode && as-notes.onBulletLine"
260+
"when": "editorLangId == markdown && as-notes.outlinerMode && (as-notes.onOutlinerBranchLine || as-notes.insideOutlinerFenceContent)"
261261
},
262262
{
263263
"command": "as-notes.outlinerPaste",
264264
"key": "ctrl+v",
265265
"mac": "cmd+v",
266-
"when": "editorLangId == markdown && as-notes.outlinerMode && as-notes.onBulletLine && !editorReadonly"
266+
"when": "editorLangId == markdown && as-notes.outlinerMode && (as-notes.onBulletLine || as-notes.insideOutlinerFenceContent) && !editorReadonly"
267+
},
268+
{
269+
"command": "as-notes.outlinerBackspace",
270+
"key": "backspace",
271+
"when": "editorLangId == markdown && as-notes.outlinerMode && (as-notes.onOutlinerBackspaceMergePoint || as-notes.insideOutlinerFenceContent) && !editorReadonly && editorHasSelection == false && !suggestWidgetVisible && !inlineSuggestionVisible"
272+
},
273+
{
274+
"command": "as-notes.outlinerFenceArrowDown",
275+
"key": "down",
276+
"when": "editorLangId == markdown && as-notes.outlinerMode && as-notes.insideOutlinerFenceContent && editorHasSelection == false && !suggestWidgetVisible && !inlineSuggestionVisible"
277+
},
278+
{
279+
"command": "as-notes.outlinerFenceArrowUp",
280+
"key": "up",
281+
"when": "editorLangId == markdown && as-notes.outlinerMode && as-notes.insideOutlinerFenceContent && editorHasSelection == false && !suggestWidgetVisible && !inlineSuggestionVisible"
267282
}
268283
],
269284
"configuration": {

vs-code-extension/src/CompletionUtils.ts

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,28 +107,34 @@ export function isLineInsideFrontMatter(lines: string[], lineIndex: number): boo
107107
*/
108108
export function isPositionInsideCode(lines: string[], lineIndex: number, charIndex: number): boolean {
109109
// Check fenced code block — scan up to lineIndex tracking open/close state
110-
const fencePattern = /^(\s*(`{3,}|~{3,}))/;
110+
const standaloneFencePattern = /^\s*(`{3,}|~{3,})/;
111+
const bulletOwnedFencePattern = /^\s*-\s(?:\[[ xX]\]\s)?(?:.*\s)?(`{3,}|~{3,})\S*\s*$/;
111112
let inFence = false;
112113
let fenceChar = '';
113114
let fenceLen = 0;
114115
for (let i = 0; i <= lineIndex; i++) {
115-
const m = fencePattern.exec(lines[i]);
116-
if (m) {
117-
const char = m[2][0]; // ` or ~
118-
const len = m[2].length;
119-
if (!inFence) {
120-
// Opening fence
121-
inFence = true;
122-
fenceChar = char;
123-
fenceLen = len;
124-
} else if (char === fenceChar && len >= fenceLen) {
125-
// Closing fence — same char, at least as many markers
126-
inFence = false;
127-
fenceChar = '';
128-
fenceLen = 0;
129-
}
130-
// Otherwise it's a different fence type or shorter — ignored
116+
const line = lines[i] ?? '';
117+
const standaloneMatch = standaloneFencePattern.exec(line);
118+
const bulletOwnedMatch = bulletOwnedFencePattern.exec(line);
119+
const marker = standaloneMatch?.[1] ?? bulletOwnedMatch?.[1];
120+
if (!marker) {
121+
continue;
122+
}
123+
124+
const char = marker[0]; // ` or ~
125+
const len = marker.length;
126+
if (!inFence) {
127+
// Opening fence
128+
inFence = true;
129+
fenceChar = char;
130+
fenceLen = len;
131+
} else if (char === fenceChar && len >= fenceLen) {
132+
// Closing fence — same char, at least as many markers
133+
inFence = false;
134+
fenceChar = '';
135+
fenceLen = 0;
131136
}
137+
// Otherwise it's a different fence type or shorter — ignored
132138
}
133139
// If we're still inside a fence at lineIndex, cursor is in a code block.
134140
// The opening fence line itself is part of the block, but content starts

0 commit comments

Comments
 (0)