]> git.lizzy.rs Git - micro.git/blobdiff - runtime/plugins/ftoptions/ftoptions.lua
Merge pull request #1333 from the-sushi/patch-1
[micro.git] / runtime / plugins / ftoptions / ftoptions.lua
index 0d78de35b9f171a131461ee5318fa84656169198..03a824d4c1ff342b4e3a194f773b79481d9bece6 100644 (file)
@@ -1,9 +1,17 @@
-function onViewOpen(view)
-    local ft = view.Buf.Settings["filetype"]
+VERSION = "1.0.0"
 
-    if ft == "makefile" or ft == "go" then
-        SetOption("tabstospaces", "off")
-    elseif ft == "python" then
-        SetOption("tabstospaces", "on")
+function onBufferOpen(b)
+    local ft = b:FileType()
+
+    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