]> git.lizzy.rs Git - micro.git/blobdiff - runtime/plugins/ftoptions/ftoptions.lua
Merge pull request #1386 from jncraton/docfix
[micro.git] / runtime / plugins / ftoptions / ftoptions.lua
index 0d78de35b9f171a131461ee5318fa84656169198..7c2d519d4c949a92a47b20f484cc5d3dff0d5b45 100644 (file)
@@ -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