Mercurial > vim
annotate runtime/syntax/gprof.vim @ 30351:c8c7adcf2ddc v9.0.0511
patch 9.0.0511: unnecessary scrolling for message of only one line
Commit: https://github.com/vim/vim/commit/bdedd2bcce3a59028c7504a397ff77d901b1b12a
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue Sep 20 12:45:15 2022 +0100
patch 9.0.0511: unnecessary scrolling for message of only one line
Problem: Unnecessary scrolling for message of only one line.
Solution: Only set msg_scroll when needed. (closes https://github.com/vim/vim/issues/11178)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 20 Sep 2022 14:00:05 +0200 |
parents | 65de67669df3 |
children |
rev | line source |
---|---|
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
1 " Vim syntax file |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
2 " Language: Syntax for Gprof Output |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
3 " Maintainer: Dominique Pelle <dominique.pelle@gmail.com> |
25836 | 4 " Last Change: 2021 Sep 19 |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
5 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
6 " Quit when a syntax file was already loaded |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
7 if exists("b:current_syntax") |
25836 | 8 finish |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
9 endif |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
10 let s:keepcpo= &cpo |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
11 set cpo&vim |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
12 |
25836 | 13 syn spell notoplevel |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
14 syn case match |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
15 syn sync minlines=100 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
16 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
17 " Flat profile |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
18 syn match gprofFlatProfileTitle |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
19 \ "^Flat profile:$" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
20 syn region gprofFlatProfileHeader |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
21 \ start="^Each sample counts as.*" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
22 \ end="^ time.*name\s*$" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
23 syn region gprofFlatProfileTrailer |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
24 \ start="^\s*%\s\+the percentage of the total running time.*" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
25 \ end="^\s*the gprof listing if it were to be printed\." |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
26 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
27 " Call graph |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
28 syn match gprofCallGraphTitle "Call graph (explanation follows)" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
29 syn region gprofCallGraphHeader |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
30 \ start="^granularity: each sample hit covers.*" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
31 \ end="^\s*index % time\s\+self\s\+children\s\+called\s\+name$" |
24468 | 32 syn match gprofCallGraphFunction "\<\(\d\+\.\d\+\s\+\)\{3}\([0-9+]\+\)\?\s\+[a-zA-Z_<].*\ze\[" |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
33 syn match gprofCallGraphSeparator "^-\+$" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
34 syn region gprofCallGraphTrailer |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
35 \ start="This table describes the call tree of the program" |
4869 | 36 \ end="^\s*the cycle\.$" |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
37 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
38 " Index |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
39 syn region gprofIndex |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
40 \ start="^Index by function name$" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
41 \ end="\%$" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
42 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
43 syn match gprofIndexFunctionTitle "^Index by function name$" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
44 |
24468 | 45 syn match gprofNumbers "^\s*[0-9 ./+]\+" |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
46 syn match gprofFunctionIndex "\[\d\+\]" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
47 syn match gprofSpecial "<\(spontaneous\|cycle \d\+\)>" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
48 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
49 hi def link gprofFlatProfileTitle Title |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
50 hi def link gprofFlatProfileHeader Comment |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
51 hi def link gprofFlatProfileFunction Number |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
52 hi def link gprofFlatProfileTrailer Comment |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
53 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
54 hi def link gprofCallGraphTitle Title |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
55 hi def link gprofCallGraphHeader Comment |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
56 hi def link gprofFlatProfileFunction Number |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
57 hi def link gprofCallGraphFunction Special |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
58 hi def link gprofCallGraphTrailer Comment |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
59 hi def link gprofCallGraphSeparator Label |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
60 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
61 hi def link gprofFunctionIndex Label |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
62 hi def link gprofSpecial SpecialKey |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
63 hi def link gprofNumbers Number |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
64 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
65 hi def link gprofIndexFunctionTitle Title |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
66 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
67 let b:current_syntax = "gprof" |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
68 |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
69 let &cpo = s:keepcpo |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
70 unlet s:keepcpo |