annotate runtime/indent/idlang.vim @ 29662:b03c47618895 v9.0.0171

patch 9.0.0171: quickfix line highlight is overruled by 'cursorline' Commit: https://github.com/vim/vim/commit/6e5c61119a07b513a99baa9618e8182a74fd7e24 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 8 16:03:06 2022 +0100 patch 9.0.0171: quickfix line highlight is overruled by 'cursorline' Problem: Quickfix line highlight is overruled by 'cursorline'. Solution: Reverse the combination of attributes. (closes https://github.com/vim/vim/issues/10654)
author Bram Moolenaar <Bram@vim.org>
date Mon, 08 Aug 2022 17:15:03 +0200
parents 6dd88e45d47d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " IDL (Interactive Data Language) indent file.
25880
9c221ad9634a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
2 " Language: IDL (ft=idlang)
9c221ad9634a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
3 " Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com> (Invalid email address)
9c221ad9634a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
4 " Doug Kearns <dougkearns@gmail.com>
28379
6dd88e45d47d Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
5 " Last change: 2022 Apr 06
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Only load this indent file when no other was loaded.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if exists("b:did_indent")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 let b:did_indent = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3526
dd6c2497c997 Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
13 setlocal indentkeys=o,O,0=endif,0=ENDIF,0=endelse,0=ENDELSE,0=endwhile,0=ENDWHILE,0=endfor,0=ENDFOR,0=endrep,0=ENDREP
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 setlocal indentexpr=GetIdlangIndent(v:lnum)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
28379
6dd88e45d47d Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
17 let b:undo_indent = "setl inde< indk<"
6dd88e45d47d Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
18
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " Only define the function once.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 if exists("*GetIdlangIndent")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 function GetIdlangIndent(lnum)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " First non-empty line above the current line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 let pnum = prevnonblank(v:lnum-1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " v:lnum is the first non-empty line -- zero indent.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 if pnum == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 return 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " Second non-empty line above the current line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 let pnum2 = prevnonblank(pnum-1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " Current indent.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 let curind = indent(pnum)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " Indenting of continued lines.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 if getline(pnum) =~ '\$\s*\(;.*\)\=$'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 if getline(pnum2) !~ '\$\s*\(;.*\)\=$'
11518
63b0b7b79b25 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3526
diff changeset
40 let curind = curind+shiftwidth()
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 if getline(pnum2) =~ '\$\s*\(;.*\)\=$'
11518
63b0b7b79b25 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3526
diff changeset
44 let curind = curind-shiftwidth()
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Indenting blocks of statements.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 if getline(v:lnum) =~? '^\s*\(endif\|endelse\|endwhile\|endfor\|endrep\)\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 if getline(pnum) =~? 'begin\>'
11518
63b0b7b79b25 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3526
diff changeset
51 elseif indent(v:lnum) > curind-shiftwidth()
63b0b7b79b25 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3526
diff changeset
52 let curind = curind-shiftwidth()
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 return -1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 elseif getline(pnum) =~? 'begin\>'
11518
63b0b7b79b25 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3526
diff changeset
57 if indent(v:lnum) < curind+shiftwidth()
63b0b7b79b25 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3526
diff changeset
58 let curind = curind+shiftwidth()
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 return -1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 return curind
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65