mirror of https://github.com/japl-lang/japl.git
21 lines
375 B
VimL
21 lines
375 B
VimL
setlocal indentexpr=JaplIndent()
|
|
|
|
function! JaplIndent()
|
|
let line = getline(v:lnum)
|
|
let previousNum = prevnonblank(v:lnum-1)
|
|
let previous = getline(previousNum)
|
|
|
|
if previous =~ "{" && previous !~ "}" && line !~ "}"
|
|
return indent(previousNum) + &tabstop
|
|
endif
|
|
|
|
|
|
if line =~ "}"
|
|
return indent(previousNum) - &tabstop
|
|
endif
|
|
|
|
return indent(previousNum)
|
|
|
|
|
|
endfunction
|