Mercurial > vim
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 |
rev | line source |
---|---|
7 | 1 " IDL (Interactive Data Language) indent file. |
25880 | 2 " Language: IDL (ft=idlang) |
3 " Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com> (Invalid email address) | |
4 " Doug Kearns <dougkearns@gmail.com> | |
28379 | 5 " Last change: 2022 Apr 06 |
7 | 6 |
7 " Only load this indent file when no other was loaded. | |
8 if exists("b:did_indent") | |
9 finish | |
10 endif | |
11 let b:did_indent = 1 | |
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 | 14 |
15 setlocal indentexpr=GetIdlangIndent(v:lnum) | |
16 | |
28379 | 17 let b:undo_indent = "setl inde< indk<" |
18 | |
7 | 19 " Only define the function once. |
20 if exists("*GetIdlangIndent") | |
21 finish | |
22 endif | |
23 | |
24 function GetIdlangIndent(lnum) | |
25 " First non-empty line above the current line. | |
26 let pnum = prevnonblank(v:lnum-1) | |
27 " v:lnum is the first non-empty line -- zero indent. | |
28 if pnum == 0 | |
29 return 0 | |
30 endif | |
31 " Second non-empty line above the current line. | |
32 let pnum2 = prevnonblank(pnum-1) | |
33 | |
34 " Current indent. | |
35 let curind = indent(pnum) | |
36 | |
37 " Indenting of continued lines. | |
38 if getline(pnum) =~ '\$\s*\(;.*\)\=$' | |
39 if getline(pnum2) !~ '\$\s*\(;.*\)\=$' | |
11518 | 40 let curind = curind+shiftwidth() |
7 | 41 endif |
42 else | |
43 if getline(pnum2) =~ '\$\s*\(;.*\)\=$' | |
11518 | 44 let curind = curind-shiftwidth() |
7 | 45 endif |
46 endif | |
47 | |
48 " Indenting blocks of statements. | |
49 if getline(v:lnum) =~? '^\s*\(endif\|endelse\|endwhile\|endfor\|endrep\)\>' | |
50 if getline(pnum) =~? 'begin\>' | |
11518 | 51 elseif indent(v:lnum) > curind-shiftwidth() |
52 let curind = curind-shiftwidth() | |
7 | 53 else |
54 return -1 | |
55 endif | |
56 elseif getline(pnum) =~? 'begin\>' | |
11518 | 57 if indent(v:lnum) < curind+shiftwidth() |
58 let curind = curind+shiftwidth() | |
7 | 59 else |
60 return -1 | |
61 endif | |
62 endif | |
63 return curind | |
64 endfunction | |
65 |