X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=runtime%2Fplugins%2Fftoptions%2Fftoptions.lua;h=bc57dcdcc4c6108099ab44e487af1955bc08b5fc;hb=285503d0095fbe817198cf85c07d6a03b07dd0b0;hp=0d78de35b9f171a131461ee5318fa84656169198;hpb=e721ef8d464ff0b7c58f3a0d94a3b990baaf1fe6;p=micro.git diff --git a/runtime/plugins/ftoptions/ftoptions.lua b/runtime/plugins/ftoptions/ftoptions.lua index 0d78de35..bc57dcdc 100644 --- a/runtime/plugins/ftoptions/ftoptions.lua +++ b/runtime/plugins/ftoptions/ftoptions.lua @@ -1,9 +1,17 @@ +if GetOption("ftoptions") == nil then + AddOption("ftoptions", true) +end + function onViewOpen(view) + if not GetOption("ftoptions") then + return + end + local ft = view.Buf.Settings["filetype"] if ft == "makefile" or ft == "go" then SetOption("tabstospaces", "off") - elseif ft == "python" then + elseif ft == "python" or ft == "python2" or ft == "python3" then SetOption("tabstospaces", "on") end end