1
0
mirror of https://github.com/irssi/irssi.git synced 2025-01-03 14:56:47 -05:00

/WINDOW NAME now complains if you try to change the window's name to

something that's already in use.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2140 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-11-25 15:16:28 +00:00 committed by cras
parent 5347d24e61
commit 8fd09aa09f
3 changed files with 9 additions and 2 deletions

View File

@ -37,6 +37,7 @@ FORMAT_REC fecommon_core_formats[] = {
{ "error_server_sticky", "Window's server is sticky and it cannot be changed without -unsticky option", 0 },
{ "set_server_sticky", "Window's server set sticky", 1, { 0 } },
{ "unset_server_sticky", "Window's server isn't sticky anymore", 0 },
{ "window_name_not_unique", "Window names must be unique", 1, { 0 } },
{ "window_level", "Window level is now $0", 1, { 0 } },
{ "windowlist_header", "Ref Name Active item Server Level", 0 },
{ "windowlist_line", "$[3]0 %|$[20]1 $[15]2 $[15]3 $4", 5, { 1, 0, 0, 0, 0 } },

View File

@ -14,7 +14,8 @@ enum {
TXT_REFNUM_TOO_LOW,
TXT_ERROR_SERVER_STICKY,
TXT_SET_SERVER_STICKY,
TXT_UNSET_SERVER_STICKY,
TXT_UNSET_SERVER_STICKY,
TXT_WINDOW_NAME_NOT_UNIQUE,
TXT_WINDOW_LEVEL,
TXT_WINDOWLIST_HEADER,
TXT_WINDOWLIST_LINE,

View File

@ -460,7 +460,12 @@ static void cmd_window_number(const char *data)
/* SYNTAX: WINDOW NAME <name> */
static void cmd_window_name(const char *data)
{
window_set_name(active_win, data);
if (window_find_name(data) == NULL)
window_set_name(active_win, data);
else {
printformat_window(active_win, MSGLEVEL_CLIENTERROR,
TXT_WINDOW_NAME_NOT_UNIQUE, data);
}
}
/* we're moving the first window to last - move the first contiguous block