Friday, January 14, 2022

mix of vim9 and legacy vimscript

Hi Bram, Christian, Hi All,


I wish to use and port some part of plugin made by Christian few years ago in order to improve dirdiff with patience algorithm. https://github.com/chrisbra/vim-diff-enhanced


In vim9 help §2 it is written;

Vim9 script and legacy Vim script can be mixed.  There is no requirement to
rewrite old scripts, they keep working as before.  You may want to use a few
`:def` functions for code that needs to be fast.


So try to port the plugin, let some functions that need (...) or (A,L,P) args for commands that I don't know how to deal with in vim9script. https://github.com/niva-xx/vim9-diff-enhanced

And then test it,

:EnhancedDiff patience
Capture.PNG



I don't understant why I got this error in argue of s:Warn( which waiting for string arg.

function EnhancedDiff#Diff(...) #{{{2
  let cmd = (exists("a:1") ? a:1 : '')
  let arg = (exists("a:2") ? a:2 : '')

  " no-op
  " error occured, reset diffexpr
  try
    call s:DiffInit(cmd, arg)
  catch
    set diffexpr=
    call s:Warn( cmd . ' not found in path, aborting!' )


Thank you for your help
NiVa

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/34410dc9-c7b3-4154-94af-d9988359342cn%40googlegroups.com.

No comments:

Post a Comment