123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- function s:is_bb_python_func_def(lnum)
- let stack = synstack(a:lnum, 1)
- if len(stack) == 0
- return 0
- endif
- return synIDattr(stack[0], "name") == "bbPyFuncDef"
- endfunction
- function bitbake#Indent(lnum)
- if !has('syntax_items')
- return -1
- endif
- let stack = synstack(a:lnum, 1)
- if len(stack) == 0
- return -1
- endif
- let name = synIDattr(stack[0], "name")
-
-
- " VAR = " \
-
-
- " "
-
- " i.e. each value indented by shiftwidth(), with the final quote " completely unindented.
- if name == "bbVarValue"
-
- " EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" " HOSTCPP="${BUILD_CPP}""
-
-
-
- if getline(a:lnum) =~ '^\s*"$'
- return 0
- endif
- let prevstack = synstack(a:lnum - 1, 1)
- if len(prevstack) == 0
- return -1
- endif
- let prevname = synIDattr(prevstack[0], "name")
-
-
- let prevlinelastchar = synIDattr(synID(a:lnum - 1, col([a:lnum - 1, "$"]) - 1, 1), "name")
- let prev_continued = prevlinelastchar == "bbContinue"
-
- if index(["bbVarDef", "bbVarFlagDef"], prevname) != -1
- if prev_continued
- return shiftwidth()
- endif
- endif
- if !prev_continued
- return 0
- endif
-
- return -1
- endif
- if index(["bbPyDefRegion", "bbPyFuncRegion"], name) != -1
- let ret = python#GetIndent(a:lnum, function('s:is_bb_python_func_def'))
-
-
- if ret == 0
- return shiftwidth()
- elseif ret == -2
- return 0
- endif
- return ret
- endif
-
-
-
-
- if name == "bbShFuncRegion"
- return GetShIndent()
- endif
-
-
-
-
- return -1
- endfunction
|