mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18:32 +00:00
Merge pull request #1024 from war1025/dev/for_all_buffers
Add FOR_ALL_BUFFERS helper
This commit is contained in:
@@ -1211,7 +1211,6 @@ do_shell (
|
||||
int flags /* may be SHELL_DOOUT when output is redirected */
|
||||
)
|
||||
{
|
||||
buf_T *buf;
|
||||
int save_nwr;
|
||||
|
||||
/*
|
||||
@@ -1239,11 +1238,12 @@ do_shell (
|
||||
if (p_warn
|
||||
&& !autocmd_busy
|
||||
&& msg_silent == 0)
|
||||
for (buf = firstbuf; buf; buf = buf->b_next)
|
||||
FOR_ALL_BUFFERS(buf) {
|
||||
if (bufIsChanged(buf)) {
|
||||
MSG_PUTS(_("[No write since last change]\n"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* This windgoto is required for when the '\n' resulted in a "delete line
|
||||
* 1" command to the terminal. */
|
||||
@@ -1753,7 +1753,6 @@ static void do_viminfo(FILE *fp_in, FILE *fp_out, int flags)
|
||||
static int read_viminfo_up_to_marks(vir_T *virp, int forceit, int writing)
|
||||
{
|
||||
int eof;
|
||||
buf_T *buf;
|
||||
|
||||
prepare_viminfo_history(forceit ? 9999 : 0, writing);
|
||||
eof = viminfo_readline(virp);
|
||||
@@ -1816,8 +1815,9 @@ static int read_viminfo_up_to_marks(vir_T *virp, int forceit, int writing)
|
||||
finish_viminfo_history();
|
||||
|
||||
/* Change file names to buffer numbers for fmarks. */
|
||||
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
|
||||
FOR_ALL_BUFFERS(buf) {
|
||||
fmarks_check_names(buf);
|
||||
}
|
||||
|
||||
return eof;
|
||||
}
|
||||
@@ -2362,14 +2362,13 @@ void ex_wnext(exarg_T *eap)
|
||||
*/
|
||||
void do_wqall(exarg_T *eap)
|
||||
{
|
||||
buf_T *buf;
|
||||
int error = 0;
|
||||
int save_forceit = eap->forceit;
|
||||
|
||||
if (eap->cmdidx == CMD_xall || eap->cmdidx == CMD_wqall)
|
||||
exiting = TRUE;
|
||||
|
||||
for (buf = firstbuf; buf != NULL; buf = buf->b_next) {
|
||||
FOR_ALL_BUFFERS(buf) {
|
||||
if (bufIsChanged(buf)) {
|
||||
/*
|
||||
* Check if there is a reason the buffer cannot be written:
|
||||
@@ -5679,7 +5678,6 @@ void ex_sign(exarg_T *eap)
|
||||
int idx;
|
||||
sign_T *sp;
|
||||
sign_T *sp_prev;
|
||||
buf_T *buf;
|
||||
|
||||
/* Parse the subcommand. */
|
||||
p = skiptowhite(arg);
|
||||
@@ -5906,10 +5904,11 @@ void ex_sign(exarg_T *eap)
|
||||
if (idx == SIGNCMD_UNPLACE && *arg == NUL)
|
||||
{
|
||||
/* ":sign unplace {id}": remove placed sign by number */
|
||||
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
|
||||
if ((lnum = buf_delsign(buf, id)) != 0)
|
||||
update_debug_sign(buf, lnum);
|
||||
return;
|
||||
FOR_ALL_BUFFERS(buf) {
|
||||
if ((lnum = buf_delsign(buf, id)) != 0)
|
||||
update_debug_sign(buf, lnum);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5918,6 +5917,8 @@ void ex_sign(exarg_T *eap)
|
||||
* Check for line={lnum} name={name} and file={fname} or buffer={nr}.
|
||||
* Leave "arg" pointing to {fname}.
|
||||
*/
|
||||
|
||||
buf_T *buf = NULL;
|
||||
for (;;)
|
||||
{
|
||||
if (STRNCMP(arg, "line=", 5) == 0)
|
||||
|
Reference in New Issue
Block a user