@@ -42,12 +42,14 @@ export function decorate(
42
42
export function undecorate (
43
43
denops : Denops ,
44
44
bufnr : number ,
45
+ start = 0 ,
46
+ end = - 1 ,
45
47
) : Promise < void > {
46
48
switch ( denops . meta . host ) {
47
49
case "vim" :
48
- return vimUndecorate ( denops , bufnr ) ;
50
+ return vimUndecorate ( denops , bufnr , start , end ) ;
49
51
case "nvim" :
50
- return nvimUndecorate ( denops , bufnr ) ;
52
+ return nvimUndecorate ( denops , bufnr , start , end ) ;
51
53
default :
52
54
unreachable ( denops . meta . host ) ;
53
55
}
@@ -94,10 +96,12 @@ async function vimDecorate(
94
96
async function vimUndecorate (
95
97
denops : Denops ,
96
98
bufnr : number ,
99
+ start : number ,
100
+ end : number ,
97
101
) : Promise < void > {
98
- const propList = await vimFn . prop_list ( denops , 1 , {
102
+ const propList = await vimFn . prop_list ( denops , start + 1 , {
99
103
bufnr,
100
- end_lnum : - 1 ,
104
+ end_lnum : end ,
101
105
} ) as { id : string ; type : string } [ ] ;
102
106
const propIds = new Set (
103
107
propList . filter ( ( p ) =>
@@ -140,10 +144,12 @@ async function nvimDecorate(
140
144
async function nvimUndecorate (
141
145
denops : Denops ,
142
146
bufnr : number ,
147
+ start : number ,
148
+ end : number ,
143
149
) : Promise < void > {
144
150
const ns = await nvimFn . nvim_create_namespace (
145
151
denops ,
146
152
"denops_std:buffer:decoration:decorate" ,
147
153
) ;
148
- await nvimFn . nvim_buf_clear_namespace ( denops , bufnr , ns , 0 , - 1 ) ;
154
+ await nvimFn . nvim_buf_clear_namespace ( denops , bufnr , ns , start , end ) ;
149
155
}
0 commit comments