Skip to content

Commit

Permalink
Address #1279, port "repeat last message" command (Ctrl+O) from V.
Browse files Browse the repository at this point in the history
  • Loading branch information
flambard-took committed May 22, 2019
1 parent 365000d commit 456677f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/client/c-cmd.c
Expand Up @@ -461,6 +461,12 @@ void process_command()
break;
}

case KTRL('O'): /* Repeat last message */
{
do_cmd_message_one();
break;
}

case KTRL('P'):
{
do_cmd_messages();
Expand Down
1 change: 1 addition & 0 deletions src/client/c-cmd0.c
Expand Up @@ -739,6 +739,7 @@ void cmd_init(void)
cmd_init_one(CMD_LIST_ACTION, "Walk", ';');
/* Hack -- add more local commands */
cmd_init_one(CMD_LIST_INFO, "Character description",'C');
cmd_init_one(CMD_LIST_INFO, "Show previous message",KTRL('O'));
cmd_init_one(CMD_LIST_INFO, "Show previous messages",KTRL('P'));
/* Go through every command */
for (i = 0; i < custom_commands; i++)
Expand Down
1 change: 1 addition & 0 deletions src/client/c-externs.h
Expand Up @@ -532,6 +532,7 @@ extern void redraw_indicators(u32b filter);


/* c-xtra2.c */
extern void do_cmd_message_one(void);
extern void do_cmd_messages(void);
extern void do_chat_open(int id, cptr name);
extern void do_chat_select(int id);
Expand Down
13 changes: 13 additions & 0 deletions src/client/c-xtra2.c
Expand Up @@ -2,6 +2,19 @@

#include "c-angband.h"

/*
* Recall the most recent message
*/
void do_cmd_message_one(void)
{
byte attr;
cptr s = message_str(0);
message_color(s, &attr);
/* Recall one message XXX XXX XXX */
c_prt(attr, format( "> %s", s), 0, 0);
}


/*
* Show previous messages to the user -BEN-
*
Expand Down

0 comments on commit 456677f

Please sign in to comment.