onivim / oni2

Native, lightweight modal code editor
https://v2.onivim.io
MIT License
7.83k stars 282 forks source link

UTF8 parsing of NeovimExtType #85

Closed akinsho closed 5 years ago

akinsho commented 5 years ago

Neovim returns a custom ExtType from MsgPck when we receive or request window,buffer or tab information, currently we convert this using Camomile in Utility.re however the parsing atm only works for single digits, so will need to be revisited so it can parse larger digits

Options I've found

tcoopman commented 5 years ago

I'm probably missing some information here to answer correctly, but looking at the code, maybe a naive implementation could be to loop over CamomileLibraryDefault.Camomile.(UChar.code(UTF8.get(str, 0))) multiple times for larger digits?

It seems a bit weird to get batteries only for this kind of thing?

Also, if parsing is needed, maybe having a look at https://github.com/inhabitedtype/angstrom could be helpful as well?

akinsho commented 5 years ago

@tcoopman that's a good idea, haven't tried that yet was futzing with using the length or last methods. Yeah batteries is an excessive solution, I only mentioned it in case it might be the sort of thing we'd use for other reasons my oversimplification is that it has a lot of utilities we might want anyway but it definitely isn't the first thing I was planning to try

tcoopman commented 5 years ago

@Akin909 If you look at batteries for somethings, I think having a look at core would also be good.

bryphe commented 5 years ago

This is no longer an issue with the libvim work, as we no longer have the Msgpck transport layer - we get these ids directly as integers / pointer references.