X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=runtime%2Fplugins%2Fftoptions%2Fftoptions.lua;h=03a824d4c1ff342b4e3a194f773b79481d9bece6;hb=24a684cff25cd9f189a943d1dc2a98d3aa6c796f;hp=1ffe99cb8179857a698c85529463697e006c8fc7;hpb=a0d475bebf0854579704541972faa911f6d1336f;p=micro.git diff --git a/runtime/plugins/ftoptions/ftoptions.lua b/runtime/plugins/ftoptions/ftoptions.lua index 1ffe99cb..03a824d4 100644 --- a/runtime/plugins/ftoptions/ftoptions.lua +++ b/runtime/plugins/ftoptions/ftoptions.lua @@ -1,23 +1,17 @@ -if GetOption("ftoptions") == nil then - AddOption("ftoptions", true) -end - -function onViewOpen(view) - if not GetOption("ftoptions") then - return - end +VERSION = "1.0.0" - local ft = view.Buf.Settings["filetype"] +function onBufferOpen(b) + local ft = b:FileType() if ft == "go" or ft == "makefile" then - SetOption("tabstospaces", "off") + b:SetOption("tabstospaces", "off") elseif ft == "fish" or ft == "python" or ft == "python2" or ft == "python3" or ft == "yaml" or ft == "nim" then - SetOption("tabstospaces", "on") + b:SetOption("tabstospaces", "on") end end