diff runtime/indent/sqlanywhere.vim @ 25973:3b34837f4538

Update runtime files Commit: https://github.com/vim/vim/commit/2286304cdbba53ceb52b3ba2ba4a521b0a2f8d0f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 16 15:23:36 2021 +0100 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 Oct 2021 16:30:07 +0200
parents 11b656e74444
children
line wrap: on
line diff
--- a/runtime/indent/sqlanywhere.vim
+++ b/runtime/indent/sqlanywhere.vim
@@ -1,9 +1,8 @@
 " Vim indent file
 " Language:    SQL
 " Maintainer:  David Fishburn <dfishburn dot vim at gmail dot com>
-" Last Change By Maintainer: 2017 Jun 13
-" Last Change: by Stephen Wall, #5578, 2020 Jun 07
-" Version:     3.0
+" Last Change: 2021 Oct 11
+" Version:     4.0
 " Download:    http://vim.sourceforge.net/script.php?script_id=495
 
 " Notes:
@@ -21,6 +20,9 @@
 "    it, this can leave the indent hanging to the right one too many.
 "
 " History:
+"    4.0 (Oct 2021)
+"        Added b:undo_indent
+"
 "    3.0 (Dec 2012)
 "        Added cpo check
 "
@@ -56,10 +58,13 @@ setlocal indentkeys+==~end,=~else,=~else
 " in the indentkeys is typed
 setlocal indentexpr=GetSQLIndent()
 
+let b:undo_indent = "setl indentexpr< indentkeys<"
+
 " Only define the functions once.
 if exists("*GetSQLIndent")
     finish
 endif
+
 let s:keepcpo= &cpo
 set cpo&vim
 
@@ -68,14 +73,9 @@ set cpo&vim
 " IS is excluded, since it is difficult to determine when the
 " ending block is (especially for procedures/functions).
 let s:SQLBlockStart = '^\s*\%('.
-                \ 'if\>.*\<then\|'.
-                \ 'then\|else\>\|'.
-                \ 'elseif\>.*\<then\|'.
-                \ 'elsif\>.(\<then\|'.
-                \ 'while\>.*\<loop\|'.
-                \ 'for\>.*\<loop\|'.
-                \ 'foreach\>.*\<loop\|'. 
-                \ 'loop\|do\|declare\|begin\|'.
+                \ 'if\|else\|elseif\|elsif\|'.
+                \ 'while\|loop\|do\|for\|'.
+                \ 'begin\|'.
                 \ 'case\|when\|merge\|exception'.
                 \ '\)\>'
 let s:SQLBlockEnd = '^\s*\(end\)\>'