Re: [vim/vim] popup: opacity popup over a terminal is not cleared after closed (Issue #20846)
mityu (Vim Github Repository) <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/issues/20846/[email protected]> |
mityu left a comment (vim/vim#20846)
This should be a test case for this issue.
<details>
<summary>patch</summary>
```diff
diff --git a/src/testdir/dumps/Test_popupwin_opacity_term_close_1.dump b/src/testdir/dumps/Test_popupwin_opacity_term_close_1.dump
new file mode 100644
index 000000000..46714d08b
--- /dev/null
+++ b/src/testdir/dumps/Test_popupwin_opacity_term_close_1.dump
@@ -0,0 +1,12 @@
+|v+0&#ffffff0|i|m|>| > @69
+@75
+@75
+@75
+@9|A+0#0000001#ffffff255|B|C| +0#0000000#ffffff0@62
+@75
+@75
+@75
+@75
+@75
+@75
+@75
diff --git a/src/testdir/dumps/Test_popupwin_opacity_term_close_2.dump b/src/testdir/dumps/Test_popupwin_opacity_term_close_2.dump
new file mode 100644
index 000000000..cba005dca
--- /dev/null
+++ b/src/testdir/dumps/Test_popupwin_opacity_term_close_2.dump
@@ -0,0 +1,12 @@
+|v+0&#ffffff0|i|m|>| > @69
+@75
+@75
+@75
+@75
+@75
+@75
+@75
+@75
+@75
+@75
+|:|c|a|l@1| |C|l|o|s|e|I|t|(|)| @59
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 6aed7be3e..76f6db3a5 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -5383,6 +5383,42 @@ func Test_popup_opacity_terminal_move_no_leftover()
exe buf .. 'bwipe!'
endfunc
+func Test_popup_opacity_terminal_close_no_leftover()
+ CheckScreendump
+ CheckFeature terminal
+ CheckUnix
+
+ " A semi-transparent popup over a terminal used to leave the old popup
+ " cells behind when it closed.
+ let lines =<< trim END
+ set shell=/bin/sh noruler
+ unlet $PROMPT_COMMAND
+ let $PS1 = 'vim> '
+ terminal ++curwin
+ call popup_create('ABC',
+ \ #{line: 5, col: 10, highlight: 'None', opacity: 30})
+ func CloseIt()
+ let id = popup_list()[0]
+ call popup_close(id)
+ endfunc
+ END
+ call writefile(lines, 'XtestPopupOpacityTermClose', 'D')
+ let buf = RunVimInTerminal('-S XtestPopupOpacityTermClose',
+ \ #{rows: 12, wait_for_ruler: 0})
+ call WaitForAssert({-> assert_match('ABC', term_getline(buf, 5))})
+ call VerifyScreenDump(buf, 'Test_popupwin_opacity_term_close_1', {})
+
+ " Close the popup: the old "ABC" cells must be cleared.
+ call term_sendkeys(buf, "\<C-W>:call CloseIt()\<CR>")
+ call WaitForAssert({-> assert_equal('', term_getline(buf, 5)->trim())})
+ call VerifyScreenDump(buf, 'Test_popupwin_opacity_term_close_2', {})
+
+ " clean up
+ call term_sendkeys(buf, "\<C-W>:qa!\<CR>")
+ call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))})
+ exe buf .. 'bwipe!'
+endfunc
+
func Test_popup_opacity_terminal_no_freeze()
CheckFeature terminal
CheckUnix
```
</details>
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/issues/20846#issuecomment-5082643543
You are receiving this because you are subscribed to this thread.
Message ID: <vim/vim/issues/20846/[email protected]>
--
--
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/vim/vim/issues/20846/5082643543%40github.com.