scnvim icon indicating copy to clipboard operation
scnvim copied to clipboard

[FR]: Support more of Document via SCNvim.luaeval

Open madskjeldgaard opened this issue 3 years ago • 2 comments

With the inclusion of SCNvim.luaeval in scnvim now, communication between sclang and neovim is tighter than before and I think we can implement a lot more of the methods from Document:

https://doc.sccode.org/Classes/Document.html

We'd have to map some of the neovim api stuff to this class or, alternatively, create a new sub class of Document called NeoVimDocument or something allowing editing features and methods as well as more information exchange between the two.

I think the API as it is now has some limitations, but that said I think a lot of the methods we are missing from Document are now possible to do :)

madskjeldgaard avatar Apr 01 '22 10:04 madskjeldgaard

Yes, that would be really great!

My suggestion would be to continue implementing the Document API in https://github.com/davidgranstrom/scnvim/blob/main/scide_scnvim/Classes/Document.sc the functions needed for editor synchronization could be implemented in lua/scnvim/document.lua and called from the Document class with luaeval. We should also port the single function in autoload/scnvim/document.vim and move it to the corresponding lua implementation.

davidgranstrom avatar Apr 02 '22 09:04 davidgranstrom

Hi boys, I 've started to mess up with implementing some missing methods (code below), even I am not lua guy. I've stucked with implementing lua code with more lines, or functions. Did you make some progress on this ?

name {
        var name = PathName(this.path).fileName;
        ^name
}

title{
        ^this.name;
}

selectLine { |line|
	var luacode = "vim.api.nvim_command('normal "++line++"G0vL')";
        SCNvim.luaeval(luacode);
}

paum3 avatar Apr 13 '22 12:04 paum3