]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0644: popup image: duplicate sync-output code v9.2.0644
authorFoxe Chen <chen.foxe@gmail.com>
Sun, 14 Jun 2026 15:35:04 +0000 (15:35 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 14 Jun 2026 15:35:04 +0000 (15:35 +0000)
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 <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/popupwin.c
src/version.c

index e5c936400f3499a35b0629a7af366b5e0c98d5e7..dfd880a8267f798d050cde0c07463617faed47e6 100644 (file)
@@ -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
index edb97373162ace63f91d5a6fb2540a4f3828703f..f00b31d09b5c1436dbf05b1b8d88023241a12d40 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    644,
 /**/
     643,
 /**/