Patch 8.2.1654

15 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 10, 2020, 3:27:04 PM9/10/20
to vim...@googlegroups.com

Patch 8.2.1654
Problem: When job writes to hidden buffer current window has display
errors. (Johnny McArthur)
Solution: Use aucmd_prepbuf() instead of switch_to_win_for_buf().
(closes #6925)
Files: src/channel.c


diff --git a/src/if_perl.xs b/src/if_perl.xs
index cad571c5c7b..e54a79d2b30 100644
--- a/src/if_perl.xs
+++ b/src/if_perl.xs
@@ -241,6 +241,9 @@ typedef int perl_key;
# else
# define Perl_sv_2pv dll_Perl_sv_2pv
# endif
+# if (PERL_REVISION == 5) && (PERL_VERSION >= 32)
+# define Perl_sv_2pvbyte_flags dll_Perl_sv_2pvbyte_flags
+# endif
# define Perl_sv_2pvbyte dll_Perl_sv_2pvbyte
# define Perl_sv_bless dll_Perl_sv_bless
# if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
@@ -397,6 +400,9 @@ static char* (*Perl_sv_2pv_nolen)(pTHX_ SV*);
static char* (*Perl_sv_2pv)(pTHX_ SV*, STRLEN*);
# endif
static char* (*Perl_sv_2pvbyte)(pTHX_ SV*, STRLEN*);
+# if (PERL_REVISION == 5) && (PERL_VERSION >= 32)
+static char* (*Perl_sv_2pvbyte_flags)(pTHX_ SV*, STRLEN*, I32);
+# endif
static SV* (*Perl_sv_bless)(pTHX_ SV*, HV*);
# if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
static void (*Perl_sv_catpvn_flags)(pTHX_ SV* , const char*, STRLEN, I32);
@@ -553,6 +559,9 @@ static struct {
{"Perl_sv_2pv", (PERL_PROC*)&Perl_sv_2pv},
# endif
{"Perl_sv_2pvbyte", (PERL_PROC*)&Perl_sv_2pvbyte},
+# if (PERL_REVISION == 5) && (PERL_VERSION >= 32)
+ {"Perl_sv_2pvbyte_flags", (PERL_PROC*)&Perl_sv_2pvbyte_flags},
+# endif
# ifdef PERL589_OR_LATER
{"Perl_sv_2iv_flags", (PERL_PROC*)&Perl_sv_2iv_flags},
{"Perl_newXS_flags", (PERL_PROC*)&Perl_newXS_flags},

--
Shaw's Principle: Build a system that even a fool can use, and
only a fool will want to use it.

/// 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 ///

Christian Brabandt

unread,
Sep 11, 2020, 2:53:49 AM9/11/20
to vim...@googlegroups.com

On Do, 10 Sep 2020, Bram Moolenaar wrote:

> Patch 8.2.1654
> Problem: When job writes to hidden buffer current window has display
> errors. (Johnny McArthur)
> Solution: Use aucmd_prepbuf() instead of switch_to_win_for_buf().
> (closes #6925)
> Files: src/channel.c
>
>
> diff --git a/src/if_perl.xs b/src/if_perl.xs

The patch number and patch description and actual patch do not agree.
The patch looks more like 8.2.1655

Best,
Christian
--
Jedes Tun in der Ehe und Gesellschaft wird stärker, wenn man den
andern nicht darauf hinweist und ihm die eigne Reflex(ion) darauf
verrät; eigne Handlungen soll man so wenig erklären als eigne Bonmots.
-- Jean Paul

Bram Moolenaar

unread,
Sep 11, 2020, 6:39:52 AM9/11/20
to vim...@googlegroups.com, Christian Brabandt

Christian wrote:

> On Do, 10 Sep 2020, Bram Moolenaar wrote:
>
> > Patch 8.2.1654
> > Problem: When job writes to hidden buffer current window has display
> > errors. (Johnny McArthur)
> > Solution: Use aucmd_prepbuf() instead of switch_to_win_for_buf().
> > (closes #6925)
> > Files: src/channel.c
> >
> >
> > diff --git a/src/if_perl.xs b/src/if_perl.xs
>
> The patch number and patch description and actual patch do not agree.
> The patch looks more like 8.2.1655

Right, the wrong diff was included. This is the right one:


*** /tmp/MsQ5IX_channel.c 2020-09-11 11:21:56.706842811 +0200
--- /tmp/6A36FX_channel.c 2020-09-11 11:21:56.706842811 +0200
***************
*** 2619,2627 ****
static void
append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
{
! bufref_T save_curbuf = {NULL, 0, 0};
! win_T *save_curwin = NULL;
! tabpage_T *save_curtab = NULL;
linenr_T lnum = buffer->b_ml.ml_line_count;
int save_write_to = buffer->b_write_to_channel;
chanpart_T *ch_part = &channel->ch_part[part];
--- 2619,2625 ----
static void
append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
{
! aco_save_T aco;
linenr_T lnum = buffer->b_ml.ml_line_count;
int save_write_to = buffer->b_write_to_channel;
chanpart_T *ch_part = &channel->ch_part[part];
***************
*** 2647,2658 ****
}

// Append to the buffer
! ch_log(channel, "appending line %d to buffer", (int)lnum + 1 - empty);

buffer->b_p_ma = TRUE;

! // Save curbuf/curwin/curtab and make "buffer" the current buffer.
! switch_to_win_for_buf(buffer, &save_curwin, &save_curtab, &save_curbuf);

u_sync(TRUE);
// ignore undo failure, undo is not very useful here
--- 2645,2657 ----
}

// Append to the buffer
! ch_log(channel, "appending line %d to buffer %s",
! (int)lnum + 1 - empty, buffer->b_fname);

buffer->b_p_ma = TRUE;

! // set curbuf to be our buf, temporarily
! aucmd_prepbuf(&aco, buffer);

u_sync(TRUE);
// ignore undo failure, undo is not very useful here
***************
*** 2668,2675 ****
ml_append(lnum, msg, 0, FALSE);
appended_lines_mark(lnum, 1L);

! // Restore curbuf/curwin/curtab
! restore_win_for_buf(save_curwin, save_curtab, &save_curbuf);

if (ch_part->ch_nomodifiable)
buffer->b_p_ma = FALSE;
--- 2667,2674 ----
ml_append(lnum, msg, 0, FALSE);
appended_lines_mark(lnum, 1L);

! // reset notion of buffer
! aucmd_restbuf(&aco);

if (ch_part->ch_nomodifiable)
buffer->b_p_ma = FALSE;
***************
*** 2693,2701 ****
// down. If the topline is outdated update it now.
if (move_cursor || wp->w_topline > buffer->b_ml.ml_line_count)
{
if (move_cursor)
++wp->w_cursor.lnum;
- save_curwin = curwin;
curwin = wp;
curbuf = curwin->w_buffer;
scroll_cursor_bot(0, FALSE);
--- 2692,2701 ----
// down. If the topline is outdated update it now.
if (move_cursor || wp->w_topline > buffer->b_ml.ml_line_count)
{
+ win_T *save_curwin = curwin;
+
if (move_cursor)
++wp->w_cursor.lnum;
curwin = wp;
curbuf = curwin->w_buffer;
scroll_cursor_bot(0, FALSE);
*** /tmp/gyPxoY_version.c 2020-09-11 11:21:56.710842800 +0200
--- /tmp/CJjzlY_version.c 2020-09-11 11:21:56.714842792 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1654,
/**/
Reply all
Reply to author
Forward
0 new messages