Patch 9.0.0649

13 views
Skip to first unread message

Bram Moolenaar

unread,
Oct 3, 2022, 11:44:54 AM10/3/22
to vim...@googlegroups.com

Patch 9.0.0649
Problem: No indication when the first line is broken for 'smoothscroll'.
Solution: Show "<<<" in the first line.
Files: src/drawline.c, src/testdir/dumps/Test_smoothscroll_2.dump,
src/testdir/dumps/Test_smoothscroll_3.dump,
src/testdir/dumps/Test_smoothscroll_5.dump,
src/testdir/dumps/Test_smoothscroll_6.dump


*** ../vim-9.0.0648/src/drawline.c 2022-10-02 22:10:22.247640544 +0100
--- src/drawline.c 2022-10-03 16:29:01.825470366 +0100
***************
*** 740,745 ****
--- 740,771 ----
#endif

/*
+ * Call screen_line() using values from "wlv".
+ * Also takes care of putting "<<<" on the first line for 'smoothscroll'.
+ */
+ static void
+ wlv_screen_line(win_T *wp, winlinevars_T *wlv, int negative_width)
+ {
+ if (wlv->row == 0 && wp->w_skipcol > 0)
+ {
+ int off = (int)(current_ScreenLine - ScreenLines);
+
+ for (int i = 0; i < 3; ++i)
+ {
+ ScreenLines[off] = '<';
+ if (enc_utf8)
+ ScreenLinesUC[off] = 0;
+ ScreenAttrs[off] = HL_ATTR(HLF_AT);
+ ++off;
+ }
+ }
+
+ screen_line(wp, wlv->screen_row, wp->w_wincol, wlv->col,
+ negative_width ? -wp->w_width : wp->w_width,
+ wlv->screen_line_flags);
+ }
+
+ /*
* Called when finished with the line: draw the screen line and handle any
* highlighting until the right of the window.
*/
***************
*** 820,827 ****
}
#endif

! screen_line(wp, wlv->screen_row, wp->w_wincol, wlv->col,
! wp->w_width, wlv->screen_line_flags);
++wlv->row;
++wlv->screen_row;
}
--- 846,852 ----
}
#endif

