@@ -42,12 +42,14 @@ export function decorate(
4242export function undecorate (
4343 denops : Denops ,
4444 bufnr : number ,
45+ start = 0 ,
46+ end = - 1 ,
4547) : Promise < void > {
4648 switch ( denops . meta . host ) {
4749 case "vim" :
48- return vimUndecorate ( denops , bufnr ) ;
50+ return vimUndecorate ( denops , bufnr , start , end ) ;
4951 case "nvim" :
50- return nvimUndecorate ( denops , bufnr ) ;
52+ return nvimUndecorate ( denops , bufnr , start , end ) ;
5153 default :
5254 unreachable ( denops . meta . host ) ;
5355 }
@@ -94,10 +96,12 @@ async function vimDecorate(
9496async function vimUndecorate (
9597 denops : Denops ,
9698 bufnr : number ,
99+ start : number ,
100+ end : number ,
97101) : Promise < void > {
98- const propList = await vimFn . prop_list ( denops , 1 , {
102+ const propList = await vimFn . prop_list ( denops , start + 1 , {
99103 bufnr,
100- end_lnum : - 1 ,
104+ end_lnum : end ,
101105 } ) as { id : string ; type : string } [ ] ;
102106 const propIds = new Set (
103107 propList . filter ( ( p ) =>
@@ -140,10 +144,12 @@ async function nvimDecorate(
140144async function nvimUndecorate (
141145 denops : Denops ,
142146 bufnr : number ,
147+ start : number ,
148+ end : number ,
143149) : Promise < void > {
144150 const ns = await nvimFn . nvim_create_namespace (
145151 denops ,
146152 "denops_std:buffer:decoration:decorate" ,
147153 ) ;
148- await nvimFn . nvim_buf_clear_namespace ( denops , bufnr , ns , 0 , - 1 ) ;
154+ await nvimFn . nvim_buf_clear_namespace ( denops , bufnr , ns , start , end ) ;
149155}
0 commit comments