On So, 16 Feb 2014, Gary Johnson wrote:
> I created a quickfix error file containing one error and opened it
> like this:
>
> $ vim -N -u NONE -i NONE -q make.out
>
> At the bottom of the screen I see the message:
>
> (3 of 3): warning: incompatible imlicit declaration of built-in function
> 'exit'
>
> So far, so good. But if I look at all messages, I see that it was
> generated twice:
>
> :messages
> Messages maintainer: Bram Moolenaar <[email protected]>
> "main.c" 6L, 66C
> (3 of 3): warning: incompatible implicit declaration of built-in function
> ‘exit’
> (3 of 3): warning: incompatible implicit declaration of built-in function
> ‘exit’
> Press ENTER or type command to continue
>
> This would not be a big deal except that in some cases when using
> the -q option, both messages are displayed at the bottom of the
> screen and stay there until I press ENTER. One would be sufficient
> and might not require that I press ENTER to proceed.
>
> Annoyance or not, it looks like unintended behavior.
This actually does not only happen with -q but everywhere where
qf_jump() is called (:cfile, :cbu, :helpgrep to name a few).
Here is a patch, avoiding adding the same message to the message history
twice.
diff --git a/src/quickfix.c b/src/quickfix.c
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -1887,11 +1887,15 @@
* flag is present in 'shortmess'; But when not jumping, print the
* whole message. */
i = msg_scroll;
+ /* avoid adding the message to the twice history, this will happen
+ * later in the main loop in msg_attr_keep */
+ msg_hist_off++;
if (curbuf == old_curbuf && curwin->w_cursor.lnum == old_lnum)
msg_scroll = TRUE;
else if (!msg_scrolled && shortmess(SHM_OVERALL))
msg_scroll = FALSE;
msg_attr_keep(IObuff, 0, TRUE);
+ msg_hist_off--;
msg_scroll = i;
}
}
Best,
Christian
--
Democracy is a government where you can say what you think even if you
don't think.
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.