Patch for fixing an issue with hitest.vim

33 views
Skip to first unread message

Lifepillar

unread,
Jun 3, 2019, 4:22:11 AM6/3/19
to vim...@googlegroups.com
Hi,
I have tried to contact the author of hitest.vim a few days ago, but didn’t get any answer yet. Anyway, hopefully it’s on this list, too.

I get E348 with runtime syntax/hitest.vim when whichwrap is set to a value different from the default. To reproduce:

1. create vimrc-hitest with the following content:

set whichwrap=b,~,<,>,[,],h,l
hi StatusLine guifg=#64878f guibg=#ffffff guisp=NONE gui=reverse cterm=reverse
hi! link StatusLineTerm StatusLine

2. vim -N -i NONE -u vimrc-hitest

3. runtime syntax/hitest.vim

The proposed patch fixes it for me. It also adds ‘silent' to the highlight command to avoid flashing the screen.

Life.

hitest-whichwrap.diff

Bram Moolenaar

unread,
Jun 4, 2019, 1:10:11 PM6/4/19
to vim...@googlegroups.com, Ronald Schild
Thanks. I still see a flash, caused by this line:

global /links to/ normal mz3ElD0#$p'zdd

Appears for a "links to Something" when "Something" is not defined.
I'll add a silent! here, but it's not really the right solution.

It's also quite slow, there should be a way to make it much faster.

It also leaves some names at the end, which can be fixed with:
g/ cleared$/d

--
% cat /usr/include/life.h
void life(void);

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

Lifepillar

unread,
Jun 5, 2019, 10:47:20 AM6/5/19
to vim...@googlegroups.com, Ronald Schild
On 4 Jun 2019, at 19:10, Bram Moolenaar <Br...@moolenaar.net> wrote:
>
>
>> I have tried to contact the author of hitest.vim a few days ago, but didn’t get any answer yet. Anyway, hopefully it’s on this list, too.
>>
>> I get E348 with runtime syntax/hitest.vim when whichwrap is set to a value different from the default. To reproduce:
>>
>> 1. create vimrc-hitest with the following content:
>>
>> set whichwrap=b,~,<,>,[,],h,l
>> hi StatusLine guifg=#64878f guibg=#ffffff guisp=NONE gui=reverse cterm=reverse
>> hi! link StatusLineTerm StatusLine
>>
>> 2. vim -N -i NONE -u vimrc-hitest
>>
>> 3. runtime syntax/hitest.vim
>>
>> The proposed patch fixes it for me. It also adds ‘silent' to the highlight command to avoid flashing the screen.
>
> Thanks. I still see a flash, caused by this line:
>
> global /links to/ normal mz3ElD0#$p'zdd
>
> Appears for a "links to Something" when "Something" is not defined.
> I'll add a silent! here, but it's not really the right solution.

I do not see that. Perhaps, I have not encountered such cases.

> It's also quite slow, there should be a way to make it much faster.

From a user point of view, I do not perceive it as too slow, although it may be compared to what it does.

> It also leaves some names at the end, which can be fixed with:
> g/ cleared$/d

The enclosed patch adds the changes you mention.

> --
> % cat /usr/include/life.h
> void life(void);


Noo! Maybe, long life(double fun);

Is your signature generator really random?

Life.

hitest-whichwrap.diff

Lifepillar

unread,
Jun 5, 2019, 10:56:47 AM6/5/19
to vim...@googlegroups.com, Ronald Schild
On 5 Jun 2019, at 16:47, 'Lifepillar' via vim_dev <vim...@googlegroups.com> wrote:

The enclosed patch adds the changes you mention.

The attached patch uses silent! also on the added command.

About the slowness: I have made some more tests and when there are many highlight groups (e.g. those loaded by Vim filetype), the script takes about three seconds on my machine.

Life.

hitest-whichwrap.diff

Scutum

unread,
Jun 6, 2019, 4:04:03 AM6/6/19
to vim_dev
On 5 Jun 2019, at 16:56, 'Lifepillar' wrote:
>
> The enclosed patch adds the changes you mention.
>
> The attached patch uses silent! also on the added command.
>
> About the slowness: I have made some more tests and when there are many highlight groups (e.g. those loaded by Vim filetype), the script takes about three seconds on my machine.
>
> Life.

Thank you, Lifepillar, for fixing this.
I could not reproduce the problem as you wrote. This is probably because I'm still working with Vim 8.0. I did not find time yet to try 8.1. Maybe in the next weeks. Then I'll also have a look at the slowness issue.

Regards
Scutum

Bram Moolenaar

unread,
Jun 6, 2019, 6:23:04 AM6/6/19
to vim...@googlegroups.com, Ronald Schild
Thanks.

> > --
> > % cat /usr/include/life.h
> > void life(void);
>
>
> Noo! Maybe, long life(double fun);
>
> Is your signature generator really random?

It's rotating, thus what fortune ends up where is a matter of luck.
I like your response, I'll add it to the list.

--
From "know your smileys":
:-| :-| Deja' vu!

Lifepillar

unread,
Jun 8, 2019, 4:36:33 AM6/8/19
to vim...@googlegroups.com
On 6 Jun 2019, at 10:04, Scutum <vim...@scutum.de> wrote:
>
> On 5 Jun 2019, at 16:56, 'Lifepillar' wrote:
>>
>> The enclosed patch adds the changes you mention.
>>
>> The attached patch uses silent! also on the added command.
>>
>> About the slowness: I have made some more tests and when there are many highlight groups (e.g. those loaded by Vim filetype), the script takes about three seconds on my machine.
>>
>> Life.
>
> Thank you, Lifepillar, for fixing this.
> I could not reproduce the problem as you wrote. This is probably because I'm still working with Vim 8.0. I did not find time yet to try 8.1.

For the specific example I have shown, a git bisect points at commit 595a40226 (v8.0.1050) as the first commit having this issue. Before that commit, `hi StatusLineTerm` prints only one line:

StatusLineTerm xxx links to StatusLine

but, starting from that commit, it prints two lines:

StatusLineTerm xxx term=bold,reverse cterm=bold ctermfg=15 ctermbg=2 gui=bold guifg=bg guibg=DarkGreen
links to StatusLine

> Maybe in the next weeks. Then I'll also have a look at the slowness issue.

This line seems to be the culprit:

global /^/ exe "normal Wi\<CR>\t\eAA\ex”

Hope this helps,
Life.

Reply all
Reply to author
Forward
0 new messages