aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2020-07-31 01:29:02 +0900
committererw7 <erw7.github@gmail.com>2020-07-31 02:11:50 +0900
commitf1bd2c1dd9d7b0de0a291c690d828a112f8b6cae (patch)
tree8a09ff809a184b65a23be9a0cb761c8b0a4c2271 /src
parent5f5bd576e5395ef0cd6198f16d10edc1ff4bbe76 (diff)
downloadrneovim-f1bd2c1dd9d7b0de0a291c690d828a112f8b6cae.tar.gz
rneovim-f1bd2c1dd9d7b0de0a291c690d828a112f8b6cae.tar.bz2
rneovim-f1bd2c1dd9d7b0de0a291c690d828a112f8b6cae.zip
ui: fix problem with the popupmenu when rightleft is set
fixes #12032
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ui_compositor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/ui_compositor.c b/src/nvim/ui_compositor.c
index e582d8f859..bc7fee7e96 100644
--- a/src/nvim/ui_compositor.c
+++ b/src/nvim/ui_compositor.c
@@ -311,6 +311,9 @@ ScreenGrid *ui_comp_mouse_focus(int row, int col)
static void compose_line(Integer row, Integer startcol, Integer endcol,
LineFlags flags)
{
+ // If rightleft is set, startcol may be -1. In such cases, the assertions
+ // will fail because no overlap is found. Adjust startcol to prevent it.
+ startcol = MAX(startcol, 0);
// in case we start on the right half of a double-width char, we need to
// check the left half. But skip it in output if it wasn't doublewidth.
int skipstart = 0, skipend = 0;