diff src/move.c @ 30231:0d084880276a v9.0.0451

patch 9.0.0451: virtual text "above" does not work with 'nowrap' Commit: https://github.com/vim/vim/commit/c9dc03fff5acf6fb91a923fb95006f9c2bca6141 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 12 17:51:07 2022 +0100 patch 9.0.0451: virtual text "above" does not work with 'nowrap' Problem: Virtual text "above" does not work with 'nowrap'. Solution: Do wrap the line after. (closes https://github.com/vim/vim/issues/11084)
author Bram Moolenaar <Bram@vim.org>
date Mon, 12 Sep 2022 19:00:05 +0200
parents bc8ad1c28b51
children 914b3c64ab92
line wrap: on
line diff
--- a/src/move.c
+++ b/src/move.c
@@ -1068,6 +1068,19 @@ curs_columns(
 #endif
 	    )
     {
+#ifdef FEAT_PROP_POPUP
+	if (curwin->w_virtcol_first_char > 0)
+	{
+	    int cols = (curwin->w_width - extra);
+	    int rows = cols > 0 ? curwin->w_virtcol_first_char / cols : 1;
+
+	    // each "above" text prop shifts the text one row down
+	    curwin->w_wrow += rows;
+	    curwin->w_wcol -= rows * cols;
+	    endcol -= rows * cols;
+	    curwin->w_cline_height = rows + 1;
+	}
+#endif
 	/*
 	 * If Cursor is left of the screen, scroll rightwards.
 	 * If Cursor is right of the screen, scroll leftwards