@@ -64,6 +64,39 @@ export async function bufwinnr(
64
64
return await denops . call ( "bufwinnr" , name ) as number ;
65
65
}
66
66
67
+ export async function exists ( denops : Denops , name : string ) : Promise < boolean > {
68
+ const result = await denops . call ( "exists" , name ) as number ;
69
+ return ! ! result ;
70
+ }
71
+
72
+ export async function getbufline (
73
+ denops : Denops ,
74
+ name : string | number ,
75
+ lnum : number ,
76
+ end ?: number ,
77
+ ) : Promise < string | string [ ] > {
78
+ if ( end ) {
79
+ return await denops . call ( "getbufline" , name , lnum , end ) as string [ ] ;
80
+ }
81
+ return await denops . call ( "getbufline" , name , lnum ) as string ;
82
+ }
83
+
84
+ export async function getline (
85
+ denops : Denops ,
86
+ lnum : number ,
87
+ end ?: number ,
88
+ ) : Promise < string | string [ ] > {
89
+ if ( end ) {
90
+ return await denops . call ( "getline" , lnum , end ) as string [ ] ;
91
+ }
92
+ return await denops . call ( "getline" , lnum ) as string ;
93
+ }
94
+
95
+ export async function has ( denops : Denops , name : string ) : Promise < boolean > {
96
+ const result = await denops . call ( "has" , name ) as number ;
97
+ return ! ! result ;
98
+ }
99
+
67
100
export class FunctionHelper {
68
101
#denops: Denops ;
69
102
@@ -106,4 +139,20 @@ export class FunctionHelper {
106
139
async bufwinnr ( name : string | number ) : Promise < number > {
107
140
return await bufwinnr ( this . #denops, name ) ;
108
141
}
142
+
143
+ async exists ( name : string ) : Promise < boolean > {
144
+ return await has ( this . #denops, name ) ;
145
+ }
146
+
147
+ async getbufline ( name : string | number , lnum : number , end ?: number ) {
148
+ return await getbufline ( this . #denops, name , lnum , end ) ;
149
+ }
150
+
151
+ async getline ( lnum : number , end ?: number ) {
152
+ return await getline ( this . #denops, lnum , end ) ;
153
+ }
154
+
155
+ async has ( name : string ) : Promise < boolean > {
156
+ return await has ( this . #denops, name ) ;
157
+ }
109
158
}
0 commit comments