vhakulinen / gnvim

GUI for neovim, without any web bloat
MIT License
1.85k stars 69 forks source link

Check whether working with valid index #123

Closed matthiasbeyer closed 4 years ago

matthiasbeyer commented 4 years ago

This patch is a first draft for a bugfix where gnvim crashes when using :Explore in $HOME (and also sometimes in non-$HOME).

It adds a check whether the value used to index self.content.split_at() is within the buffer and at a valid unicode boundary for the String.


Followup to the discussion in #43

This is a draft. I am not an expert on this unicode-stuff and neither am I for this codebase, so maybe we want to iterate on this patch a bit?

smolck commented 4 years ago

Is this necessary? (#43 doesn’t happen in the newer Neovim versions.)

matthiasbeyer commented 4 years ago

But in older ones and some distros do not update that fast.

I do not say it is a solution, but it can be a base for one.

vhakulinen commented 4 years ago

As far as I've understood, this doesn't happen on the latest nvim release which is a requirement for gnvim. Rejecting based on that since I don't really want to watch out for bugs in nvim's older versions in gnvim's code.