This commit is contained in:
Adam Stankiewicz
2019-09-04 15:44:43 +02:00
parent 3ddca5da46
commit 664aa988f6
49 changed files with 1663 additions and 1512 deletions

View File

@@ -24,7 +24,7 @@ setlocal indentkeys-=:
setlocal indentkeys-=0#
setlocal indentkeys-=e
if has('patch-7.3.694') || (v:version == 703 && has('patch694'))
if exists('*shiftwidth')
fun! s:shiftwidth()
return shiftwidth()
endf
@@ -41,16 +41,12 @@ endif
" SQL is generally case insensitive, so this files assumes that
" These keywords are something that would trigger an indent LEFT, not
" an indent right, since the SQLBlockStart is used for those keywords
setlocal indentkeys+==~end,=~else,=~elseif,=~elsif,0=~when,0=)
setlocal indentkeys+==~begin,=~end,=~else,=~elseif,=~elsif,0=~when,=~exception,0=)
" GetSQLIndent is executed whenever one of the expressions
" in the indentkeys is typed
setlocal indentexpr=GetSQLIndent()
" Only define the functions once.
if exists("*GetSQLIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
@@ -340,7 +336,7 @@ function! GetSQLIndent()
" Check current line; search for simplistic matching start-of-block
let line = getline(v:lnum)
if line =~? '^\s*els'
if line =~? '^\s*els' || line =~? '^\s*begin' || line =~? '^\s*exception'
" Any line when you type else will automatically back up one
" ident level (ie else, elseif, elsif)
let ind = ind - s:shiftwidth()