Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a new source code buffer open when run finished #58

Closed
lookforit opened this issue Jul 1, 2014 · 22 comments
Closed

a new source code buffer open when run finished #58

lookforit opened this issue Jul 1, 2014 · 22 comments

Comments

@lookforit
Copy link

Here is my setting related to SingleCompile

let g:SingleCompile_showquickfixiferror = 1
let g:SingleCompile_showquickfixifwarning = 1
autocmd FileType c nmap  <F5> :SingleCompileRun <CR>
call SingleCompile#ChooseCompiler('c', 'clang')
let g:SingleCompile_showresultafterrun = 1
"Ignore messy output messages
let g:SingleCompile_silentcompileifshowquickfix = 1

The weired thing is ,when SingleCompileRun executed,the quickfix window shows the result automatically,also and a new source code buffer open horizontally .
How to disable this new -open buffer?

@xuhdev
Copy link
Owner

xuhdev commented Jul 1, 2014

It's not supposed to happen, and I cannot reproduce your issue. Can you provide more information, e.g. the source file you have problem with, and your OS and vim version. Thanks!

@lookforit
Copy link
Author

The code to reproduce this issue is rather simple:

#include <stdio.h>
int main(int argc, char *argv[])
{
    /* leave a warning intentionally: */
    printf("%d\n",sizeof(int));
    return 0;
}

Here, a warning will be found by clang.
After run SingleCompileRun, a buffer window will open.
By the way, if there are not warning found, this buffer does not come out, only quickfix shows,that's OK.

My OS is Kubuntu 14.04,vim is 7.4 with 334 patched.

Here is a screen-shot after executing:

@lookforit
Copy link
Author

@xuhdev
singlecompile

@xuhdev
Copy link
Owner

xuhdev commented Jul 2, 2014

@lookforit Sorry that I cannot really find a solution at this moment. The problem is that :cw command always automatically move the cursor to the quickfix window, which causes the problem. However, I cannot find a way to disable this automatic behavior. If you have an idea, please let me know.

@lookforit
Copy link
Author

hope this issue will be fixed in the further release.

@oblitum
Copy link
Contributor

oblitum commented Nov 18, 2014

I'm using boost headers and they're full of warnings using clang with -Wall -Wextra. I don't mind the warnings that are shown in the quickfix, the problem is that compilation always jumps to some random boost header because of such warnings :-/

@oblitum
Copy link
Contributor

oblitum commented Nov 18, 2014

@xuhdev Isn't his issue regarding jumping to the warning, not the warning in the quickfix window? I have the same problem as him I believe. Coudn't SingleCompile provide altenative ! commands like :SCCompile! so that it doesn't automaticaly jumps to a buffer containing the warning?

@xuhdev
Copy link
Owner

xuhdev commented Nov 18, 2014

No you have different problems.

@oblitum
Can you modify line 1160 of autoload/SingleCompile.vim to add a ! after make? After you tried that, the cursor should stop jumping to the first error/warning, but the quickfix window would also not automatically pop up. I have no idea why this happens.

@oblitum
Copy link
Contributor

oblitum commented Nov 27, 2014

@xuhdev Yes thanks!, it has stopped doing that.

@oblitum
Copy link
Contributor

oblitum commented Nov 27, 2014

@xuhdev also, contrary to what you said, it's still opening the quickfix automatically after compiling, so now it's working 100% :-)

@oblitum
Copy link
Contributor

oblitum commented Nov 28, 2014

I've noticed trying this on Arch doesn't work. The plugin stopped working, although it works on Mac. On Arch also, the fix is unnecessary for me. It just works as expected.

@xuhdev
Copy link
Owner

xuhdev commented Nov 28, 2014

I think this is an issue in Vim internally. Do you use your MacVim from homebrew? What if you revert to the same Vim version on Arch? Are you using gvim on both OSes?

@oblitum
Copy link
Contributor

oblitum commented Nov 28, 2014

I'm using MacVim yes, I had just updated it, still same behavior, it's from homebrew --HEAD:

➤ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 27 2014 23:10:48)
MacOS X (unix) version
Included patches: 1-383
Compiled by Homebrew

On Arch it was a very recent one too I guess, since I had just setup the machine this week. It was installed with pacman.

Even though it's MacVim, I'm not using graphical frontends, just terminal versions.

@oblitum
Copy link
Contributor

oblitum commented Nov 28, 2014

by the way, in any case, it does still jumps to the quickfix buffer when it's set to open automatically, which I guess is the original reason of this issue. But it's less annoying than opening the buffer with the error too.

@oblitum
Copy link
Contributor

oblitum commented Nov 28, 2014

I've uninstalled MacVim and installed raw Vim with homebrew --HEAD, still same behavior.

@xuhdev
Copy link
Owner

xuhdev commented Nov 28, 2014

If I understand correctly, you use vim on terminal on both OSes, right? To use the latest Vim available on homebrew, you should run

brew install vim --HEAD

not MacVim. The latest version in HEAD is 7.4.537.

@oblitum
Copy link
Contributor

oblitum commented Nov 28, 2014

That's what I've done to test it. Both MacVim terminal and vim have same behavior.

@xuhdev
Copy link
Owner

xuhdev commented Nov 29, 2014

But your Vim version shows 7.4.383. That is where I am confused.

@oblitum
Copy link
Contributor

oblitum commented Nov 29, 2014

That was the version for MacVim. As I said, afterwards I've uninstalled it and installed vim from HEAD of official mercurial repositories through homebrew just to test its behavior, which was the same.

@oblitum
Copy link
Contributor

oblitum commented Nov 29, 2014

This is the version in homebrew's cache (since I have uninstalled it):

/L/C/H/vim--hg ❯❯❯ hg log -l 1                            
changeset:   6414:af110084ec06
tag:         tip
user:        Bram Moolenaar <bram@vim.org>
date:        Thu Nov 27 19:14:49 2014 +0100
summary:     Added tag v7-4-537 for changeset 01c668384bcc

@oblitum
Copy link
Contributor

oblitum commented Nov 29, 2014

Ah, now, that I've actually run some code with :SingleCompileRun after enabling

let g:SingleCompile_showquickfixiferror = 1
let g:SingleCompile_showquickfixifwarning = 1

I'm also experiencing the code buffer showing up in-place of the quickfix window. Just like @lookforit's screenshot.

@xuhdev
Copy link
Owner

xuhdev commented Dec 15, 2014

@oblitum Sorry that it seems I really can't do anything to help. This seems to be different behavior on different OSes of Vim (same code produces different output), we have to extract the problematic code and report it back to Vim. I'll try if I can.

mMontu added a commit to mMontu/SingleCompile that referenced this issue Aug 23, 2021
@xuhdev xuhdev closed this as completed in b8f53a2 Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants