mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
updated for version 7.0092
This commit is contained in:
@@ -743,13 +743,8 @@ add_msg_hist(s, len, attr)
|
||||
|
||||
/* Don't let the message history get too big */
|
||||
while (msg_hist_len > 20)
|
||||
{
|
||||
p = first_msg_hist;
|
||||
first_msg_hist = p->next;
|
||||
vim_free(p->msg);
|
||||
vim_free(p);
|
||||
--msg_hist_len;
|
||||
}
|
||||
(void)delete_first_msg();
|
||||
|
||||
/* allocate an entry and add the message at the end of the history */
|
||||
p = (struct msg_hist *)alloc((int)sizeof(struct msg_hist));
|
||||
if (p != NULL)
|
||||
@@ -776,6 +771,25 @@ add_msg_hist(s, len, attr)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete the first (oldest) message from the history.
|
||||
* Returns FAIL if there are no messages.
|
||||
*/
|
||||
int
|
||||
delete_first_msg()
|
||||
{
|
||||
struct msg_hist *p;
|
||||
|
||||
if (msg_hist_len <= 0)
|
||||
return FAIL;
|
||||
p = first_msg_hist;
|
||||
first_msg_hist = p->next;
|
||||
vim_free(p->msg);
|
||||
vim_free(p);
|
||||
--msg_hist_len;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* ":messages" command.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user