@@ -69,6 +69,17 @@ export async function exists(denops: Denops, name: string): Promise<boolean> {
69
69
return ! ! result ;
70
70
}
71
71
72
+ export async function getbufline (
73
+ denops : Denops ,
74
+ name : string | number ,
75
+ lnum : string | number ,
76
+ ) : Promise < string > ;
77
+ export async function getbufline (
78
+ denops : Denops ,
79
+ name : string | number ,
80
+ lnum : string | number ,
81
+ end : string | number ,
82
+ ) : Promise < string [ ] > ;
72
83
export async function getbufline (
73
84
denops : Denops ,
74
85
name : string | number ,
@@ -81,6 +92,15 @@ export async function getbufline(
81
92
return await denops . call ( "getbufline" , name , lnum ) as string ;
82
93
}
83
94
95
+ export async function getline (
96
+ denops : Denops ,
97
+ lnum : string | number ,
98
+ ) : Promise < string > ;
99
+ export async function getline (
100
+ denops : Denops ,
101
+ lnum : string | number ,
102
+ end : string | number ,
103
+ ) : Promise < string [ ] > ;
84
104
export async function getline (
85
105
denops : Denops ,
86
106
lnum : string | number ,
@@ -171,16 +191,33 @@ export class FunctionHelper {
171
191
return await has ( this . #denops, name ) ;
172
192
}
173
193
194
+ async getbufline (
195
+ name : string | number ,
196
+ lnum : string | number ,
197
+ ) : Promise < string > ;
198
+ async getbufline (
199
+ name : string | number ,
200
+ lnum : string | number ,
201
+ end : string | number ,
202
+ ) : Promise < string [ ] > ;
174
203
async getbufline (
175
204
name : string | number ,
176
205
lnum : string | number ,
177
206
end ?: string | number ,
178
207
) {
179
- return await getbufline ( this . #denops, name , lnum , end ) ;
208
+ if ( end ) {
209
+ return await getbufline ( this . #denops, name , lnum , end ) ;
210
+ }
211
+ return await getbufline ( this . #denops, name , lnum ) ;
180
212
}
181
213
214
+ async getline ( lnum : string | number ) : Promise < string > ;
215
+ async getline ( lnum : string | number , end : string | number ) : Promise < string [ ] > ;
182
216
async getline ( lnum : string | number , end ?: string | number ) {
183
- return await getline ( this . #denops, lnum , end ) ;
217
+ if ( end ) {
218
+ return await getline ( this . #denops, lnum , end ) ;
219
+ }
220
+ return await getline ( this . #denops, lnum ) ;
184
221
}
185
222
186
223
async has ( name : string , check ?: boolean ) : Promise < boolean > {
0 commit comments