Mercurial > vim
view runtime/indent/treetop.vim @ 27217:facb54d20a50 v8.2.4137
patch 8.2.4137: Vim9: calling import with and without method is inconsistent
Commit: https://github.com/vim/vim/commit/d02dce2bb572f0e6b4570442e9cdbed14ef41820
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 18 17:43:04 2022 +0000
patch 8.2.4137: Vim9: calling import with and without method is inconsistent
Problem: Vim9: calling import with and without method is inconsistent.
Solution: Set a flag that a parenthsis follows to compile_load_scriptvar().
Add some more tests. Improve error message.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 18 Jan 2022 18:45:02 +0100 |
parents | 11b656e74444 |
children | 4d76b3e07c07 |
line wrap: on
line source
" Vim indent file " Language: Treetop " Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Latest Revision: 2011-03-14 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal indentexpr=GetTreetopIndent() setlocal indentkeys=0{,0},!^F,o,O,=end setlocal nosmartindent if exists("*GetTreetopIndent") finish endif function GetTreetopIndent() let pnum = prevnonblank(v:lnum - 1) if pnum == 0 return 0 endif let ind = indent(pnum) let line = getline(pnum) if line =~ '^\s*\%(grammar\|module\|rule\)\>' let ind += shiftwidth() endif let line = getline(v:lnum) if line =~ '^\s*end\>' let ind -= shiftwidth() end return ind endfunction