Mercurial > vim
comparison src/os_unix.c @ 14479:3375a8cbb442 v8.1.0253
patch 8.1.0253: saving and restoring window title does not always work
commit https://github.com/vim/vim/commit/40385dbcdfb44885f2e9b83e1e0285aeb8a0c2a8
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 7 22:31:44 2018 +0200
patch 8.1.0253: saving and restoring window title does not always work
Problem: Saving and restoring window title does not always work.
Solution: Use the stack push and pop commands. (Kouichi Iwamoto,
closes #3059)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 07 Aug 2018 22:45:06 +0200 |
parents | 65b222617852 |
children | 80f715651c4c |
comparison
equal
deleted
inserted
replaced
14478:b35bae59c521 | 14479:3375a8cbb442 |
---|---|
2334 } | 2334 } |
2335 | 2335 |
2336 /* | 2336 /* |
2337 * Restore the window/icon title. | 2337 * Restore the window/icon title. |
2338 * "which" is one of: | 2338 * "which" is one of: |
2339 * 1 only restore title | 2339 * SAVE_RESTORE_TITLE only restore title |
2340 * 2 only restore icon | 2340 * SAVE_RESTORE_ICON only restore icon |
2341 * 3 restore title and icon | 2341 * SAVE_RESTORE_BOTH restore title and icon |
2342 */ | 2342 */ |
2343 void | 2343 void |
2344 mch_restore_title(int which) | 2344 mch_restore_title(int which) |
2345 { | 2345 { |
2346 /* only restore the title or icon when it has been set */ | 2346 /* only restore the title or icon when it has been set */ |
2347 mch_settitle(((which & 1) && did_set_title) ? | 2347 mch_settitle(((which & SAVE_RESTORE_TITLE) && did_set_title) ? |
2348 (oldtitle ? oldtitle : p_titleold) : NULL, | 2348 (oldtitle ? oldtitle : p_titleold) : NULL, |
2349 ((which & 2) && did_set_icon) ? oldicon : NULL); | 2349 ((which & SAVE_RESTORE_ICON) && did_set_icon) ? oldicon : NULL); |
2350 | |
2351 // pop and push from/to the stack | |
2352 term_pop_title(which); | |
2353 term_push_title(which); | |
2350 } | 2354 } |
2351 | 2355 |
2352 #endif /* FEAT_TITLE */ | 2356 #endif /* FEAT_TITLE */ |
2353 | 2357 |
2354 /* | 2358 /* |
3410 if (!gui.in_use) | 3414 if (!gui.in_use) |
3411 #endif | 3415 #endif |
3412 { | 3416 { |
3413 settmode(TMODE_COOK); | 3417 settmode(TMODE_COOK); |
3414 #ifdef FEAT_TITLE | 3418 #ifdef FEAT_TITLE |
3415 mch_restore_title(3); /* restore xterm title and icon name */ | 3419 // restore xterm title and icon name |
3420 mch_restore_title(SAVE_RESTORE_BOTH); | |
3421 term_pop_title(SAVE_RESTORE_BOTH); | |
3416 #endif | 3422 #endif |
3417 /* | 3423 /* |
3418 * When t_ti is not empty but it doesn't cause swapping terminal | 3424 * When t_ti is not empty but it doesn't cause swapping terminal |
3419 * pages, need to output a newline when msg_didout is set. But when | 3425 * pages, need to output a newline when msg_didout is set. But when |
3420 * t_ti does swap pages it should not go to the shell page. Do this | 3426 * t_ti does swap pages it should not go to the shell page. Do this |