From: Foxe Chen Date: Sun, 14 Jun 2026 15:35:04 +0000 (+0000) Subject: patch 9.2.0644: popup image: duplicate sync-output code X-Git-Tag: v9.2.0644^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=845fae6bdfb579211f7542e50e795be47a0cb2bd;p=thirdparty%2Fvim.git patch 9.2.0644: popup image: duplicate sync-output code Problem: popup image: duplicate sync-output code Solution: Remove duplicate code and re-use existing term_set_sync_output() function (Foxe Chen). closes: #20515 Signed-off-by: Foxe Chen Signed-off-by: Christian Brabandt --- diff --git a/src/popupwin.c b/src/popupwin.c index e5c936400f..dfd880a826 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -2091,42 +2091,6 @@ popup_image_composites_frames(void) return false; # endif } - -# if defined(FEAT_IMAGE_SIXEL) || defined(FEAT_IMAGE_KITTY) -// TRUE while a DEC synchronized-update block (DECSET 2026) is open around -// a popup image residue clear + re-emit. -static int popup_sync_update_open = FALSE; - -/* - * Begin a synchronized update before the cells under a popup image are - * repainted for an RGBA frame swap. Without it the terminal can render - * the freshly painted background cells before the new sixel frame - * arrives, making the animation flicker. Terminals that do not support - * mode 2026 ignore it. - */ - static void -popup_sync_update_start(void) -{ - if (popup_sync_update_open) - return; -# ifdef FEAT_GUI - if (gui.in_use) - return; -# endif - out_str((char_u *)"\033[?2026h"); - popup_sync_update_open = TRUE; -} - - static void -popup_sync_update_end(void) -{ - if (!popup_sync_update_open) - return; - out_str((char_u *)"\033[?2026l"); - out_flush(); - popup_sync_update_open = FALSE; -} -# endif #endif // Snapshot of the popup window geometry that update_popups() temporarily @@ -6906,7 +6870,7 @@ popup_invalidate_prev_image_rect(win_T *wp, popup_clip_T *cl) // synchronized updates, so the background never shows through // between animation frames. Closed right after this popup's // image is re-emitted in update_popups(). - popup_sync_update_start(); + term_set_sync_output(TERM_SYNC_OUTPUT_ENABLE); # endif } @@ -7841,7 +7805,7 @@ update_popups(void (*win_update)(win_T *wp)) # if defined(FEAT_IMAGE_SIXEL) || defined(FEAT_IMAGE_KITTY) // Close the synchronized-update block a residue clear for this // popup may have opened in popup_invalidate_prev_image_rect(). - popup_sync_update_end(); + term_set_sync_output(TERM_SYNC_OUTPUT_DISABLE); # endif } #endif diff --git a/src/version.c b/src/version.c index edb9737316..f00b31d09b 100644 --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 644, /**/ 643, /**/