@@ -57,21 +57,16 @@ async function ensurePrerequisites(denops: Denops): Promise<string> {
57
57
function! DenopsStdBufferAppend_${ suffix } (bufnr, lnum, repl) abort
58
58
let modified = getbufvar(a:bufnr, '&modified')
59
59
let modifiable = getbufvar(a:bufnr, '&modifiable')
60
- let foldmethod = getbufvar(a:bufnr, '&foldmethod')
61
60
call setbufvar(a:bufnr, '&modifiable', 1)
62
- call setbufvar(a:bufnr, '&foldmethod', 'manual')
63
61
call appendbufline(a:bufnr, a:lnum, a:repl)
64
62
call setbufvar(a:bufnr, '&modified', modified)
65
63
call setbufvar(a:bufnr, '&modifiable', modifiable)
66
- call setbufvar(a:bufnr, '&foldmethod', foldmethod)
67
64
endfunction
68
65
69
66
function! DenopsStdBufferReplace_${ suffix } (bufnr, repl, fileformat, fileencoding) abort
70
67
let modified = getbufvar(a:bufnr, '&modified')
71
68
let modifiable = getbufvar(a:bufnr, '&modifiable')
72
- let foldmethod = getbufvar(a:bufnr, '&foldmethod')
73
69
call setbufvar(a:bufnr, '&modifiable', 1)
74
- call setbufvar(a:bufnr, '&foldmethod', 'manual')
75
70
if a:fileformat isnot# v:null
76
71
call setbufvar(a:bufnr, '&fileformat', a:fileformat)
77
72
endif
@@ -82,7 +77,6 @@ async function ensurePrerequisites(denops: Denops): Promise<string> {
82
77
call deletebufline(a:bufnr, len(a:repl) + 1, '$')
83
78
call setbufvar(a:bufnr, '&modified', modified)
84
79
call setbufvar(a:bufnr, '&modifiable', modifiable)
85
- call setbufvar(a:bufnr, '&foldmethod', foldmethod)
86
80
endfunction
87
81
88
82
function! DenopsStdBufferConcreteRestore_${ suffix } () abort
@@ -321,7 +315,7 @@ export interface DecodeResult {
321
315
* }
322
316
* ```
323
317
*
324
- * It temporary change `modified`, `modifiable`, and `foldmethod ` options to append
318
+ * It temporary change `modified` and `modifiable ` options to append
325
319
* the content of the `buffer` buffer without unmodifiable error or so on.
326
320
*/
327
321
export async function append (
@@ -361,8 +355,8 @@ export interface AppendOptions {
361
355
* }
362
356
* ```
363
357
*
364
- * It temporary change `modified`, `modifiable`, and `foldmethod ` options to
365
- * replace the content of the `buffer` buffer without unmodifiable error or so on.
358
+ * It temporary change `modified` and `modifiable ` options to replace
359
+ * the content of the `buffer` buffer without unmodifiable error or so on.
366
360
*/
367
361
export async function replace (
368
362
denops : Denops ,
@@ -518,25 +512,20 @@ export async function modifiable<T>(
518
512
bufnr : number ,
519
513
executor : ( ) => T ,
520
514
) : Promise < T > {
521
- const [ modified , modifiable , foldmethod ] = await batch . collect (
515
+ const [ modified , modifiable ] = await batch . collect (
522
516
denops ,
523
517
( denops ) => [
524
518
op . modified . getBuffer ( denops , bufnr ) ,
525
519
op . modifiable . getBuffer ( denops , bufnr ) ,
526
- op . foldmethod . getBuffer ( denops , bufnr ) ,
527
520
] ,
528
521
) ;
529
- await batch . batch ( denops , async ( denops ) => {
530
- await fn . setbufvar ( denops , bufnr , "&modifiable" , 1 ) ;
531
- await fn . setbufvar ( denops , bufnr , "&foldmethod" , "manual" ) ;
532
- } ) ;
522
+ await fn . setbufvar ( denops , bufnr , "&modifiable" , 1 ) ;
533
523
try {
534
524
return await executor ( ) ;
535
525
} finally {
536
526
await batch . batch ( denops , async ( denops ) => {
537
527
await fn . setbufvar ( denops , bufnr , "&modified" , modified ) ;
538
528
await fn . setbufvar ( denops , bufnr , "&modifiable" , modifiable ) ;
539
- await fn . setbufvar ( denops , bufnr , "&foldmethod" , foldmethod ) ;
540
529
} ) ;
541
530
}
542
531
}
0 commit comments