Mercurial > vim
diff runtime/indent/cdl.vim @ 25773:11b656e74444
Update runtime files
Commit: https://github.com/vim/vim/commit/6c391a74fe90190796ca0b0c010112948a6e75d7
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 9 21:55:11 2021 +0200
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 09 Sep 2021 22:00:10 +0200 |
parents | 4ab4ef0c48b1 |
children | 9c221ad9634a |
line wrap: on
line diff
--- a/runtime/indent/cdl.vim +++ b/runtime/indent/cdl.vim @@ -16,8 +16,8 @@ if exists("*CdlGetIndent") "finish endif -" find out if an "...=..." expresion is an assignment (or a conditional) -" it scans 'line' first, and then the previos lines +" find out if an "...=..." expression is an assignment (or a conditional) +" it scans 'line' first, and then the previous lines fun! CdlAsignment(lnum, line) let f = -1 let lnum = a:lnum @@ -33,7 +33,7 @@ fun! CdlAsignment(lnum, line) endif " it's formula if there's a ';', 'elsE', 'theN', 'enDif' or 'expr' " conditional if there's a '<', '>', 'elseif', 'if', 'and', 'or', 'not', - " 'memberis', 'childrenof' and other \k\+of funcions + " 'memberis', 'childrenof' and other \k\+of functions let f = line[inicio-1] =~? '[en;]' || strpart(line, inicio-4, 4) =~? 'ndif\|expr' endw let lnum = prevnonblank(lnum-1) @@ -106,7 +106,7 @@ fun! CdlGetIndent(lnum) elseif c == '(' || c ==? 'f' " '(' or 'if' let ind = ind + shiftwidth() else " c == '=' - " if it is an asignment increase indent + " if it is an assignment increase indent if f == -1 " we don't know yet, find out let f = CdlAsignment(lnum, strpart(line, 0, inicio)) end @@ -117,11 +117,11 @@ fun! CdlGetIndent(lnum) endw " CURRENT LINE, if it starts with a closing element, decrease indent - " or if it starts with '=' (asignment), increase indent + " or if it starts with '=' (assignment), increase indent if match(thisline, '^\c\s*\(else\|then\|endif\|[);]\)') >= 0 let ind = ind - shiftwidth() elseif match(thisline, '^\s*=') >= 0 - if f == -1 " we don't know yet if is an asignment, find out + if f == -1 " we don't know yet if is an assignment, find out let f = CdlAsignment(lnum, "") end if f == 1 " formula increase it