Mercurial > vim
annotate runtime/ftplugin/json5.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 |
---|---|
33624
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Vim filetype plugin file |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 " Language: JSON5 |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33624
diff
changeset
|
4 " Last Change: 2024 Jan 14 |
33624
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 if exists("b:did_ftplugin") |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 finish |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 endif |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 let b:did_ftplugin = 1 |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 let s:cpo_save = &cpo |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 set cpo&vim |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 setlocal commentstring=//\ %s |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 setlocal formatoptions-=t formatoptions+=croql |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 let b:undo_ftplugin = "setl fo< com< cms<" |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 let b:browsefilter = "JSON5 Files (*.json5)\t*.json5\n" .. |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33624
diff
changeset
|
22 \ "JSON Files (*.json)\t*.json\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33624
diff
changeset
|
23 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33624
diff
changeset
|
24 let b:browsefilter ..= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33624
diff
changeset
|
25 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33624
diff
changeset
|
26 let b:browsefilter ..= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33624
diff
changeset
|
27 endif |
33624
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 let b:undo_ftplugin ..= " | unlet! b:browsefilter" |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 endif |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 let &cpo = s:cpo_save |
420ceec75ea7
runtime(json5): Add new ftplugin (#13385)
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 unlet s:cpo_save |