Skip to content

Commit a3605de

Browse files
authored
Merge pull request #278 from vim-denops/improve-buffer-readonly
👍 Add `readonly` to arguments in `buffer` module
2 parents b92c354 + 39f55a3 commit a3605de

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

buffer/buffer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ async function ensurePrerequisites(denops: Denops): Promise<string> {
176176
export async function open(
177177
denops: Denops,
178178
bufname: string,
179-
options: OpenOptions = {},
179+
options: Readonly<OpenOptions> = {},
180180
): Promise<OpenResult> {
181181
const suffix = await ensurePrerequisites(denops);
182182
const bang = options.bang ?? false;
@@ -259,7 +259,7 @@ export async function decode(
259259
denops: Denops,
260260
bufnr: number,
261261
data: Uint8Array,
262-
options: DecodeOptions = {},
262+
options: Readonly<DecodeOptions> = {},
263263
): Promise<DecodeResult> {
264264
const [fileformat, fileformatsStr, fileencodingsStr] = await batch.collect(
265265
denops,
@@ -321,8 +321,8 @@ export interface DecodeResult {
321321
export async function append(
322322
denops: Denops,
323323
bufnr: number,
324-
repl: string[],
325-
options: AppendOptions = {},
324+
repl: readonly string[],
325+
options: Readonly<AppendOptions> = {},
326326
): Promise<void> {
327327
const suffix = await ensurePrerequisites(denops);
328328
const lnum = options.lnum ??
@@ -361,8 +361,8 @@ export interface AppendOptions {
361361
export async function replace(
362362
denops: Denops,
363363
bufnr: number,
364-
repl: string[],
365-
options: ReplaceOptions = {},
364+
repl: readonly string[],
365+
options: Readonly<ReplaceOptions> = {},
366366
): Promise<void> {
367367
const suffix = await ensurePrerequisites(denops);
368368
await denops.call(

0 commit comments

Comments
 (0)