aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--plugins/drawwhitespace.lua7
2 files changed, 5 insertions, 4 deletions
diff --git a/README.md b/README.md
index efa9f58..c2201ae 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ Plugin | Description
[`datetimestamps`](plugins/datetimestamps.lua?raw=1) | Insert date-, time- and date-time-stamps
~~[`detectindent`](plugins/detectindent.lua?raw=1)~~ | Included with lite-xl ~~Automatically detects and uses the indentation size and tab type of a loaded file~~
[`dragdropselected`](plugins/dragdropselected.lua?raw=1) | Provides basic drag and drop of selected text (in same document)
-[`drawwhitespace`](plugins/drawwhitespace.lua?raw=1) | Draws tabs and spaces *([screenshot](https://user-images.githubusercontent.com/3920290/80573013-22ae5800-89f7-11ea-9895-6362a1c0abc7.png))*
+*[`drawwhitespace`](plugins/drawwhitespace.lua?raw=1)* | Draws tabs and spaces *([screenshot](https://user-images.githubusercontent.com/3920290/80573013-22ae5800-89f7-11ea-9895-6362a1c0abc7.png))*
[`eofnewline`](https://github.com/bokunodev/lite_modules/blob/master/plugins/eofnewline.lua?raw=1) | Make sure the file ends with one blank line.
[`eval`](plugins/eval.lua?raw=1) | Replaces selected Lua code with its evaluated result
[`exec`](plugins/exec.lua?raw=1) | Runs selected text through shell command and replaces with result
diff --git a/plugins/drawwhitespace.lua b/plugins/drawwhitespace.lua
index c6ed07d..4e2e109 100644
--- a/plugins/drawwhitespace.lua
+++ b/plugins/drawwhitespace.lua
@@ -16,17 +16,18 @@ function DocView:draw_line_text(idx, x, y)
if not config.draw_whitespace then return end
local text = self.doc.lines[idx]
- local tx, ty = x, y + self:get_line_text_y_offset()
local font = self:get_font()
+ local ss = font:subpixel_scale()
+ local tx, ty = ss * x, y + self:get_line_text_y_offset()
local color = style.whitespace or style.syntax.comment
local map = config.whitespace_map
for chr in common.utf8_chars(text) do
local rep = map[chr]
if rep then
- renderer.draw_text(font, rep, tx, ty, color)
+ renderer.draw_text_subpixel(font, rep, tx, ty, color)
end
- tx = tx + font:get_width(chr)
+ tx = tx + font:get_width_subpixel(chr)
end
end