From 5f4d2edeeea4d05761811d652dee8067fdbbae2a Mon Sep 17 00:00:00 2001 From: nate Date: Sat, 19 Aug 2017 18:33:14 -0700 Subject: 'titleold': set UI title on exit #7191 closes #7129 ref #4063 --- src/nvim/buffer.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 724a8578ac..950010b13b 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3069,9 +3069,16 @@ static bool ti_change(char_u *str, char_u **last) /// Set current window title void resettitle(void) { - ui_call_set_title(cstr_as_string((char *)lasttitle)); - ui_call_set_icon(cstr_as_string((char *)lasticon)); - ui_flush(); + // if icon change, should the title be reset too? + if (p_icon) { + ui_call_set_title(cstr_as_string((char *)lasttitle)); + ui_call_set_icon(cstr_as_string((char *)lasticon)); + } else if (p_title) { + ui_call_set_title(cstr_as_string((char *)lasttitle)); + } + if (p_title || p_icon) { + ui_flush(); + } } # if defined(EXITFREE) -- cgit From 70e84a7c4c7bfad9b3a0ec18fd219f51205c03f8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 5 Oct 2017 09:14:18 +0200 Subject: 'titleold': simplify behavior - default 'titleold' to empty - set title on exit if 'title' is enabled and 'titleold' is non-empty - update docs --- src/nvim/buffer.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 950010b13b..fbfb4e02ea 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3069,14 +3069,11 @@ static bool ti_change(char_u *str, char_u **last) /// Set current window title void resettitle(void) { - // if icon change, should the title be reset too? if (p_icon) { - ui_call_set_title(cstr_as_string((char *)lasttitle)); ui_call_set_icon(cstr_as_string((char *)lasticon)); - } else if (p_title) { - ui_call_set_title(cstr_as_string((char *)lasttitle)); } if (p_title || p_icon) { + ui_call_set_title(cstr_as_string((char *)lasttitle)); ui_flush(); } } -- cgit