summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/bitbake/contrib/vim/indent/bitbake.vim7
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/bitbake/contrib/vim/indent/bitbake.vim b/bitbake/bitbake/contrib/vim/indent/bitbake.vim
index fc428a2074..76f84e5c23 100644
--- a/bitbake/bitbake/contrib/vim/indent/bitbake.vim
+++ b/bitbake/bitbake/contrib/vim/indent/bitbake.vim
@@ -12,7 +12,7 @@ unlet b:did_indent
12setlocal indentexpr=BitbakeIndent(v:lnum) 12setlocal indentexpr=BitbakeIndent(v:lnum)
13setlocal autoindent nolisp 13setlocal autoindent nolisp
14 14
15function s:is_python_func_def(lnum) 15function s:is_bb_python_func_def(lnum)
16 let stack = synstack(a:lnum, 1) 16 let stack = synstack(a:lnum, 1)
17 if len(stack) == 0 17 if len(stack) == 0
18 return 0 18 return 0
@@ -85,7 +85,7 @@ function GetPythonIndent(lnum)
85 if parlnum > 0 85 if parlnum > 0
86 " We may have found the opening brace of a BitBake Python task, e.g. 'python do_task {' 86 " We may have found the opening brace of a BitBake Python task, e.g. 'python do_task {'
87 " If so, ignore it here - it will be handled later. 87 " If so, ignore it here - it will be handled later.
88 if s:is_python_func_def(parlnum) 88 if s:is_bb_python_func_def(parlnum)
89 let parlnum = 0 89 let parlnum = 0
90 let plindent = indent(plnum) 90 let plindent = indent(plnum)
91 let plnumstart = plnum 91 let plnumstart = plnum
@@ -180,6 +180,7 @@ function GetPythonIndent(lnum)
180 endif 180 endif
181 181
182 " If the previous line was a stop-execution statement... 182 " If the previous line was a stop-execution statement...
183 " TODO: utilize this logic to deindent when ending a bbPyDefRegion
183 if getline(plnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\|bb\.fatal\)\>' 184 if getline(plnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\|bb\.fatal\)\>'
184 " See if the user has already dedented 185 " See if the user has already dedented
185 if indent(a:lnum) > indent(plnum) - shiftwidth() 186 if indent(a:lnum) > indent(plnum) - shiftwidth()
@@ -258,7 +259,7 @@ function BitbakeIndent(lnum)
258 259
259 if index(["bbPyDefRegion", "bbPyFuncRegion"], name) != -1 260 if index(["bbPyDefRegion", "bbPyFuncRegion"], name) != -1
260 let ret = GetPythonIndent(a:lnum) 261 let ret = GetPythonIndent(a:lnum)
261 " Should always be indented by at least one shiftwidth; but allow 262 " Should normally always be indented by at least one shiftwidth; but allow
262 " return of -1 (defer to autoindent) or -2 (force indent to 0) 263 " return of -1 (defer to autoindent) or -2 (force indent to 0)
263 if ret == 0 264 if ret == 0
264 return shiftwidth() 265 return shiftwidth()