Skip to content

Commit 4e3b0bf

Browse files
committed
refactor: redesign core architecture
- reorganize directory structure - refactor module layout - redesign internal data structures - simplify data flow Prepare for future GFM table support.
1 parent 21e7e46 commit 4e3b0bf

56 files changed

Lines changed: 1861 additions & 1599 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lua/tir/ndjsons.lua

Lines changed: 0 additions & 180 deletions
This file was deleted.

lua/tirenvi/buf_state.lua

Lines changed: 0 additions & 105 deletions
This file was deleted.

lua/tirenvi/config.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
--- Configuration management for tirenvi.
2-
---
3-
4-
-----------------------------------------------------------------------
5-
-- Dependencies
6-
-----------------------------------------------------------------------
72

83
local levels = vim.log.levels
94

@@ -22,13 +17,13 @@ local defaults = {
2217
pipe = "", -- │┆┊┇┃┋▏▕
2318
padding = "", --    ·∙⸱␣␠⠀░
2419
trim = "", -- ⇢⋯⋮︙›↠▶¬…
25-
lf = "", -- ⤶⏎↵↲⤷␤¶—↩️
20+
lf = "", -- ⤶⏎↵↲⤷␤¶—↩️
2621
tab = "»", -- »⇥→⇨▹▸▻►⇤␉》
2722
},
2823
---@type {[string]: Parser}
2924
parser_map = {
30-
csv = { executable = "tir-csv", options = {}, required_version = { 0, 1, 1 } },
31-
tsv = { executable = "tir-csv", options = { "--delimiter", "\t" }, required_version = { 0, 1, 1 } },
25+
csv = { executable = "tir-csv", options = {}, required_version = { 0, 1, 2 } },
26+
tsv = { executable = "tir-csv", options = { "--delimiter", "\t" }, required_version = { 0, 1, 2 } },
3227
-- md = "tir-gfm",
3328
},
3429
log = {

lua/tirenvi/constants.lua

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,18 @@
1-
local config = require("tirenvi.config")
2-
31
local M = {}
42

5-
-- ng line
6-
M.NG_LINE_MARK = "TIRVIM-NG" .. config.marks.pipe
7-
8-
-- Buffer-local flags.
9-
local PREFIX = "tirenvi_"
10-
M.BUF_KEY = {
11-
-- Set only when バッファが最初に表示された
12-
INITIALIZED = PREFIX .. "initialized",
13-
14-
-- Set only when the on_lines callback is attached.
15-
ATTACH_COUNT = PREFIX .. "attached",
16-
17-
-- Has a value only between Buf[Write|File]Pre and Buf[Write|File]Post.
18-
OLD_PATH = PREFIX .. "old_path",
19-
20-
-- Intended to store a list of invalid line numbers.
21-
-- Currently set to {1} when invalid lines exist, otherwise nil.
22-
INVALID_LINES = PREFIX .. "invalid_lines",
23-
24-
-- true when in insert mode
25-
INSERT_MODE = PREFIX .. "insert_mode",
26-
27-
-- Rows that became invalid in insert mode
28-
PENDING_REPAIR_ROWS = PREFIX .. "pending_repair_rows",
29-
30-
-- Depth of patch
31-
PATCH_DEPTH = PREFIX .. "patch_depth",
3+
M.DOCUMENT_VERSION = "tir/0.1"
4+
M.KIND = {
5+
ATTR_FILE = "attr_file",
6+
ATTR_PLAIN = "attr_plain",
7+
ATTR_GRID = "attr_grid",
8+
PLAIN = "plain",
9+
GRID = "grid",
10+
}
11+
M.ALIGN = {
12+
DEFAULT = "default",
13+
LEFT = "left",
14+
CENTER = "center",
15+
RIGHT = "right",
3216
}
3317

3418
return M

0 commit comments

Comments
 (0)