@@ -372,16 +372,6 @@ export def DetachListener(bufnr: number): bool
372
372
endif
373
373
return false
374
374
enddef
375
-
376
- # Call the legacy execute , use silent to avoid vim block
377
- function Execute (command , ... ) abort
378
- legacy return execute (a: command , get (a: , 1 , ' silent' ))
379
- endfunction
380
-
381
- # Call the legacy win_execute , use silent to avoid vim block
382
- function Win_execute (winid, cmds, ... ) abort
383
- legacy return win_execute (a: winid , a: cmds , get (a: , 1 , ' silent' ))
384
- endfunction
385
375
# }}"
386
376
387
377
# nvim client methods {{
@@ -475,11 +465,11 @@ enddef
475
465
# Not return on notification for possible void function call .
476
466
export def Call_function (method: string , args : list <any> , notify: bool = false): any
477
467
if method == # ' execute'
478
- return call (Execute , args )
468
+ return call (' coc#compat#execute ' , args )
479
469
elseif method == # ' eval'
480
470
return Eval (args [0 ])
481
471
elseif method == # ' win_execute'
482
- return call (Win_execute , args )
472
+ return call (' coc#compat#win_execute ' , args )
483
473
elseif ! notify
484
474
return call (method, args )
485
475
endif
@@ -496,7 +486,7 @@ enddef
496
486
497
487
# Use the legacy eval , could be called by Call
498
488
export function Eval (expr ) abort
499
- legacy return eval (a: expr )
489
+ legacy return coc#compat# eval (a: expr )
500
490
endfunction
501
491
502
492
export def Command (command : string ): any
@@ -505,7 +495,7 @@ export def Command(command: string): any
505
495
DeferExecute (command )
506
496
else
507
497
# Use legacy command not work for command like autocmd
508
- Execute (command )
498
+ coc#compat#execute (command )
509
499
# The error is set by python script , since vim not give error on python command failure
510
500
if strpart (command , 0 , 2 ) == # ' py'
511
501
const errmsg: string = get (g: , ' errmsg' , ' ' )
@@ -541,14 +531,14 @@ export def List_runtime_paths(): list<string>
541
531
enddef
542
532
543
533
export def Command_output (cmd: string ): string
544
- return trim (Execute (cmd, ' silent' ), " \r \n " )
534
+ return trim (coc#compat#execute (cmd, ' silent' ), " \r \n " )
545
535
enddef
546
536
547
537
export def Exec (code: string , output: bool): string
548
538
if output
549
539
return Command_output (code)
550
540
endif
551
- Execute (code)
541
+ coc#compat#execute (code)
552
542
return ' '
553
543
enddef
554
544
@@ -667,7 +657,7 @@ export def Set_keymap(mode: string, lhs: string, rhs: string, opts: dict<any>):
667
657
const modekey: string = CreateModePrefix (mode , opts)
668
658
const arguments: string = CreateArguments (opts)
669
659
const escaped: string = empty (rhs) ? ' <Nop>' : EscapeSpace (rhs)
670
- Execute ($ ' {modekey} {arguments} {EscapeSpace(lhs)} {escaped}' )
660
+ coc#compat#execute ($ ' {modekey} {arguments} {EscapeSpace(lhs)} {escaped}' )
671
661
return null
672
662
enddef
673
663
0 commit comments