@@ -112,7 +112,7 @@ def __init__(
112
112
metadata : Dict [str , Any ],
113
113
types : Dict [int , Any ],
114
114
decode : TDecodeMode = True ,
115
- err_cb : Callable [[str ], None ] = None
115
+ err_cb : Optional [ Callable [[str ], None ] ] = None
116
116
):
117
117
"""Initialize a new Nvim instance. This method is module-private."""
118
118
self ._session = session
@@ -142,7 +142,7 @@ def __init__(
142
142
self ._err_cb = err_cb
143
143
self .loop = self ._session .loop ._loop
144
144
145
- def _from_nvim (self , obj : Any , decode : TDecodeMode = None ) -> Any :
145
+ def _from_nvim (self , obj : Any , decode : Optional [ TDecodeMode ] = None ) -> Any :
146
146
if decode is None :
147
147
decode = self ._decode
148
148
if type (obj ) is ExtType :
@@ -213,8 +213,8 @@ def run_loop(
213
213
self ,
214
214
request_cb : Optional [Callable [[str , List [Any ]], Any ]],
215
215
notification_cb : Optional [Callable [[str , List [Any ]], Any ]],
216
- setup_cb : Callable [[], None ] = None ,
217
- err_cb : Callable [[str ], Any ] = None
216
+ setup_cb : Optional [ Callable [[], None ] ] = None ,
217
+ err_cb : Optional [ Callable [[str ], Any ] ] = None
218
218
) -> None :
219
219
"""Run the event loop to receive requests and notifications from Nvim.
220
220
@@ -275,7 +275,7 @@ def with_decode(self, decode: Literal[True] = True) -> 'Nvim':
275
275
self .metadata , self .types , decode , self ._err_cb )
276
276
277
277
def ui_attach (
278
- self , width : int , height : int , rgb : bool = None , ** kwargs : Any
278
+ self , width : int , height : int , rgb : Optional [ bool ] = None , ** kwargs : Any
279
279
) -> None :
280
280
"""Register as a remote UI.
281
281
@@ -375,14 +375,7 @@ def chdir(self, dir_path: str) -> None:
375
375
return self .request ('nvim_set_current_dir' , dir_path )
376
376
377
377
def feedkeys (self , keys : str , options : str = '' , escape_csi : bool = True ) -> None :
378
- """Push `keys` to Nvim user input buffer.
379
-
380
- Options can be a string with the following character flags:
381
- - 'm': Remap keys. This is default.
382
- - 'n': Do not remap keys.
383
- - 't': Handle keys as if typed; otherwise they are handled as if coming
384
- from a mapping. This matters for undo, opening folds, etc.
385
- """
378
+ """Push `keys` to Nvim user input buffer."""
386
379
return self .request ('nvim_feedkeys' , keys , options , escape_csi )
387
380
388
381
def input (self , bytes : AnyStr ) -> int :
0 commit comments