[bitbake-devel,v2,8/9] bitbake: contrib/vim: handle shell indenting

Submitted by Nicolas Cornu via bitbake-devel on Oct. 17, 2019, 4:36 p.m. | Patch ID: 165901

Details

Message ID f98285cb179418d94d5602d83845cc00d5debd83.1571329975.git.chris.laplante@agilent.com
State New
Headers show

Commit Message

Nicolas Cornu via bitbake-devel Oct. 17, 2019, 4:36 p.m.
Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
---
 bitbake/contrib/vim/indent/bitbake.vim | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/bitbake/contrib/vim/indent/bitbake.vim b/bitbake/contrib/vim/indent/bitbake.vim
index 1d0a6e8..1d99395 100644
--- a/bitbake/contrib/vim/indent/bitbake.vim
+++ b/bitbake/contrib/vim/indent/bitbake.vim
@@ -319,6 +319,18 @@  function BitbakeIndent(lnum)
         return ret
     endif
 
+    " TODO: GetShIndent doesn't detect tasks prepended with 'fakeroot'
+    " Need to submit a patch upstream to Vim to provide an extension point.
+    " Unlike the Python indenter, the Sh indenter is way too large to copy and
+    " modify here.
+    if name == "bbShFuncRegion"
+        return GetShIndent()
+    endif
+
+    " TODO:
+    "   + heuristics for de-denting out of a bbPyDefRegion? e.g. when the user
+    "       types an obvious BB keyword like addhandler or addtask, or starts
+    "       writing a shell task. Maybe too hard to implement...
+
     return -1
-    "return s:pythonIndentExpr()
 endfunction