@@ -11,17 +11,23 @@ test({
11
11
name : "decorate define highlights as text properties" ,
12
12
fn : async ( denops ) => {
13
13
const collect = async ( bufnr : number ) => {
14
- const lines = await fn . getbufline ( denops , bufnr , 1 , "$" ) ;
15
- const props = [ ] ;
16
- for ( let line = 1 ; line <= lines . length ; line ++ ) {
17
- props . push (
18
- ...( await vimFn . prop_list ( denops , line , { bufnr } ) as unknown [ ] ) ,
19
- ) ;
20
- }
14
+ const props = await vimFn . prop_list ( denops , 1 , {
15
+ bufnr,
16
+ end_lnum : - 1 ,
17
+ } ) as {
18
+ col : number ;
19
+ end : number ;
20
+ id : number ;
21
+ length : number ;
22
+ lnum : number ;
23
+ start : number ;
24
+ type : string ;
25
+ type_bufnr : number ;
26
+ } [ ] ;
21
27
return props ;
22
28
} ;
23
29
const bufnr = await fn . bufnr ( denops ) ;
24
- await buffer . append ( denops , bufnr , [
30
+ await buffer . replace ( denops , bufnr , [
25
31
"Hello" ,
26
32
"Darkness" ,
27
33
"My" ,
45
51
col : 1 ,
46
52
end : 1 ,
47
53
id : 0 ,
48
- length : 1 ,
54
+ length : 5 ,
55
+ lnum : 1 ,
49
56
start : 1 ,
50
57
type : "denops_std:buffer:decoration:decorate:Title" ,
51
58
type_bufnr : 0 ,
@@ -54,18 +61,20 @@ test({
54
61
end : 1 ,
55
62
id : 0 ,
56
63
length : 3 ,
64
+ lnum : 2 ,
57
65
start : 1 ,
58
66
type : "denops_std:buffer:decoration:decorate:Search" ,
59
67
type_bufnr : 0 ,
60
68
} ] ) ;
61
69
} ,
62
70
} ) ;
71
+
63
72
test ( {
64
73
mode : "nvim" ,
65
74
name : "decorate define highlights as extmarks" ,
66
75
fn : async ( denops ) => {
67
76
const bufnr = await fn . bufnr ( denops ) ;
68
- await buffer . append ( denops , bufnr , [
77
+ await buffer . replace ( denops , bufnr , [
69
78
"Hello" ,
70
79
"Darkness" ,
71
80
"My" ,
0 commit comments