! wlv_screen_line(wp, wlv, FALSE);
++wlv->row;
++wlv->screen_row;
}
***************
*** 1730,1737 ****
#endif
)
{
! screen_line(wp, wlv.screen_row, wp->w_wincol, wlv.col, -wp->w_width,
! wlv.screen_line_flags);
// Pretend we have finished updating the window. Except when
// 'cursorcolumn' is set.
#ifdef FEAT_SYN_HL
--- 1755,1761 ----
#endif
)
{
! wlv_screen_line(wp, &wlv, TRUE);
// Pretend we have finished updating the window. Except when
// 'cursorcolumn' is set.
#ifdef FEAT_SYN_HL
***************
*** 3670,3682 ****
)
{
#ifdef FEAT_CONCEAL
! screen_line(wp, wlv.screen_row, wp->w_wincol,
! wlv.col - wlv.boguscols,
! wp->w_width, wlv.screen_line_flags);
wlv.boguscols = 0;
#else
! screen_line(wp, wlv.screen_row, wp->w_wincol, wlv.col,
! wp->w_width, wlv.screen_line_flags);
#endif
++wlv.row;
++wlv.screen_row;
--- 3694,3705 ----
)
{
#ifdef FEAT_CONCEAL
! wlv.col += wlv.boguscols;
! wlv_screen_line(wp, &wlv, FALSE);
! wlv.col -= wlv.boguscols;
wlv.boguscols = 0;
#else
! screen_line(wp, &wlv, FALSE);
#endif
++wlv.row;
++wlv.screen_row;
*** ../vim-9.0.0648/src/testdir/dumps/Test_smoothscroll_2.dump 2022-10-02 21:29:18.416089542 +0100
--- src/testdir/dumps/Test_smoothscroll_2.dump 2022-10-03 16:40:22.214736780 +0100
***************
*** 1,4 ****
! |w+0&#ffffff0|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d|
|w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
|l|i|n|e| |t|h|r|e@1| @29
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d|
--- 1,4 ----
! |<+0#4040ff13#ffffff0@2|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d|
|w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
|l|i|n|e| |t|h|r|e@1| @29
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d|
*** ../vim-9.0.0648/src/testdir/dumps/Test_smoothscroll_3.dump 2022-10-02 21:29:18.416089542 +0100
--- src/testdir/dumps/Test_smoothscroll_3.dump 2022-10-03 16:40:18.306751067 +0100
***************
*** 1,4 ****
! |w+0&#ffffff0|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
|l|i|n|e| |t|h|r|e@1| @29
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d|
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| @10
--- 1,4 ----
! |<+0#4040ff13#ffffff0@2|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
|l|i|n|e| |t|h|r|e@1| @29
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d|
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| @10
*** ../vim-9.0.0648/src/testdir/dumps/Test_smoothscroll_5.dump 2022-10-02 21:29:18.416089542 +0100
--- src/testdir/dumps/Test_smoothscroll_5.dump 2022-10-03 16:40:19.574746425 +0100
***************
*** 1,4 ****
! |w+0&#ffffff0|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
|l|i|n|e| |t|h|r|e@1| @29
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d|
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| @10
--- 1,4 ----
! |<+0#4040ff13#ffffff0@2|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
|l|i|n|e| |t|h|r|e@1| @29
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d|
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| @10
*** ../vim-9.0.0648/src/testdir/dumps/Test_smoothscroll_6.dump 2022-10-02 21:29:18.416089542 +0100
--- src/testdir/dumps/Test_smoothscroll_6.dump 2022-10-03 16:40:20.726742215 +0100
***************
*** 1,4 ****
! |w+0&#ffffff0|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d|
|w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
|l|i|n|e| |t|h|r|e@1| @29
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d|
--- 1,4 ----
! |<+0#4040ff13#ffffff0@2|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d|
|w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
|l|i|n|e| |t|h|r|e@1| @29
|l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d|
*** ../vim-9.0.0648/src/version.c 2022-10-03 16:05:25.021469286 +0100
--- src/version.c 2022-10-03 16:36:22.291678076 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 649,
/**/

--
hundred-and-one symptoms of being an internet addict:
261. You find diskettes in your pockets when doing laundry.

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

Tony Mechelynck

unread,
Oct 3, 2022, 7:18:47 PM10/3/22
to vim...@googlegroups.com
On Mon, Oct 3, 2022 at 5:44 PM Bram Moolenaar <Br...@moolenaar.net> wrote:
>
>
> Patch 9.0.0649
> Problem: No indication when the first line is broken for 'smoothscroll'.
> Solution: Show "<<<" in the first line.
> Files: src/drawline.c, src/testdir/dumps/Test_smoothscroll_2.dump,
> src/testdir/dumps/Test_smoothscroll_3.dump,
> src/testdir/dumps/Test_smoothscroll_5.dump,
> src/testdir/dumps/Test_smoothscroll_6.dump

Shortly before this patch, if 'list' was on and 'listchars' contained
a "precedes:" entry, the corresponding character was displayed in the
first screen character cell if 'smoothscroll' was on and the first
visible file line began earlier. That was enough for me.

FYI, my vimrc (which sets 'encoding' to utf-8 and has ":scriptencoding
utf-8" near the top) includes the lines

if exists('+list')
set list
if exists('+listchars')
set lcs=eol:¶,tab:\|_,extends:>,precedes:<,conceal:*,nbsp:·
endif
endif

(it was already like this, because even with 'wrap' as a global
default, I may want to set 'nowrap' locally in one or more windows).

I wonder if I should revert this patch locally to go back to how
'smoothscroll' worked (together with 'list' and 'listchars') at
patchlevels 644 (or maybe 645) to 648, or if it would be possible to
make it depend on some option, let's say maybe add a "firstline" flag
to the 'display' option. But I want to think it over before going away
from "standard" Vim on my own in this manner.

Best regards,
Tony.

Bram Moolenaar

unread,
Oct 4, 2022, 8:17:58 AM10/4/22
to vim...@googlegroups.com, Tony Mechelynck

> On Mon, Oct 3, 2022 at 5:44 PM Bram Moolenaar <Br...@moolenaar.net> wrote:
> >
> >
> > Patch 9.0.0649
> > Problem: No indication when the first line is broken for 'smoothscroll=
> '.
> > Solution: Show "<<<" in the first line.
> > Files: src/drawline.c, src/testdir/dumps/Test_smoothscroll_2.dump,
> > src/testdir/dumps/Test_smoothscroll_3.dump,
> > src/testdir/dumps/Test_smoothscroll_5.dump,
> > src/testdir/dumps/Test_smoothscroll_6.dump
>
> Shortly before this patch, if 'list' was on and 'listchars' contained
> a "precedes:" entry, the corresponding character was displayed in the
> first screen character cell if 'smoothscroll' was on and the first
> visible file line began earlier. That was enough for me.
>
> FYI, my vimrc (which sets 'encoding' to utf-8 and has ":scriptencoding
> utf-8" near the top) includes the lines
>
> if exists('+list')
> set list
> if exists('+listchars')
> set lcs=3Deol:=C2=B6,tab:\|_,extends:>,precedes:<,conceal:*,nbsp:=C2=B7
> endif
> endif
>
> (it was already like this, because even with 'wrap' as a global
> default, I may want to set 'nowrap' locally in one or more windows).
>
> I wonder if I should revert this patch locally to go back to how
> 'smoothscroll' worked (together with 'list' and 'listchars') at
> patchlevels 644 (or maybe 645) to 648, or if it would be possible to
> make it depend on some option, let's say maybe add a "firstline" flag
> to the 'display' option. But I want to think it over before going away
> from "standard" Vim on my own in this manner.

I had to adjust quite a few tests for the "<<<" showing up, and in some
cases the previous situation seemed already indicating the missing text.
I'll go over it and see where we can drop showing the "<<<".

I do think that we should show "<<<" by default when 'smoothscroll' is
set. And then offer options to show something else.

--
hundred-and-one symptoms of being an internet addict:
269. You receive an e-mail from the wife of a deceased president, offering
to send you twenty million dollar, and you are not even surprised.
Reply all
Reply to author
Forward
0 new messages