diff options
author | rxi <rxi@users.noreply.github.com> | 2020-06-27 19:49:16 +0100 |
---|---|---|
committer | rxi <rxi@users.noreply.github.com> | 2020-06-27 19:49:16 +0100 |
commit | 6b3aa2a0a50f4bf90337476643064751c8976161 (patch) | |
tree | dc1259acacb6205e7dfccde836df6f715986c837 /plugins/drawwhitespace.lua | |
parent | c8f95ddfae8fff8365b7c950da21b47d77ec2cc7 (diff) | |
download | lite-xl-plugins-6b3aa2a0a50f4bf90337476643064751c8976161.tar.gz lite-xl-plugins-6b3aa2a0a50f4bf90337476643064751c8976161.zip |
Fixed drawwhitespace plugin not using utf8 iterator
Diffstat (limited to 'plugins/drawwhitespace.lua')
-rw-r--r-- | plugins/drawwhitespace.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/drawwhitespace.lua b/plugins/drawwhitespace.lua index f2b68ae..c6ed07d 100644 --- a/plugins/drawwhitespace.lua +++ b/plugins/drawwhitespace.lua @@ -1,3 +1,4 @@ +local common = require "core.common" local config = require "core.config" local style = require "core.style" local DocView = require "core.docview" @@ -20,8 +21,7 @@ function DocView:draw_line_text(idx, x, y) local color = style.whitespace or style.syntax.comment local map = config.whitespace_map - for i = 1, #text do - local chr = text:sub(i, i) + for chr in common.utf8_chars(text) do local rep = map[chr] if rep then renderer.draw_text(font, rep, tx, ty, color) |