Mercurial > vim
annotate runtime/indent/eterm.vim @ 33160:4ecf54d709b3 v9.0.1862
patch 9.0.1862: Vim9 Garbage Collection issues
Commit: https://github.com/vim/vim/commit/e651e110c17656a263dd017b14c85b332163a58d
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon Sep 4 07:51:01 2023 +0200
patch 9.0.1862: Vim9 Garbage Collection issues
Problem: Vim9 Garbage Collection issues
Solution: Class members are garbage collected early leading to
use-after-free problems. Handle the garbage
collection of classes properly.
closes: #13019
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 04 Sep 2023 08:00:06 +0200 |
parents | 9c221ad9634a |
children |
rev | line source |
---|---|
7 | 1 " Vim indent file |
25880 | 2 " Language: Eterm configuration file |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
4 " Previous Maintainer: Nikolai Weibull <now@bitwi.se> | |
5 " Last Change: 24 Sep 2021 | |
7 | 6 |
7 if exists("b:did_indent") | |
8 finish | |
9 endif | |
10 let b:did_indent = 1 | |
11 | |
12 setlocal indentexpr=GetEtermIndent() | |
13 setlocal indentkeys=!^F,o,O,=end | |
1207 | 14 setlocal nosmartindent |
7 | 15 |
25880 | 16 let b:undo_indent = "setl inde< indk< si<" |
17 | |
7 | 18 if exists("*GetEtermIndent") |
19 finish | |
20 endif | |
21 | |
22 function GetEtermIndent() | |
23 let lnum = prevnonblank(v:lnum - 1) | |
24 if lnum == 0 | |
25 return 0 | |
26 endif | |
27 | |
28 let ind = indent(lnum) | |
29 | |
375 | 30 if getline(lnum) =~ '^\s*begin\>' |
11160 | 31 let ind = ind + shiftwidth() |
7 | 32 endif |
33 | |
375 | 34 if getline(v:lnum) =~ '^\s*end\>' |
11160 | 35 let ind = ind - shiftwidth() |
7 | 36 endif |
37 | |
38 return ind | |
39 endfunction |