[vim] Missing comma before `but` in assert messages (#626)

37 views
Skip to first unread message

Nikolai Aleksandrovich Pavlov

unread,
Feb 6, 2016, 11:03:39 AM2/6/16
to vim/vim

Consider the following script:

LANG=C vim -u NONE -i NONE -N --cmd 'call assert_false(v:true)' --cmd 'call assert_true(v:false)' --cmd 'echo v:errors' --cmd qa

this will echo

['pre-vimrc command line: Expected False but got v:true', 'pre-vimrc command line: Expected True but got v:false']

which is missing commas before but.


Reply to this email directly or view it on GitHub.

Gary Johnson

unread,
Feb 7, 2016, 4:20:30 PM2/7/16
to vim...@googlegroups.com
On 2016-02-06, Nikolai Aleksandrovich Pavlov wrote:
> Consider the following script:
>
> LANG=C vim -u NONE -i NONE -N --cmd 'call assert_false(v:true)' --cmd 'call assert_true(v:false)' --cmd 'echo v:errors' --cmd qa
>
> this will echo
>
> ['pre-vimrc command line: Expected False but got v:true', 'pre-vimrc command line: Expected True but got v:false']
>
> which is missing commas before but.

No commas are needed there nor should they be there. The two
clauses separated by the but are not independent. See for example,

http://www.grammarly.com/handbook/punctuation/comma/23/comma-before-but/

Regards,
Gary

Nikolai Aleksandrovich Pavlov

unread,
Feb 7, 2016, 4:48:13 PM2/7/16
to vim/vim

No commas are needed there nor should they be there. The two
clauses separated by the but are not independent. See for example,

http://www.grammarly.com/handbook/punctuation/comma/23/comma-before-but/

They are independent: “Expected False” is a separate subsentense then “got v:true”, nothing will change even if you swap them: “Got v:true, but expected False”.

Gary Johnson

unread,
Feb 7, 2016, 7:26:49 PM2/7/16
to vim...@googlegroups.com
On 2016-02-07, Nikolai Aleksandrovich Pavlov wrote:
> No commas are needed there nor should they be there. The two
> clauses separated by the but are not independent. See for example,
>
> http://www.grammarly.com/handbook/punctuation/comma/23/comma-before-but/
>
> They are independent: “Expected False” is a separate subsentense then “got
> v:true”, nothing will change even if you swap them: “Got v:true, but expected
> False”.

It's a little unclear to me which rule applies since neither clause
has a subject. If each had a subject, they would be independent and
would require a comma, e.g.,

I expected False, but I got v:true>

If there was only one subject at the beginning of the sentence, then
the clauses would not be independent and would not require a comma.

I expected False but got v:true.

I assumed the two clauses in question to be like the second case.
There is also a common convention that applies here, and that is
that the comma is often omitted when joining two short clauses.

Regards,
Gary

Christian Brabandt

unread,
Jun 28, 2016, 4:31:03 PM6/28/16
to vim/vim

If I read grammar rules correctly one would need a subject in the subsentence to be truly independent, but I don't hink we should discuss english grammar here. Closing for now, as both versions seems to be widely used.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Christian Brabandt

unread,
Jun 28, 2016, 4:31:11 PM6/28/16
to vim/vim

Closed #626.

Reply all
Reply to author
Forward
0 new messages