Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ All notable changes follow [Keep a Changelog](https://keepachangelog.com/en/1.1.

## [Unreleased]

### Fixed

- The table core is now a faithful port of the shared JetBrains/Notepad++ engine and matches it
byte for byte across the differential corpus. This corrects several behaviours that diverged:
- Prose that merely contains a pipe is no longer swallowed into the table and rewritten.
- Rows with more cells than the separator row grow the table instead of losing the extra cells.
- Deleting the row above the separator is refused, so a table can no longer lose its header.
- The caret lands on the cell content in right and centre aligned columns.
- Separator rows written with spaced dashes, `=` rules, or short `|---` lines are recognised.
- A pipe block without a separator row is no longer treated as a table.
- Fitting a width unwraps earlier continuation rows, so repeating the command is stable.
- Narrow and widen follow the content width instead of a fixed three column floor.
- CSV and TSV cells keep their internal whitespace, and new tables carry `Column N` headers.
- Display widths use the shared Unicode tables rather than the host runtime's Unicode data.

## [0.1.0] - 2026-08-04

### Added
Expand Down
20 changes: 18 additions & 2 deletions e2e/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,27 @@ test('extension activates and aligns an actual VS Code document', async () => {
].join('\n'));
});

test('next-cell command moves the real editor selection', async () => {
test('next-cell command puts the caret on the content of a right aligned cell', async () => {
editor.selection = new vscode.Selection(2, 2, 2, 2);
await vscode.commands.executeCommand('markdownTableEditor.nextCell');
assert.equal(editor.selection.active.line, 2);
assert.ok(editor.selection.active.character > 7);
const line = document.lineAt(2).text;
assert.equal(line, '| Анна | 2 |');
assert.equal(editor.selection.active.character, 13);
assert.equal(line[editor.selection.active.character], '2');
});

test('aligning never rewrites prose that follows the table', async () => {
const prose = await vscode.workspace.openTextDocument({
language: 'markdown',
content: '| A | B |\n| --- | --- |\n| x | y |\nSome prose | with a pipe',
});
const proseEditor = await vscode.window.showTextDocument(prose);
proseEditor.selection = new vscode.Selection(2, 2, 2, 2);
await vscode.commands.executeCommand('markdownTableEditor.align');
assert.equal(prose.getText(), '| A | B |\n| --- | --- |\n| x | y |\nSome prose | with a pipe');
await vscode.commands.executeCommand('workbench.action.closeActiveEditor');
editor = await vscode.window.showTextDocument(document);
});

test('CSV conversion edits the selected document range', async () => {
Expand Down
Loading
Loading