-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: File-select dialog can open when going to exit #4582
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4582 +/- ##
==========================================
+ Coverage 80.83% 80.84% +<.01%
==========================================
Files 111 111
Lines 144576 144572 -4
==========================================
+ Hits 116875 116876 +1
+ Misses 27701 27696 -5
Continue to review full report at Codecov.
|
Thanks for the patch.
I'll leave the cosmetic changes for later.
## In addition
https://github.com/vim/vim/blob/master/src/ex_cmds.c#L3820-L3828
```c
#ifdef FEAT_BROWSE
if (cmdmod.browse)
{
if (
# ifdef FEAT_GUI
!gui.in_use &&
# endif
au_has_group((char_u *)"FileExplorer"))
{
```
It appears this `FEAT_GUI` isn't need since `FEAT_BROWSE` includes `FEAT_GUI`.
It is possible to define FEAT_BROWSE without the GUI.
…--
hundred-and-one symptoms of being an internet addict:
271. You collect hilarious signatures from all 250 mailing lists you
are subscribed to.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
@brammool |
Problem: May still start file dialog while exiting. Solution: Ignore the "browse" modifier in another place when exiiting. (Ozaki Kiichi, closes #4582)
Ozaki Kiichi wrote:
@brammool
Thank you, but v8.1.1592 seems wrong (or, at least, not enough).
Although v8.1.1592 changes `do_write()`, need change in `do_ecmd()` to fix this issue.
I see, do_browse() is used in two places. This is not covered by a
test. Can you attempt making a test that fails before the fix?
…--
We're knights of the round table
We dance whene'er we're able
We do routines and chorus scenes
With footwork impeccable.
We dine well here in Camelot
We eat ham and jam and spam a lot.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Problem: May start file dialog while exiting. Solution: Ignore the "browse" modifier when exiting. (Ozaki Kiichi, closes vim#4582
Problem: May still start file dialog while exiting. Solution: Ignore the "browse" modifier in another place when exiiting. (Ozaki Kiichi, closes vim#4582)
Environment
gVim v8.1.1587 (with GTK3) on Ubuntu 18.04
Repro steps
Click GUI window-close button and click "Yes" button on popup "Kill job in ...", then file-select dialog can open (or gVim finishes normally. Please try several times).
When click "Cancel", the dialog closes but opens again promptly.
Cause
Stacktrace when file-select dialog is shown:
In
term_try_stop_job()
,job->jv_status >= JOB_END
cannot hold necessarily just afterjob_end()
called (except Windows gVim).https://github.com/vim/vim/blob/master/src/terminal.c#L1451-L1459
Therefore,
do_browse()
is called as above trace, file-select dialog opens.When click "Cancel",
do_browse()
returns FAIL, so delete-buffer doesn't complete andfirst_term
remains then the loop interm_channel_closed()
isn't finished.https://github.com/vim/vim/blob/master/src/terminal.c#L3064-L3093
Solution proposal
term->tl_channel_closed
interm_channel_closed()
In addition
https://github.com/vim/vim/blob/master/src/ex_cmds.c#L3820-L3828
It appears this
FEAT_GUI
isn't need sinceFEAT_BROWSE
includesFEAT_GUI
.