Skip to content

Commit 0f56db1

Browse files
committed
Implement changes from crazywall.nvim
1 parent ee7c3ed commit 0f56db1

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

core/ansi.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ M.magenta = color(35)
4747
M.cyan = color(36)
4848
M.white = color(37)
4949

50-
M.none = apply_code(0, 0)
50+
M.none = function(str)
51+
return str
52+
end
5153
M.bold = apply_code(1, 22)
5254
M.italic = apply_code(3, 23)
5355

core/config.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Config.errors = {
9494
--- @param key string
9595
unexpected_key = function(key)
9696
return "Unexpected key " .. key .. " in config."
97-
end
97+
end,
9898
}
9999

100100
--- @param config_table PartialConfigTable
@@ -105,6 +105,7 @@ function Config:new(config_table)
105105
setmetatable(self, Config)
106106
local err = validate.types("Config:new", {
107107
{ config_table, "table", "config_table" },
108+
}) or validate.types("Config:new", {
108109
{ config_table.note_schema, "table?", "note_schema" },
109110
{ config_table.resolve_path, "function?", "resolve_path" },
110111
{ config_table.transform_lines, "function?", "transform_lines" },

core/path.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ function Path:new(path, allow_relative)
6565
if not allow_relative and path:sub(1, 1) ~= "/" then
6666
return nil, Path.errors.path_should_begin_with_slash(path)
6767
end
68-
for part in string.gmatch(path, "[^/]*") do
68+
table.insert(self.parts, "")
69+
for part in string.gmatch(path, "[^/]+") do
6970
table.insert(self.parts, part)
7071
end
7172
if #self.parts == 1 and self.parts[1] == nil then

core/plan/action.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ local tostring = function(self, enable_ansi)
6161
" ",
6262
#"action lines chars " - #"-> "
6363
) .. "-> " .. tostring(self.new_path) or "")
64-
.. "\27[0m"
6564
)
6665
end
6766

0 commit comments

Comments
 (0)