1. Rui
  2. vim-qt
  3. Issues
Issue #79 resolved

bump in statusline

repo owner created an issue

Reported by totte via irc

What steps will reproduce the problem?

When moving the text cursor up and down the statusline changes (line/column/etc), resulting in a "bump" above the character that changed. The problem only becomes apparent when a char changes in the statusline, and forcing a full redraw (e.g. resize) seems to draw the contents properly.

I've included a screenshot, look at the "1%" in the statusline, the fontsize is larger in order to make this more aparent, but the spill over the charater seems to be independant of the font size.

Technicall bits

Apparently whenever we are redrawing a char, the text background is spilling outside the statusline. i.e. we are painting the background at the wrong coordinates (or the previous paint was at the wrong coordinates).

Internally the coordinates for the filling of the background are calculated at:

  • gui_mch_draw_string() for text background
  • VimWrapper::mapText() and ::mapBlock()

Interestingly enough there seems to be a bug in VimWrapper::mapBlock() where the bottom right corner of the block seems to be one pixel too long.

        br.setX( br.x()-1 );
-       br.setY( br.y() );
+       br.setY( br.y()-1 );

This seems to fix this issue, but makes it hard to explain for 2 reasons 1. I was expecting an extra pixel at the top, not the bottom 2. We are not consistent across all operations, i.e. this bug would have gone mostly unnonticed if the extra pixel was added to all operations

From some quick tests I can already establish that gui_mch_clear_block paints one more pixel that gui_mch_draw_string, but the order of painting operations that causes this issue to occur is not so clear.

Comments (3)

  1. Rui reporter

    A fix for this has been started in tb-issue79. Even if the submitted patch solves the issue there are still a couple of loose points that should be addressed for consistency:

    • Change gui_mch_draw_string() to use mapBlock instead of calculating the block size
    • gui_mch_draw_cursor()/draw_part might be able to use mapBlock()
    • In gui_mch_insert_lines() use mapText() to get the top left position
  2. Log in to comment