Mercurial > vim
annotate runtime/ftplugin/octave.vim @ 34682:a36144b38683 v9.1.0222
patch 9.1.0222: missing 'below' virt text if truncation precedes after/right text
Commit: https://github.com/vim/vim/commit/fe0a76b2bca12b13982ad66bafadc0d6c1681d00
Author: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Date: Thu Mar 28 11:47:32 2024 +0100
patch 9.1.0222: missing 'below' virt text if truncation precedes after/right text
Problem: When a line is truncated just before 'after'/'right' virtual
text and the line also has 'below' virtual text, then the
'below' virtual text would not be displayed, depending on the
order these text properties were added.
Solution: In the loop to make text properties active, skip instead of
break for 'after'/'right' virtual text properties that are
ignored due to truncation, so following 'below' text
properties can still be made active.
Similarly, a loop is needed to determine if a text property
follows at the end of the screen. (Dylan Thacker-Smith)
related: #14307
Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 28 Mar 2024 12:00:04 +0100 |
parents | 8ae680be2a51 |
children |
rev | line source |
---|---|
25773 | 1 " Vim filetype plugin file |
2 " Language: GNU Octave | |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
25773
diff
changeset
|
4 " Last Change: 2024 Jan 14 |
25773 | 5 |
6 if exists("b:did_ftplugin") | |
7 finish | |
8 endif | |
9 let b:did_ftplugin = 1 | |
10 | |
11 let s:cpo_save = &cpo | |
12 set cpo&vim | |
13 | |
14 " TODO: update Matlab ftplugin and source it as the base file? | |
15 | |
16 setlocal comments=s:%{,m:\ ,e:%},s:#{,m:\ ,e:#},:%,:# | |
17 setlocal commentstring=#\ %s | |
18 setlocal formatoptions-=t formatoptions+=croql | |
19 | |
20 setlocal keywordprg=info\ octave\ --vi-keys\ --index-search | |
21 | |
22 if exists("loaded_matchit") && !exists("b:match_words") | |
23 let b:match_words = '\<unwind_protect\>:\<unwind_protect_cleanup\>:\<end_unwind_protect\>' | |
24 if exists("octave_use_matlab_end") | |
25 let b:match_words ..= ',' .. | |
26 \ '\<\%(classdef\|enumeration\|events\|for\|function\|if\|methods\|parfor\|properties\|switch\|while\|try\)\>' .. | |
27 \ ':' .. | |
28 \ '\<\%(elseif\|else\|case\|otherwise\|break\|continue\|catch\)\>' .. | |
29 \ ':' .. | |
30 \ '\<end\>' | |
31 else | |
32 let b:match_words ..= ',' .. | |
33 \ '\<classdef\>:\<endclassdef\>,' .. | |
34 \ '\<enumeration\>:\<endenumeration\>,' .. | |
35 \ '\<events\>:\<endevents\>,' .. | |
36 \ '\<do\>:\<\%(break\|continue\)\>:\<until\>' .. | |
37 \ '\<for\>:\<\%(break\|continue\)\>:\<endfor\>,' .. | |
38 \ '\<function\>:\<return\>:\<endfunction\>,' .. | |
39 \ '\<if\>:\<\%(elseif\|else\)\>:\<endif\>,' .. | |
40 \ '\<methods\>:\<endmethods\>,' .. | |
41 \ '\<parfor\>:\<endparfor\>,' .. | |
42 \ '\<properties\>:\<endproperties\>,' .. | |
43 \ '\<switch\>:\<\%(case\|otherwise\)\>:\<endswitch\>,' .. | |
44 \ '\<while\>:\<\%(break\|continue\)\>:\<endwhile\>,' .. | |
45 \ '\<try\>:\<catch\>:\<end_try_catch\>' | |
46 endif | |
47 " only match in statement position | |
48 let s:statement_start = escape('\%(\%(^\|;\)\s*\)\@<=', '\') | |
49 let b:match_words = substitute(b:match_words, '\\<', s:statement_start, 'g') | |
50 endif | |
51 | |
52 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
25773
diff
changeset
|
53 let b:browsefilter = "GNU Octave Source Files (*.m)\t*.m\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
25773
diff
changeset
|
54 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
25773
diff
changeset
|
55 let b:browsefilter ..= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
25773
diff
changeset
|
56 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
25773
diff
changeset
|
57 let b:browsefilter ..= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
25773
diff
changeset
|
58 endif |
25773 | 59 endif |
60 | |
61 let b:undo_ftplugin = "setl com< cms< fo< kp< " .. | |
62 \ "| unlet! b:browsefilter b:match_words" | |
63 | |
64 let &cpo = s:cpo_save | |
65 unlet s:cpo_save | |
66 | |
67 " vim: nowrap sw=2 sts=2 ts=8 noet: |