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
18 changes: 9 additions & 9 deletions lua/tirenvi/editor/autocmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ end
---@param bufnr number
local function attach_on_lines(bufnr)
local check_items = {
unsupported = true,
supported = true,
has_parser = true,
}
if buf_state.should_skip(bufnr, check_items) then
Expand Down Expand Up @@ -99,7 +99,7 @@ local function register_autocmds()
-- Process only items for which a parser has been specified
callback = guard.guarded(function(args)
if buf_state.should_skip(args.buf, {
unsupported = true,
supported = true,
no_vscode = true,
has_parser = true,
}) then
Expand All @@ -114,7 +114,7 @@ local function register_autocmds()
group = augroup,
callback = guard.guarded(function(args)
if buf_state.should_skip(args.buf, {
unsupported = true,
supported = true,
is_tir_vim = true,
}) then
return
Expand All @@ -128,7 +128,7 @@ local function register_autocmds()
group = augroup,
callback = guard.guarded(function(args)
if buf_state.should_skip(args.buf, {
unsupported = true,
supported = true,
}) then
return
end
Expand All @@ -141,7 +141,7 @@ local function register_autocmds()
group = augroup,
callback = guard.guarded(function(args)
if buf_state.should_skip(args.buf, {
unsupported = true,
supported = true,
has_parser = true,
}) then
return
Expand All @@ -156,7 +156,7 @@ local function register_autocmds()
callback = guard.guarded(function(args)
debug_entry_point(args)
if buf_state.should_skip(args.buf, {
unsupported = true,
supported = true,
has_parser = true,
}) then
return
Expand All @@ -171,7 +171,7 @@ local function register_autocmds()
group = augroup,
callback = guard.guarded(function(args)
if buf_state.should_skip(args.buf, {
unsupported = true,
supported = true,
has_parser = true,
}) then
return
Expand All @@ -189,7 +189,7 @@ local function register_autocmds()
group = augroup,
callback = guard.guarded(function(args)
if buf_state.should_skip(args.buf, {
unsupported = true,
supported = true,
is_tir_vim = true,
}) then
return
Expand All @@ -202,7 +202,7 @@ local function register_autocmds()
vim.api.nvim_create_autocmd({ "BufWinEnter", "WinEnter" }, {
callback = guard.guarded(function(args)
if buf_state.should_skip(args.buf, {
unsupported = true,
supported = true,
is_tir_vim = true,
}) then
return
Expand Down
2 changes: 1 addition & 1 deletion lua/tirenvi/editor/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ end
local function cmd_toggle(bufnr)
log.debug("===+===+===+===+=== toggle %s ===+===+===+===+===", bufnr)
if buf_state.should_skip(bufnr, {
unsupported = true,
supported = true,
has_parser = true,
}) then
return
Expand Down
2 changes: 1 addition & 1 deletion lua/tirenvi/state/buf_state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function M.is_undo_mode(bufnr)
end

local checks = {
unsupported = function(bufnr)
supported = function(bufnr)
-- return bo[bufnr].buftype == ""
return bo[bufnr].modifiable
end,
Expand Down
2 changes: 1 addition & 1 deletion lua/tirenvi/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
---@field tab string

---@class Check_options
---@field unsupported? boolean
---@field supported? boolean
---@field ensure_tir_vim? boolean
---@field is_tir_vim? boolean
---@field has_parser? boolean
Expand Down
58 changes: 26 additions & 32 deletions tests/data/sample.pukiwiki
Original file line number Diff line number Diff line change
@@ -1,45 +1,36 @@
* 今日の予定 [#b1c3e09d]

** tirenvi [#xf25a077]
- tir-pukiwiki, --md option ? --raw
-- 開発着手
- ✅filetypeとparserを関連つける
- align, width = right+1, center+2
- テストケース、セル幅0
- padding config : 色
- excel, Google doc とかコピペで使えないか?

* pukiwiki 表 [#k0258d54]

- table

||
|| |
|a ||
|bbbb ||
|||

|a|
|bbbb|

- PIPE

|a
|a ||||
|a|a|c||
|a|a|h|c|
|a|a|3|h|
|1|2|3||
|a|
|a|a|c
|a|a|h|c
| a |a|3x|h
|a|a|3|
,1,2,3
|a|a|3|4|f
|a|a|3|4|5|x
|a|a|3|4|5|ch
|a|a|3|4|5|cb

- CSV

|a|
,a
,
||||||
|a|||
|1|2||
|1|2||
|1|2|3|
,|,|
,a,
,1,2
,1,2,
,1,2,3

- format

Expand All @@ -49,18 +40,21 @@
|a|b|c|
|CENTER:|RIGHT:|LEFT:|c
|foot|foot|foot|f
|BGCOLOR(red):|BGCOLOR(green):|BGCOLOR(blue):|c
|BGCOLOR(red): |BGCOLOR(green): |BGCOLOR(blue):|c
|H1|H2|H3|h
|a|b|c|
|a|b|c|
|F|F|F|f
|a|b|c|
,a,b,c

|BGCOLOR(red): |BGCOLOR(green): |BGCOLOR(blue):|c
|H1|H2|H3|h

- width
|100|100|100|c
|a|b2|12345678901234567890|

- CSV(escape)
- CSV

|1a|2 a|3a|
|1 ,|2b|3 b|
|||c|
,1a,2 a, 3a
,"1 ,",2b,"""3 b "
," ",, c
Loading