tomtom / checksyntax_vim

Check a file's syntax when saving a file (php, ruby, tex ...) with vim
http://www.vim.org/scripts/script.php?script_id=1431
GNU General Public License v3.0
94 stars 9 forks source link

php duplicate errors #7

Closed cj closed 12 years ago

cj commented 13 years ago

Hi,

Is there anyway to stop duplicate errors for everything? http://screencast.com/t/8ZFLZcW04

Many thanks,

CJ

tomtom commented 13 years ago

Hi,

Is this issue about checksyntax displaying an error twice or do you want checksyntax to remove duplicate errors? The problem with the latter probably is that the compiler/syntax checker reports two errors with different error messages. The problem seems to be with the compiler/syntax checker that cannot decide what actually is the problem.

Edit: I see that the error message is exactly the same. I cannot reproduce this though. Could you please explain in detail what you are doing so that I can reproduce the problem? Thanks.

Regards, Tom

cj commented 13 years ago

Hi Tom,

It's happend ever since I've used the plugin, any php error I get is a duplicate. Here's my vim config https://github.com/cj/vim

Many thanks,

CJ

tomtom commented 13 years ago

Since the repo doesn't include all bundles I wasn't able to use your config without errors. I linked the checksyntax subdirectory to the git version of the plugin. I wasn't able to reproduce the error.

You could try to:

setlocal makeprg=php\ -l
setlocal efm=%*[^:]:\ %m\ in\ %f\ on\ line\ %l
lmake
lopen

and check if this produces duplicate entries too. If yes, you could try

call checksyntax#Check(0)
lopen  " If you use an older version of the plugin, please use copen instead.

and check if there are duplicate entries.

BTW you might want to delete the _tplugin.vim file from your config.

cj commented 13 years ago

Still doing it....does it have anything to do with i'm using mvim ? It does it on a fre install too, I've never had it where it only shows one error.

tomtom commented 13 years ago

You could try

set vfile=checksyntax.log
20verb call checksyntax#Check(0)

and send me the log file.

Did you try the lmake/lopen command from above? Does it show duplicates too?

sbaumeister commented 13 years ago

Same problem here, every error is displayed twice. Vim 7.3.219 on Windows 7 with PHP 5.3.5. The following works correctly though showing only one error:

compiler php
make %
tomtom commented 13 years ago

Could you please send me a log as described above? I cannot reproduce this problem (vim 7.3.237, php 5.3.2, ubuntu 10.04).

tomtom commented 13 years ago

Thanks for the log. I still don't understand why the items are duplicated. If the problem persists after commit #c095466, could somebody please try to add this line to after/autoload/checksyntax.vim:

let g:checksyntax.php.listtype = 'qfl'

and check if the problem still persists. If it does, may I ask if you can reproduce the error with all plugins except checksyntax disabled and with the following minimal vimrc file:

set nocompatible
filetype plugin indent on
syntax on

Thanks.

fidian commented 12 years ago

Problem still persisted when I set PHP's listtype to qfl. Problem still persisted when I removed all other plugins and used the minimal .vimrc file.

It's from using "-d display_errors=1". The lint check (-l) always shows warnings, so maybe turning display_errors on duplicates the lines? I've committed to my forked repository and sent off a pull request to this one.

tomtom commented 12 years ago

This issue was fixed, wasn't it?

fidian commented 12 years ago

Actually, my "fix" didn't quite do it. You need to set -d display_errors=0 to override the setting if php.ini has set display_errors = On. Sorry for not testing it thoroughly.

Would you reopen this issue?