Patch 7.4.592

121 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 27, 2015, 5:26:47 AM1/27/15
to vim...@googlegroups.com

Patch 7.4.592
Problem: When doing ":e foobar" when already editing "foobar" and 'buftype'
is "nofile" the buffer is cleared. (Xavier de Gaye)
Solution: Do no clear the buffer.
Files: src/ex_cmds.c


*** ../vim-7.4.591/src/ex_cmds.c 2014-12-13 03:17:07.461046575 +0100
--- src/ex_cmds.c 2015-01-27 11:21:14.752434647 +0100
***************
*** 3529,3534 ****
--- 3529,3541 ----
#endif
check_fname() == FAIL)
goto theend;
+
+ /* ":e foobar" when already editing "foobar" will reload the file.
+ * But when 'buftype' is "nofile" there is no file to load, so don't
+ * do anything. */
+ if (curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f')
+ goto theend;
+
oldbuf = (flags & ECMD_OLDBUF);
}

*** ../vim-7.4.591/src/version.c 2015-01-22 22:41:51.864583029 +0100
--- src/version.c 2015-01-27 11:24:32.466265106 +0100
***************
*** 743,744 ****
--- 743,746 ----
{ /* Add new patch number below this line */
+ /**/
+ 592,
/**/

--
hundred-and-one symptoms of being an internet addict:
120. You ask a friend, "What's that big shiny thing?" He says, "It's the sun."

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Xavier de Gaye

unread,
Jan 27, 2015, 6:52:29 AM1/27/15
to vim...@googlegroups.com
That works great, thanks.

Xavier

Ike Devolder

unread,
Jan 27, 2015, 7:23:53 AM1/27/15
to vim...@googlegroups.com
> --
> --
> 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/d/optout.

Tiny build fails after this patch.


gcc -c -I. -Iproto -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -o objects/ex_cmds.o ex_cmds.c^M
gcc -c -I. -Iproto -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -o objects/ex_cmds2.o ex_cmds2.c^M
ex_cmds.c: In function 'do_ecmd':^M ex_cmds.c:3536:12: error: 'buf_T' has no member named 'b_p_bt'^M
if (curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f')^M
^^M
ex_cmds.c:3536:40: error: 'buf_T' has no member named 'b_p_bt'^M
if (curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f')^M
^^M
gcc -c -I. -Iproto -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -o objects/ex_docmd.o ex_docmd.c^M
Makefile:2551: recipe for target 'objects/ex_cmds.o' failed^M
make[1]: *** [objects/ex_cmds.o] Error 1^M

--
Ike

Bram Moolenaar

unread,
Jan 27, 2015, 7:33:44 AM1/27/15
to Ike Devolder, vim...@googlegroups.com
> Tiny build fails after this patch.
>
>
> gcc -c -I. -Iproto -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -o objects/ex_cmds.o ex_cmds.c^M
> gcc -c -I. -Iproto -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -o objects/ex_cmds2.o ex_cmds2.c^M
> ex_cmds.c: In function 'do_ecmd':^M ex_cmds.c:3536:12: error: 'buf_T' has no member named 'b_p_bt'^M
> if (curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f')^M
> ^^M
> ex_cmds.c:3536:40: error: 'buf_T' has no member named 'b_p_bt'^M
> if (curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f')^M
> ^^M
> gcc -c -I. -Iproto -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -o objects/ex_docmd.o ex_docmd.c^M
> Makefile:2551: recipe for target 'objects/ex_cmds.o' failed^M
> make[1]: *** [objects/ex_cmds.o] Error 1^M

Sorry about that, I'll make a fix.

--
I have a watch cat! Just break in and she'll watch.

lilydjwg

unread,
Feb 11, 2015, 2:51:51 AM2/11/15
to vim...@googlegroups.com
On Tue, Jan 27, 2015 at 11:26:39AM +0100, Bram Moolenaar wrote:
>
> Patch 7.4.592
> Problem: When doing ":e foobar" when already editing "foobar" and 'buftype'
> is "nofile" the buffer is cleared. (Xavier de Gaye)
> Solution: Do no clear the buffer.
> Files: src/ex_cmds.c

This patch breaks netrw scp:// handling for me. I've tried several
versions of vim (git bisect actually, then run src/vim without
installing) with the same runtime and configuration files. Before
this patch, "vim scp://host/file" works, but after this patch, vim is
editing an empty buffer.
Best regards,
lilydjwg

Bram Moolenaar

unread,
Feb 11, 2015, 4:19:34 PM2/11/15
to lilydjwg, vim...@googlegroups.com

Lilydjwg wrote:

> On Tue, Jan 27, 2015 at 11:26:39AM +0100, Bram Moolenaar wrote:
> >
> > Patch 7.4.592
> > Problem: When doing ":e foobar" when already editing "foobar" and 'buftype'
> > is "nofile" the buffer is cleared. (Xavier de Gaye)
> > Solution: Do no clear the buffer.
> > Files: src/ex_cmds.c
>
> This patch breaks netrw scp:// handling for me. I've tried several
> versions of vim (git bisect actually, then run src/vim without
> installing) with the same runtime and configuration files. Before
> this patch, "vim scp://host/file" works, but after this patch, vim is
> editing an empty buffer.

Charles is aware of the problem but didn't have time yet to look into
the reason.

I'm starting to think that it's better to roll back this change.
It was applied mainly for consistency. Not breaking plugins is more
important.

--
Don't be humble ... you're not that great.
-- Golda Meir

Ingo Karkat

unread,
Feb 12, 2015, 2:50:15 AM2/12/15
to vim...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11-Feb-2015 22:19, Bram Moolenaar wrote:
>
> Lilydjwg wrote:
>
>> On Tue, Jan 27, 2015 at 11:26:39AM +0100, Bram Moolenaar wrote:
>>>
>>> Patch 7.4.592 Problem: When doing ":e foobar" when already
>>> editing "foobar" and 'buftype' is "nofile" the buffer is
>>> cleared. (Xavier de Gaye) Solution: Do no clear the buffer.
>>> Files: src/ex_cmds.c
>>
>> This patch breaks netrw scp:// handling for me. I've tried
>> several versions of vim (git bisect actually, then run src/vim
>> without installing) with the same runtime and configuration
>> files. Before this patch, "vim scp://host/file" works, but after
>> this patch, vim is editing an empty buffer.
>
> Charles is aware of the problem but didn't have time yet to look
> into the reason.
>
> I'm starting to think that it's better to roll back this change. It
> was applied mainly for consistency. Not breaking plugins is more
> important.


Let's wait until Charles has analyzed the problem. If the resolution
is simple, and netrw is the only known trouble spot, we can just as
well keep it. Consistency is an important good!

- -- regards, ingo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)

iQEcBAEBAgAGBQJU3FssAAoJEA7ziXlAzQ/vZK8H/inSR5qIXtVdC+mSaMjn8727
eYnAo93k+nr83JWgzExwS9Z0SnGvJS6J66hD/MvAsRgsgMJh1hTOP9g26rxDKxLZ
506frWugd0Rs/+PVH3tSTbdglktB6VAe0CD9tA7xv8Lsny7KAetaqsXQ0+9tNVYS
vNdJhZuhvx5i+62jf/7XDDorXEs9k+7z36cIrCcKc87sP/KTdry/yIUs52WQDuCS
Or7nvKQzawE+N0Qldgw+33bi/s6n0TTytL5FkQE+fD5y9KEYG/TtVJdWwbxGAr/+
nLtSIMPcb6LV66y08rGwZq+djcNIq95ofYX8yZcEeqpQa0umsHFqpqdX3MVSt/g=
=Lw/+
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages