Skip to content

Commit d7e51b1

Browse files
committed
Add Hide Metadata Rows, make settings persistent per file, auto assume presence of header
1 parent d34281c commit d7e51b1

File tree

5 files changed

+288
-75
lines changed

5 files changed

+288
-75
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,23 @@ Open the Command Palette and search for:
8181
- `CSV: Toggle Serial Index Column` (`csv.toggleSerialIndex`)
8282
- `CSV: Change CSV Separator` (`csv.changeSeparator`)
8383
- `CSV: Change Font Family` (`csv.changeFontFamily`)
84+
- `CSV: Hide First N Rows` (`csv.changeIgnoreRows`)
8485

8586

8687
## Settings
8788

88-
Configure in the Settings UI or `settings.json`:
89+
Global (Settings UI or `settings.json`):
8990

9091
- `csv.enabled` (boolean, default `true`): Enable/disable the custom editor.
91-
- `csv.treatFirstRowAsHeader` (boolean, default `true`): Treat the first row as a header.
92-
- `csv.addSerialIndex` (boolean, default `false`): Show a serial index column.
93-
- `csv.separator` (string, default `","`): Delimiter for parsing and saving.
9492
- `csv.fontFamily` (string, default empty): Override font family; falls back to `editor.fontFamily`.
9593
- `csv.cellPadding` (number, default `4`): Vertical cell padding in pixels.
9694

97-
Note: “Ignore First Rows” is a command-driven, per-file option stored by the extension.
95+
Per-file (stored by the extension; set via commands):
96+
97+
- First row as header (default `true`) — `CSV: Toggle First Row as Header`
98+
- Serial index column (default `true`) — `CSV: Toggle Serial Index Column`
99+
- CSV separator (default inherit: `.tsv` → tab, otherwise comma) — `CSV: Change CSV Separator`
100+
- Hide first N rows (default `0`) — `CSV: Hide First N Rows`
98101

99102
---
100103

package.json

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"onCommand:csv.toggleHeader",
2222
"onCommand:csv.toggleSerialIndex",
2323
"onCommand:csv.changeSeparator",
24-
"onCommand:csv.changeFontFamily"
24+
"onCommand:csv.changeFontFamily",
25+
"onCommand:csv.changeIgnoreRows"
2526
],
2627
"main": "./out/extension.js",
2728
"contributes": {
@@ -44,7 +45,8 @@
4445
{ "command": "csv.toggleHeader", "title": "CSV: Toggle First Row as Header" },
4546
{ "command": "csv.toggleSerialIndex", "title": "CSV: Toggle Serial Index Column" },
4647
{ "command": "csv.changeSeparator", "title": "CSV: Change CSV Separator" },
47-
{ "command": "csv.changeFontFamily", "title": "CSV: Change Font Family" }
48+
{ "command": "csv.changeFontFamily", "title": "CSV: Change Font Family" },
49+
{ "command": "csv.changeIgnoreRows", "title": "CSV: Hide First N Rows" }
4850
],
4951
"configuration": {
5052
"type": "object",
@@ -55,21 +57,6 @@
5557
"default": true,
5658
"description": "Enable/Disable the CSV custom editor."
5759
},
58-
"csv.treatFirstRowAsHeader": {
59-
"type": "boolean",
60-
"default": true,
61-
"description": "Treat the first row of CSV as a header."
62-
},
63-
"csv.addSerialIndex": {
64-
"type": "boolean",
65-
"default": false,
66-
"description": "Add a serial index column at the left of the table."
67-
},
68-
"csv.separator": {
69-
"type": "string",
70-
"default": ",",
71-
"description": "CSV separator to use."
72-
},
7360
"csv.fontFamily": {
7461
"type": "string",
7562
"default": "",

0 commit comments

Comments
 (0)