Mercurial > vim
annotate runtime/syntax/modula3.vim @ 32826:7c4ad06d80ec v9.0.1726
patch 9.0.1726: incorrect heights in win_size_restore()
Commit: https://github.com/vim/vim/commit/876f5fb570d8401aa4c58af4a5da91f10520aa9d
Author: Sean Dewar <seandewar@users.noreply.github.com>
Date: Thu Aug 17 22:40:05 2023 +0200
patch 9.0.1726: incorrect heights in win_size_restore()
Problem: incorrect heights in win_size_restore()
Solution: avoid restoring incorrect heights in win_size_restore()
Changing 'showtabline' or 'cmdheight' in the cmdwin restores incorrect
window heights after closing the cmdwin.
This may produce a gap between the cmdline and the window above.
Solution: restore window sizes only if the number of lines available for windows
changed; subtract the rows of the tabline, cmdline and last window's statusline
from 'lines' (other statuslines don't matter).
closes: #12704
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 17 Aug 2023 22:45:06 +0200 |
parents | 5acd6f02ea35 |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
24468 | 2 " Language: Modula-3 |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
4 " Previous Maintainer: Timo Pedersen <dat97tpe@ludat.lth.se> | |
31028 | 5 " Last Change: 2022 Oct 31 |
7 | 6 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
7 if exists("b:current_syntax") |
7 | 8 finish |
9 endif | |
10 | |
31028 | 11 " Whitespace errors {{{1 |
12 if exists("modula3_space_errors") | |
13 if !exists("modula3_no_trail_space_error") | |
14 syn match modula3SpaceError display excludenl "\s\+$" | |
15 endif | |
16 if !exists("modula3_no_tab_space_error") | |
17 syn match modula3SpaceError display " \+\t"me=e-1 | |
18 endif | |
19 endif | |
20 | |
21 " Keywords {{{1 | |
22 syn keyword modula3Keyword ANY ARRAY AS BITS BRANDED BY CASE CONST | |
23 syn keyword modula3Keyword DEFINITION EVAL EXIT EXCEPT EXCEPTION EXIT | |
24 syn keyword modula3Keyword EXPORTS FINALLY FROM GENERIC IMPORT LOCK METHOD | |
25 syn keyword modula3Keyword OF RAISE RAISES READONLY RECORD REF | |
26 syn keyword modula3Keyword RETURN SET TRY TYPE TYPECASE UNSAFE | |
27 syn keyword modula3Keyword VALUE VAR WITH | |
7 | 28 |
24468 | 29 syn match modula3keyword "\<UNTRACED\>" |
7 | 30 |
31 " Special keywords, block delimiters etc | |
32 syn keyword modula3Block PROCEDURE FUNCTION MODULE INTERFACE REPEAT THEN | |
33 syn keyword modula3Block BEGIN END OBJECT METHODS OVERRIDES RECORD REVEAL | |
34 syn keyword modula3Block WHILE UNTIL DO TO IF FOR ELSIF ELSE LOOP | |
35 | |
31028 | 36 " Reserved identifiers {{{1 |
24468 | 37 syn keyword modula3Identifier ABS ADR ADRSIZE BITSIZE BYTESIZE CEILING DEC |
38 syn keyword modula3Identifier DISPOSE FIRST FLOAT FLOOR INC ISTYPE LAST | |
39 syn keyword modula3Identifier LOOPHOLE MAX MIN NARROW NEW NUMBER ORD ROUND | |
40 syn keyword modula3Identifier SUBARRAY TRUNC TYPECODE VAL | |
41 | |
31028 | 42 " Predefined types {{{1 |
24468 | 43 syn keyword modula3Type ADDRESS BOOLEAN CARDINAL CHAR EXTENDED INTEGER |
44 syn keyword modula3Type LONGCARD LONGINT LONGREAL MUTEX NULL REAL REFANY TEXT | |
45 syn keyword modula3Type WIDECHAR | |
46 | |
47 syn match modula3Type "\<\%(UNTRACED\s\+\)\=ROOT\>" | |
48 | |
31028 | 49 " Operators {{{1 |
50 syn keyword modula3Operator DIV MOD | |
51 syn keyword modula3Operator IN | |
52 syn keyword modula3Operator NOT AND OR | |
24468 | 53 |
31028 | 54 " TODO: exclude = from declarations |
24468 | 55 if exists("modula3_operators") |
56 syn match modula3Operator "\^" | |
31028 | 57 syn match modula3Operator "[-+/*]" |
58 syn match modula3Operator "&" | |
59 syn match modula3Operator "<=\|<:\@!\|>=\|>" | |
60 syn match modula3Operator ":\@<!=\|#" | |
24468 | 61 endif |
62 | |
31028 | 63 " Literals {{{1 |
64 | |
24468 | 65 " Booleans |
66 syn keyword modula3Boolean TRUE FALSE | |
67 | |
68 " Nil | |
69 syn keyword modula3Nil NIL | |
70 | |
31028 | 71 " Numbers {{{2 |
72 | |
73 " NOTE: Negated numbers are constant expressions not literals | |
74 | |
75 syn case ignore | |
76 | |
77 " Integers | |
78 | |
79 syn match modula3Integer "\<\d\+L\=\>" | |
24468 | 80 |
31028 | 81 if exists("modula3_number_errors") |
82 syn match modula3IntegerError "\<\d\d\=_\x\+L\=\>" | |
83 endif | |
84 | |
85 let s:digits = "0123456789ABCDEF" | |
86 for s:radix in range(2, 16) | |
87 exe $'syn match modula3Integer "\<{s:radix}_[{s:digits[:s:radix - 1]}]\+L\=\>"' | |
88 endfor | |
89 unlet s:digits s:radix | |
90 | |
91 " Reals | |
92 syn match modula3Real "\<\d\+\.\d\+\%([EDX][+-]\=\d\+\)\=\>" | |
93 | |
94 syn case match | |
95 | |
96 " Strings and characters {{{2 | |
24468 | 97 |
98 " String escape sequences | |
99 syn match modula3Escape "\\['"ntrf]" contained display | |
31028 | 100 " TODO: limit to <= 377 (255) |
24468 | 101 syn match modula3Escape "\\\o\{3}" contained display |
102 syn match modula3Escape "\\\\" contained display | |
103 | |
104 " Characters | |
105 syn match modula3Character "'\%([^']\|\\.\|\\\o\{3}\)'" contains=modula3Escape | |
7 | 106 |
107 " Strings | |
24468 | 108 syn region modula3String start=+"+ end=+"+ contains=modula3Escape |
7 | 109 |
31028 | 110 " Pragmas {{{1 |
111 " EXTERNAL INLINE ASSERT TRACE FATAL UNUSED OBSOLETE CALLBACK EXPORTED PRAGMA NOWARN LINE LL LL.sup SPEC | |
112 " Documented: INLINE ASSERT TRACE FATAL UNUSED OBSOLETE NOWARN | |
24468 | 113 syn region modula3Pragma start="<\*" end="\*>" |
114 | |
31028 | 115 " Comments {{{1 |
116 if !exists("modula3_no_comment_fold") | |
117 syn region modula3Comment start="(\*" end="\*)" contains=modula3Comment,@Spell fold | |
118 syn region modula3LineCommentBlock start="^\s*(\*.*\*)\s*\n\%(^\s*(\*.*\*)\s*$\)\@=" end="^\s*(\*.*\*)\s*\n\%(^\s*(\*.*\*)\s*$\)\@!" contains=modula3Comment transparent fold keepend | |
119 else | |
120 syn region modula3Comment start="(\*" end="\*)" contains=modula3Comment,@Spell | |
121 endif | |
7 | 122 |
31028 | 123 " Syncing "{{{1 |
124 syn sync minlines=100 | |
125 | |
126 " Default highlighting {{{1 | |
24468 | 127 hi def link modula3Block Statement |
128 hi def link modula3Boolean Boolean | |
129 hi def link modula3Character Character | |
130 hi def link modula3Comment Comment | |
131 hi def link modula3Escape Special | |
132 hi def link modula3Identifier Keyword | |
133 hi def link modula3Integer Number | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
134 hi def link modula3Keyword Statement |
24468 | 135 hi def link modula3Nil Constant |
31028 | 136 hi def link modula3IntegerError Error |
24468 | 137 hi def link modula3Operator Operator |
138 hi def link modula3Pragma PreProc | |
139 hi def link modula3Real Float | |
140 hi def link modula3String String | |
31028 | 141 hi def link modula3Type Type "}}} |
7 | 142 |
143 let b:current_syntax = "modula3" | |
144 | |
31028 | 145 " vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: |