diff options
author | Steven Arcangeli <stevearc@stevearc.com> | 2023-09-12 20:10:05 -0700 |
---|---|---|
committer | Steven Arcangeli <stevearc@stevearc.com> | 2023-09-12 20:10:05 -0700 |
commit | 00a528818463b10d84699b2e0f4a960d5a4aeb5c (patch) | |
tree | b1c809b69934279b8655e64724b1ec6a31f7486d /lua/conform/log.lua | |
parent | dd5b2f2f7ca01c2f28239cbbc7f97e6f9024cd94 (diff) |
fix: modify diff calculation to handle end-of-file newlines better (#35)
Diffstat (limited to 'lua/conform/log.lua')
-rw-r--r-- | lua/conform/log.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lua/conform/log.lua b/lua/conform/log.lua index 3e31fd2..20d91e1 100644 --- a/lua/conform/log.lua +++ b/lua/conform/log.lua @@ -83,6 +83,13 @@ local function initialize() end end +---Override the file handler e.g. for tests +---@param handler fun(line: string) +function Log.set_handler(handler) + write = handler + initialized = true +end + function Log.log(level, msg, ...) if Log.level <= level then initialize() |