Mercurial > vim
annotate runtime/indent/eterm.vim @ 18131:851a014dfd8b v8.1.2060
patch 8.1.2060: "precedes" in 'listchars' not used properly
Commit: https://github.com/vim/vim/commit/bffba7f7042f6082e75b42484b15f66087b01941
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 20 17:00:17 2019 +0200
patch 8.1.2060: "precedes" in 'listchars' not used properly
Problem: "precedes" in 'listchars' not used properly.
Solution: Correctly handle the "precedes" char in list mode for long lines.
(Christian Brabandt, closes #4953)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 20 Sep 2019 17:15:04 +0200 |
parents | d0a20101ecb2 |
children | 9c221ad9634a |
rev | line source |
---|---|
7 | 1 " Vim indent file |
11062 | 2 " Language: Eterm configuration file |
3 " Previous Maintainer: Nikolai Weibull <now@bitwi.se> | |
4 " Latest Revision: 2006-12-20 | |
7 | 5 |
6 if exists("b:did_indent") | |
7 finish | |
8 endif | |
9 let b:did_indent = 1 | |
10 | |
11 setlocal indentexpr=GetEtermIndent() | |
12 setlocal indentkeys=!^F,o,O,=end | |
1207 | 13 setlocal nosmartindent |
7 | 14 |
15 if exists("*GetEtermIndent") | |
16 finish | |
17 endif | |
18 | |
19 function GetEtermIndent() | |
20 let lnum = prevnonblank(v:lnum - 1) | |
21 if lnum == 0 | |
22 return 0 | |
23 endif | |
24 | |
25 let ind = indent(lnum) | |
26 | |
375 | 27 if getline(lnum) =~ '^\s*begin\>' |
11160 | 28 let ind = ind + shiftwidth() |
7 | 29 endif |
30 | |
375 | 31 if getline(v:lnum) =~ '^\s*end\>' |
11160 | 32 let ind = ind - shiftwidth() |
7 | 33 endif |
34 | |
35 return ind | |
36 endfunction |