Trailing whitespace left at end of comment lines that wrap in the PHP filetype

86 views
Skip to first unread message

Duncan de Wet

unread,
Sep 16, 2013, 3:15:23 AM9/16/13
to vim...@googlegroups.com
In the PHP filetype (and possibly others) trailing whitespace is left at the end of comment lines that are wrapped as a result of the textwidth setting.

The attached video demonstrates the problem, and how it is not evident in other filetypes such as C.

bugreport.txt
vim-problem.ogv

Nikolay Pavlov

unread,
Sep 16, 2013, 5:47:32 AM9/16/13
to vim...@googlegroups.com


On Sep 16, 2013 11:15 AM, "Duncan de Wet" <dunca...@gmail.com> wrote:
>
> In the PHP filetype (and possibly others) trailing whitespace is left at the end of comment lines that are wrapped as a result of the textwidth setting.

This is controlled by formatoptions settings, see :h fo-table. Set 'list' with 'listchars' containing 'trail:-' to make them easy to spot.

Note that it is not a vim issue. If you take this as a problem it is problem in your configuration.

And also please do not include 1.5 MiB files as attachements. To show a problem you should write a script that starts with omitting your user configuration (e.g. 'vim -u attached-vimrc' (that contains &rtp setting that omits non-standard plugins) or 'vim -u NONE').

> The attached video demonstrates the problem, and how it is not evident in other filetypes such as C.
>

> --
> --
> 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 vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Duncan de Wet

unread,
Sep 17, 2013, 12:24:59 AM9/17/13
to vim...@googlegroups.com
On Monday, 16 September 2013 21:47:32 UTC+12, ZyX wrote:
> On Sep 16, 2013 11:15 AM, "Duncan de Wet" <dunca...@gmail.com> wrote:
>
> >
>
> > In the PHP filetype (and possibly others) trailing whitespace is left at the end of comment lines that are wrapped as a result of the textwidth setting.
>
> This is controlled by formatoptions settings, see :h fo-table. Set 'list' with 'listchars' containing 'trail:-' to make them easy to spot.

I already have those options set, hence why I noticed the bug in the first place. I cannot find any options in :h fo-table relating to leaving whitespace at the end of lines when wrapping occurs; reasonably so as there is no reason you would want to anyway.

> Note that it is not a vim issue. If you take this as a problem it is problem in your configuration.

It seems like a vim issue to me as it occurs in the PHP filetype but not others, under identical configurations.

> And also please do not include 1.5 MiB files as attachements. To show a problem you should write a script that starts with omitting your user configuration (e.g. 'vim -u attached-vimrc' (that contains &rtp setting that omits non-standard plugins) or 'vim -u NONE').

OK sorry, just thought a video would demonstrate the problem well.

Adnan Zafar

unread,
Sep 17, 2013, 5:20:48 AM9/17/13
to vim...@googlegroups.com
On Tue, Sep 17, 2013 at 12:24 AM, Duncan de Wet <dunca...@gmail.com> wrote:
> On Monday, 16 September 2013 21:47:32 UTC+12, ZyX wrote:
>
> > This is controlled by formatoptions settings, see :h fo-table. Set 'list' with 'listchars' containing 'trail:-' to make them easy to spot.
>
> I already have those options set, hence why I noticed the bug in the first place. I cannot find any options in :h fo-table relating to leaving whitespace at the end of lines when wrapping occurs; reasonably so as there is no reason you would want to anyway.

Specifically the w flag causes this behavior. It makes Vim leave
trailing whitespace alone, which allows the user to have some
flexibility when it comes to formatting and Vim's rigid notions of
what a paragraph is.

> > Note that it is not a vim issue. If you take this as a problem it is problem in your configuration.
>
> It seems like a vim issue to me as it occurs in the PHP filetype but not others, under identical configurations.

Editing a PHP file and checking from where and to what formatoptions
is set with `:verbose set fo?`, I see that w is indeed included, and
it's set from indent/php.vim. So it would appear that you should
contact the maintainer of that file.


--Adnan Zafar

Duncan de Wet

unread,
Sep 17, 2013, 3:56:55 PM9/17/13
to vim...@googlegroups.com

Is this not the right place to contact the maintainer of that file?

| Duncan de Wet

Duncan de Wet

unread,
Sep 17, 2013, 8:33:34 PM9/17/13
to vim...@googlegroups.com
Never mind, I have found the Github page for that filetype so have done a pull
request there.

<https://github.com/2072/PHP-Indenting-for-VIm/pull/20>

David Fishburn

unread,
Sep 18, 2013, 9:23:29 AM9/18/13
to vim_dev



On Tue, Sep 17, 2013 at 8:33 PM, Duncan de Wet <dunca...@gmail.com> wrote:
...
 
>
> Is this not the right place to contact the maintainer of that file?
>
> | Duncan de Wet

Never mind, I have found the Github page for that filetype so have done a pull
request there.

Typically the Vim files have contact information at the top of them.
That is the way the maintainer should be contacted, not everyone subscribes to vim_use or vim_dev.

I have seen my plugins on github and I have no idea how they get there.
So, if you did a "pull request" on github for any of my plugins, that would certainly not make it to me.

HTH,
David

Peter Aronoff

unread,
Sep 18, 2013, 10:17:34 AM9/18/13
to vim...@googlegroups.com
On Wed Sep 09/18/13 at 9:23, David Fishburn wrote:
> Typically the Vim files have contact information at the top of them.
> That is the way the maintainer should be contacted, not everyone
> subscribes to vim_use or vim_dev.

I have a question about process.

I wrote this list with a patch for Vim's shell indentation and got no
response. I then realized that it was better to contact the maintainer, and
I did so. I haven't heard anything there either.

I understand that this is not especially high-priority (and the patch may
be rejected for lots of reasons), but is there any procedure for what to do
when a maintainer doesn't respond at all?


Thanks, Peter
--
We have not been faced with the need to satisfy someone else's
requirements, and for this freedom we are grateful.
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System

Nikolay Pavlov

unread,
Sep 18, 2013, 3:10:32 PM9/18/13
to vim...@googlegroups.com

There is a mirror for all scripts on github. It is populated automatically from www.vim.org contents.

> HTH,
> David

Duncan de Wet

unread,
Sep 18, 2013, 3:13:43 PM9/18/13
to vim...@googlegroups.com
(Sorry for the previous empty email, I'm still trying to figure out mutt.

In this case the github URL I did find from the file, so I know it was the file
maintainer's repository.

He did accept my pull request so the fix to this bug will get to vim soon I
guess.

>
> HTH,
> David
>
> --
> --
> 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 a topic in the Google Groups "vim_dev" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/Q_KGrMevqW0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages