File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,12 @@ export async function assign(
9898 findFileFormat ( text , fileformats ) ?? fileformat ;
9999 const preprocessor = options . preprocessor ?? ( ( v : string [ ] ) => v ) ;
100100 const repl = preprocessor ( splitText ( text , ff ) ) ;
101- await batch . batch ( denops , async ( denops ) => {
102- await fn . setbufvar ( denops , bufnr , "&fileformat" , ff ) ;
103- await fn . setbufvar ( denops , bufnr , "&fileencoding" , enc ) ;
104- await replace ( denops , bufnr , repl ) ;
101+ await modifiable ( denops , bufnr , async ( ) => {
102+ await batch . batch ( denops , async ( denops ) => {
103+ await fn . setbufvar ( denops , bufnr , "&fileformat" , ff ) ;
104+ await fn . setbufvar ( denops , bufnr , "&fileencoding" , enc ) ;
105+ await replace ( denops , bufnr , repl ) ;
106+ } ) ;
105107 } ) ;
106108}
107109
You can’t perform that action at this time.
0 commit comments