From 09bfb8d869fb57d370d8fe3a4062062579242178 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Wed, 4 May 2022 20:05:41 -0400 Subject: [PATCH] Updated linewrap and autocomplete to use the new get_line_screen_position which takes a col. --- data/plugins/autocomplete.lua | 3 +-- data/plugins/linewrapping.lua | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/data/plugins/autocomplete.lua b/data/plugins/autocomplete.lua index 8273f3e5..eeb430a5 100644 --- a/data/plugins/autocomplete.lua +++ b/data/plugins/autocomplete.lua @@ -228,8 +228,7 @@ local function get_suggestions_rect(av) end local line, col = av.doc:get_selection() - local x, y = av:get_line_screen_position(line) - x = x + av:get_col_x_offset(line, col - #partial) + local x, y = av:get_line_screen_position(line, col - #partial) y = y + av:get_line_height() + style.padding.y local font = av:get_font() local th = font:get_height() diff --git a/data/plugins/linewrapping.lua b/data/plugins/linewrapping.lua index c7ae6278..bcb237eb 100644 --- a/data/plugins/linewrapping.lua +++ b/data/plugins/linewrapping.lua @@ -380,7 +380,7 @@ function DocView:get_line_screen_position(line, col) local x, y = self:get_content_offset() local lh = self:get_line_height() local gw = self:get_gutter_width() - return x + gw + (col and self:get_col_x_offset(line, col) or 0), y + (idx-1) * lh + style.padding.y + return x + gw + style.padding.x + (col and self:get_col_x_offset(line, col) or 0), y + (idx-1) * lh + style.padding.y end local old_resolve_screen_position = DocView.resolve_screen_position