Mercurial > vim
comparison src/popupwin.c @ 16992:0f2663c087cd v8.1.1496
patch 8.1.1496: popup window height is not recomputed
commit https://github.com/vim/vim/commit/acc682bd7ca66b74b42de7a5fb5d3ef37897926f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 8 17:15:51 2019 +0200
patch 8.1.1496: popup window height is not recomputed
Problem: Popup window height is not recomputed.
Solution: Recompute the height when needed.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 08 Jun 2019 17:30:06 +0200 |
parents | 03f3a9ca2770 |
children | 905e1b154058 |
comparison
equal
deleted
inserted
replaced
16991:4058ba389909 | 16992:0f2663c087cd |
---|---|
539 // No truncation, because that would change the height. | 539 // No truncation, because that would change the height. |
540 if (wp->w_width + extra_width < wp->w_wantcol) | 540 if (wp->w_width + extra_width < wp->w_wantcol) |
541 wp->w_wincol = wp->w_wantcol - (wp->w_width + extra_width); | 541 wp->w_wincol = wp->w_wantcol - (wp->w_width + extra_width); |
542 } | 542 } |
543 | 543 |
544 if (wp->w_height <= 1) | 544 wp->w_height = wp->w_buffer->b_ml.ml_line_count + wrapped; |
545 wp->w_height = wp->w_buffer->b_ml.ml_line_count + wrapped; | |
546 if (wp->w_minheight > 0 && wp->w_height < wp->w_minheight) | 545 if (wp->w_minheight > 0 && wp->w_height < wp->w_minheight) |
547 wp->w_height = wp->w_minheight; | 546 wp->w_height = wp->w_minheight; |
548 if (wp->w_maxheight > 0 && wp->w_height > wp->w_maxheight) | 547 if (wp->w_maxheight > 0 && wp->w_height > wp->w_maxheight) |
549 wp->w_height = wp->w_maxheight; | 548 wp->w_height = wp->w_maxheight; |
550 if (wp->w_height > Rows - wp->w_winrow) | 549 if (wp->w_height > Rows - wp->w_winrow) |
564 } | 563 } |
565 | 564 |
566 wp->w_popup_last_changedtick = CHANGEDTICK(wp->w_buffer); | 565 wp->w_popup_last_changedtick = CHANGEDTICK(wp->w_buffer); |
567 | 566 |
568 // Need to update popup_mask if the position or size changed. | 567 // Need to update popup_mask if the position or size changed. |
568 // And redraw windows that were behind the popup. | |
569 if (org_winrow != wp->w_winrow | 569 if (org_winrow != wp->w_winrow |
570 || org_wincol != wp->w_wincol | 570 || org_wincol != wp->w_wincol |
571 || org_width != wp->w_width | 571 || org_width != wp->w_width |
572 || org_height != wp->w_height) | 572 || org_height != wp->w_height) |
573 { | 573 { |
574 // TODO: redraw only windows that were below the popup. | |
574 redraw_all_later(NOT_VALID); | 575 redraw_all_later(NOT_VALID); |
575 popup_mask_refresh = TRUE; | 576 popup_mask_refresh = TRUE; |
576 } | 577 } |
577 } | 578 } |
578 | 579 |