X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fplugins%2Fftoptions%2Fftoptions.lua;h=7c2d519d4c949a92a47b20f484cc5d3dff0d5b45;hb=cef32d4ac7f7bbc1f57fc67f8a1788edddfbe771;hp=0d78de35b9f171a131461ee5318fa84656169198;hpb=e721ef8d464ff0b7c58f3a0d94a3b990baaf1fe6;p=micro.git diff --git a/runtime/plugins/ftoptions/ftoptions.lua b/runtime/plugins/ftoptions/ftoptions.lua index 0d78de35..7c2d519d 100644 --- a/runtime/plugins/ftoptions/ftoptions.lua +++ b/runtime/plugins/ftoptions/ftoptions.lua @@ -1,9 +1,15 @@ -function onViewOpen(view) - local ft = view.Buf.Settings["filetype"] +function onBufferOpen(b) + local ft = b:FileType() - if ft == "makefile" or ft == "go" then - SetOption("tabstospaces", "off") - elseif ft == "python" then - SetOption("tabstospaces", "on") + if ft == "go" or + ft == "makefile" then + b:SetOption("tabstospaces", "off") + elseif ft == "fish" or + ft == "python" or + ft == "python2" or + ft == "python3" or + ft == "yaml" or + ft == "nim" then + b:SetOption("tabstospaces", "on") end end