From 3301081073242ce7e8fcf28b61ef08e337827121 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 3 Feb 2015 10:14:56 +0100 Subject: [PATCH] Fix Tab in ICS command mode Tab was not working to open a chat after oborting opening a new one, when only one chat was open. --- dialogs.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dialogs.c b/dialogs.c index 63dff6a..86ea1d3 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1923,7 +1923,7 @@ IcsHist (int n, Option *opt, DialogClass dlg) while(!dirty[chat = (chat + 1)%MAX_CHAT]) if(chat == start) break; if(!dirty[chat]) while(!chatPartner[chat = (chat + 1)%MAX_CHAT][0]) if(chat == start) break; - if(chat == start && hidden) break; // if all unused, ignore + if(!chatPartner[chat][0]) break; // if all unused, ignore ChatSwitch(chat + 1); break; case 1: @@ -1962,11 +1962,12 @@ ChatOK (int n) { // can only be called through in chat-partner text-edit, as there is no OK button char buf[MSG_SIZ]; - if(!hidden && (!partner || strcmp(partner, chatPartner[activePartner]))) { + if(!hidden && (!partner || strcmp(partner, chatPartner[activePartner]) || !*partner)) { safeStrCpy(chatPartner[activePartner], partner, MSG_SIZ); SetWidgetText(&chatOptions[CHAT_OUT], "", -1); // clear text if we alter partner SetWidgetText(&chatOptions[CHAT_IN], "", ChatDlg); // clear text if we alter partner SetWidgetLabel(&chatOptions[activePartner+1], chatPartner[activePartner][0] ? chatPartner[activePartner] : _("New Chat")); + if(!*partner) PaneSwitch(); HardSetFocus(&chatOptions[CHAT_IN], 0); } if(line[0] || hidden) { // something was typed (for ICS commands we also allow empty line!) -- 1.7.0.4