patch 9.2.0644: popup image: duplicate sync-output code

Commit: 
https://github.com/vim/vim/commit/845fae6bdfb579211f7542e50e795be47a0cb2bd
Author: Foxe Chen <[email protected]>
Date:   Sun Jun 14 15:35:04 2026 +0000

    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 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/popupwin.c b/src/popupwin.c
index e5c936400..dfd880a82 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 *)" [?2026h");
-    popup_sync_update_open = TRUE;
-}
-
-    static void
-popup_sync_update_end(void)
-{
-    if (!popup_sync_update_open)
-       return;
-    out_str((char_u *)" [?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 edb973731..f00b31d09 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,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1wYn1E-00Evq1-5t%40256bit.org.

Raspunde prin e-mail lui