Skip to content

Commit 660d9de

Browse files
committed
🐛 Fix setBuffer() and setWindow() replace the option value
Fixes #201
1 parent b0376f7 commit 660d9de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/gen-option/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function formatBufferOptionBody(name: string, type: OptionType): string[] {
102102
` return (result as ${type}) ?? ${defaultValue(type)};`,
103103
` },`,
104104
` setBuffer(denops: Denops, bufnr: number, value: ${type}): Promise<void> {`,
105-
` return setbufvar(denops, bufnr, "${name}", value);`,
105+
` return setbufvar(denops, bufnr, "&${name}", value);`,
106106
` },`,
107107
];
108108
return lines;
@@ -115,7 +115,7 @@ function formatWindowOptionBody(name: string, type: OptionType): string[] {
115115
` return (result as ${type}) ?? ${defaultValue(type)};`,
116116
` },`,
117117
` setWindow(denops: Denops, winnr: number, value: ${type}): Promise<void> {`,
118-
` return setwinvar(denops, winnr, "${name}", value);`,
118+
` return setwinvar(denops, winnr, "&${name}", value);`,
119119
` },`,
120120
];
121121
return lines;

0 commit comments

Comments
 (0)