Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. diff --git a/src/ex_cmds.c b/src/ex_cmds.c
  2. index caf0b1501..e4356056e 100644
  3. --- a/src/ex_cmds.c
  4. +++ b/src/ex_cmds.c
  5. @@ -1540,8 +1540,9 @@ do_shell(
  6. #ifndef FEAT_GUI_MSWIN
  7. int save_nwr;
  8. #endif
  9. -#ifdef MSWIN
  10. - int winstart = FALSE;
  11. +#if defined(MSWIN) || defined(FEAT_GUI_MSWIN) \
  12. + || (defined(FEAT_GUI) && defined(FEAT_TERMINAL))
  13. + int keep_termcap = FALSE;
  14. #endif
  15.  
  16. /*
  17. @@ -1560,11 +1561,12 @@ do_shell(
  18. * Check if ":!start" is used.
  19. */
  20. if (cmd != NULL)
  21. - winstart = (STRNICMP(cmd, "start ", 6) == 0);
  22. -# ifdef FEAT_GUI_MSWIN
  23. - else
  24. - winstart = 1;
  25. -# endif
  26. + keep_termcap = (STRNICMP(cmd, "start ", 6) == 0);
  27. +#endif
  28. +
  29. +#if defined(FEAT_GUI) && defined(FEAT_TERMINAL)
  30. + if (vim_strchr(p_go, GO_TERMINAL) != NULL)
  31. + keep_termcap = TRUE;
  32. #endif
  33.  
  34. /*
  35. @@ -1575,12 +1577,12 @@ do_shell(
  36. if (!autocmd_busy)
  37. {
  38. #ifdef MSWIN
  39. - if (!winstart)
  40. + if (!keep_termcap)
  41. #endif
  42. stoptermcap();
  43. }
  44. #ifdef MSWIN
  45. - if (!winstart)
  46. + if (!keep_termcap)
  47. #endif
  48. msg_putchar('\n'); /* may shift screen one line up */
  49.  
  50. @@ -1590,12 +1592,12 @@ do_shell(
  51. if (bufIsChangedNotTerm(buf))
  52. {
  53. #ifdef FEAT_GUI_MSWIN
  54. - if (!winstart)
  55. + if (!keep_termcap)
  56. starttermcap(); /* don't want a message box here */
  57. #endif
  58. msg_puts(_("[No write since last change]\n"));
  59. #ifdef FEAT_GUI_MSWIN
  60. - if (!winstart)
  61. + if (!keep_termcap)
  62. stoptermcap();
  63. #endif
  64. break;
  65. @@ -1636,7 +1638,7 @@ do_shell(
  66. #ifndef FEAT_GUI_MSWIN
  67. if (cmd == NULL
  68. # ifdef MSWIN
  69. - || (winstart && !need_wait_return)
  70. + || (keep_termcap && !need_wait_return)
  71. # endif
  72. )
  73. {
  74. @@ -1663,7 +1665,7 @@ do_shell(
  75. #endif /* FEAT_GUI_MSWIN */
  76.  
  77. #ifdef MSWIN
  78. - if (!winstart) /* if winstart==TRUE, never stopped termcap! */
  79. + if (!keep_termcap) /* if keep_termcap==TRUE, never stopped termcap! */
  80. #endif
  81. starttermcap(); /* start termcap if not done by wait_return() */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement