Revisión | dc653bc4ee774fc4322e9c2e851e223b84798884 (tree) |
---|---|
Tiempo | 2023-02-06 18:51:12 |
Autor | badcoff33 <none@none> |
Commiter | badcoff33 |
text props for each buffer
@@ -1,7 +1,18 @@ | ||
1 | 1 | vim9script |
2 | 2 | |
3 | 3 | export def TorchlightClearAll() |
4 | + var qf_items = getqflist({ "nr": "$", "all": 0 }).items | |
5 | + | |
4 | 6 | prop_clear(1, line("$")) |
7 | + | |
8 | + for item in qf_items | |
9 | + if !empty(prop_type_get("Warning", {bufnr: item.bufnr})) | |
10 | + prop_type_delete("Warning", {bufnr: item.bufnr}) | |
11 | + endif | |
12 | + if !empty(prop_type_get("Error", {bufnr: item.bufnr})) | |
13 | + prop_type_delete("Error", {bufnr: item.bufnr}) | |
14 | + endif | |
15 | + endfor | |
5 | 16 | enddef |
6 | 17 | |
7 | 18 | export def TorchlightChanged() |
@@ -15,7 +26,7 @@ export def TorchlightInCurrentBuf() | ||
15 | 26 | prop_clear(1, line("$")) |
16 | 27 | |
17 | 28 | for item in qf_items |
18 | - if item.bufnr == bufnr("%") | |
29 | + # if item.bufnr == bufnr("%") | |
19 | 30 | bufload(item.bufnr) |
20 | 31 | if item.type ==? "w" |
21 | 32 | if empty(prop_type_get("Warning", {bufnr: item.bufnr})) |
@@ -25,21 +36,22 @@ export def TorchlightInCurrentBuf() | ||
25 | 36 | bufnr: item.bufnr, |
26 | 37 | type: "Warning", |
27 | 38 | text: item.text, |
28 | - text_align: 'right', | |
39 | + text_align: 'below', | |
40 | + text_padding_left: 4 | |
29 | 41 | }) |
30 | 42 | elseif item.type ==? "e" |
31 | 43 | if empty(prop_type_get("Error", {bufnr: item.bufnr})) |
32 | 44 | prop_type_add('Error', {bufnr: item.bufnr, highlight: 'ErrorMsg'}) |
33 | 45 | endif |
34 | - prop_type_add('Error', {bufnr: item.bufnr, highlight: 'ErrorMsg'}) | |
35 | 46 | prop_add(item.lnum, 0, { |
36 | 47 | bufnr: item.bufnr, |
37 | 48 | type: "Error", |
38 | 49 | text: item.text, |
39 | - text_align: 'right', | |
50 | + text_align: 'below', | |
51 | + text_padding_left: 4 | |
40 | 52 | }) |
41 | 53 | endif |
42 | - endif | |
54 | + # endif | |
43 | 55 | endfor |
44 | 56 | enddef |
45 | 57 |
@@ -6,6 +6,5 @@ augroup GroupTL | ||
6 | 6 | autocmd TextChanged * torchlight.TorchlightChanged() |
7 | 7 | autocmd QuickFixCmdPre make torchlight.TorchlightClearAll() |
8 | 8 | autocmd QuickFixCmdPost make torchlight.TorchlightInCurrentBuf() |
9 | - # autocmd BufWinEnter * torchlight.TorchlightInCurrentBuf() | |
10 | 9 | augroup END |
11 | 10 |