commit f0ec0bc58b56564477df02803c20f62ae5b7c9ba
parent 25e1120e023a9f36ff75fe2fa012d2fbe07faff9
Author: Tomas Nemec <nemi@skaut.cz>
Date: Thu, 9 Sep 2021 11:37:47 +0200
update
Diffstat:
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/lua/tms/ws/file_pairs.lua b/lua/tms/ws/file_pairs.lua
@@ -1,5 +1,7 @@
local M = {}
+local ft_letter = {html = 't', scss = 's', dart = 'd', css = 'c'}
+
local set_mark = function(letter, path, buffer)
path = path or vim.fn.expand('%')
if buffer == nil then buffer = true end
@@ -30,13 +32,8 @@ M.config = function()
end
if event == 'exit' then
for ext, file in pairs(files) do
- if ext == 'html' then
- set_mark('t', file, true)
- elseif ext == 'scss' then
- set_mark('s', file, true)
- elseif ext == 'dart' then
- set_mark('d', file, true)
- end
+ local letter = ft_letter[ext]
+ if letter then set_mark(letter, file, true) end
end
files = {}
end