From d067de81509427001ce11d09c61efccad3be8220 Mon Sep 17 00:00:00 2001 From: Pete Aykroyd Date: Sun, 1 Oct 2017 22:33:03 -0400 Subject: [PATCH 1/2] grammar nit --- runtime/help/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/help/plugins.md b/runtime/help/plugins.md index f2578852..c5caee54 100644 --- a/runtime/help/plugins.md +++ b/runtime/help/plugins.md @@ -39,7 +39,7 @@ want a callback before the action is executed, use `preAction()`. In this case the boolean returned specifies whether or not the action should be executed after the lua code completes. -Another useful callback to know about which is not a action is +Another useful callback to know about which is not an action is `onViewOpen(view)` which is called whenever a new view is opened and the new view is passed in. This is useful for setting local options based on the filetype, for example turning off `tabstospaces` only for Go files when they are opened. From 8a4f2193d85ac6dc2c5b41c4198d2ee72aeb239b Mon Sep 17 00:00:00 2001 From: sotpapathe Date: Mon, 2 Oct 2017 13:36:28 +0400 Subject: [PATCH 2/2] Added automatic tabs to spaces for yaml and updated readme --- runtime/help/options.md | 2 +- runtime/plugins/ftoptions/ftoptions.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/help/options.md b/runtime/help/options.md index d3e4ef93..a65c24a4 100644 --- a/runtime/help/options.md +++ b/runtime/help/options.md @@ -195,7 +195,7 @@ Default plugin options: default value: `on` * `ftoptions`: by default, micro will set some options based on the filetype. At the moment, micro will - use tabs for makefiles and spaces for python files regardless of your settings. If you would like to + use tabs for makefiles and spaces for python and yaml files regardless of your settings. If you would like to disable this behavior turn this option off. default value: `on` diff --git a/runtime/plugins/ftoptions/ftoptions.lua b/runtime/plugins/ftoptions/ftoptions.lua index bc57dcdc..698fc60b 100644 --- a/runtime/plugins/ftoptions/ftoptions.lua +++ b/runtime/plugins/ftoptions/ftoptions.lua @@ -11,7 +11,7 @@ function onViewOpen(view) if ft == "makefile" or ft == "go" then SetOption("tabstospaces", "off") - elseif ft == "python" or ft == "python2" or ft == "python3" then + elseif ft == "python" or ft == "python2" or ft == "python3" or ft == "yaml" then SetOption("tabstospaces", "on") end end