Spell checker selects wrong regions for unicode text #1126

Closed
rouanth opened this Issue Jan 11, 2017 · 1 comment

Projects

None yet

2 participants

@rouanth
rouanth commented Jan 11, 2017

Steps to reproduce:

  1. Get test.txt;
  2. Acquire aspell dictionary for Russian;
  3. Run aspell -l ru -c test.txt; observe that какунь is shown to be the wrong word;
  4. Run :spell ru in kak test.txt; observe that wrong text is selected and some binary data is shown.

I presume that the highlighting is done on byte ranges instead of character ranges.

@mawww
Owner
mawww commented Jan 15, 2017

Yeah, seems aspell returns positions in characters, when Kakoune is expecting bytes there.

Using characters for that in Kakoune is going to be tricky, especially as we now update ranges based on buffer modfiications. Using characters means that in order to update positions, we need to know what bytes they referred to before modifications. It seems easier to try to fix spell.kak so that we use byte offsets.

@mawww mawww added a commit that closed this issue Jan 15, 2017
@mawww Use byte offsets in spell
Fixes #1126
10ac883
@mawww mawww closed this in 10ac883 Jan 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment