Conceal Bugs

25 views
Skip to first unread message

Benjamin Fritz

unread,
Jul 27, 2010, 7:51:05 AM7/27/10
to vim_dev
I brought these up initially in another thread but I'm posting a new
one so it doesn't get lost in the shuffle. And I said I'd try to
reproduce it from the latest update and without my .vimrc.

I'm running the latest version of Vim 7.3 on Windows XP, compiled
myself with MinGW from changeset acfb7eddf13c (Update TeX syntax
file).

Using the attached test.vim script, I start Vim with:

gvim -N -u NONE -i NONE test.vim -c "source %"

I see mostly what I would expect, but the line that matches the
"concealends" syntax rule is missing the listchars replacement for the
first concealed end. See conceal_bug_start.png.

Now, I press 'j' several times to move past all the comment lines, and
see the two wholly concealed lines disappear entirely from view,
without even the cchar replacement character. See conceal_bug_end.png.

Now, I can use :redraw! (with the '!') to restore Vim back to the
state I started with. Moving the cursor over the concealed lines
repeats the process.

Version output:

VIM - Vi IMproved 7.3c BETA (2010 Jul 25, compiled Jul 26 2010 23:06:56)
MS-Windows 32-bit GUI version
Compiled by Ben
Huge version with GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
+file_in_path +find_in_path +float +folding -footer +gettext/dyn -hangul_input
+iconv/dyn +insert_expand +jumplist +keymap +langmap +libcall +linebreak
+lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse
+mouseshape +multi_byte_ime/dyn +multi_lang -mzscheme +netbeans_intg -ole
-osfiletype +path_extra -perl +persistent_undo -postscript +printer +profile
-python -python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl -tgetent -termresponse +textobjects +title
+toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -xfontset -xim
-xterm_save -xpm_w32
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME\_vimrc"
2nd user vimrc file: "$VIM\_vimrc"
user exrc file: "$HOME\_exrc"
2nd user exrc file: "$VIM\_exrc"
system gvimrc file: "$VIM\gvimrc"
user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$VIM\_gvimrc"
system menu file: "$VIMRUNTIME\menu.vim"
Compilation: gcc -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400
-DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_GETTEXT -DHAVE_LOCALE_H
-DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_GUI_W32
-DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME
-DDYNAMIC_ICONV -pipe -w -march=i386 -Wall -O3 -fomit-frame-pointer
-freg-struct-return -s
Linking: gcc -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400
-DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_GETTEXT -DHAVE_LOCALE_H
-DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_GUI_W32
-DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME
-DDYNAMIC_ICONV -pipe -w -march=i386 -Wall -O3 -fomit-frame-pointer
-freg-struct-return -s -mwindows -o gvim.exe -lkernel32 -luser32
-lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lversion -lwsock32 -lole32
-luuid

conceal_bug_start.png
conceal_bug_end.png
test.vim

Vince Negri

unread,
Jul 27, 2010, 8:14:40 AM7/27/10
to vim...@googlegroups.com
From: Benjamin Fritz [mailto:fritzo...@gmail.com]

> I see mostly what I would expect, but the line that matches the
> "concealends" syntax rule is missing the listchars replacement for the
> first concealed end. See conceal_bug_start.png.

> Now, I press 'j' several times to move past all the comment lines, and
> see the two wholly concealed lines disappear entirely from view,
> without even the cchar replacement character. See conceal_bug_end.png.

Both of these are regressions - I just checked test.vim with my Vim 7.2 (including my
original conceal patch) and neither bug occurs.

The bug also doesn't occur in the 7.3 beta of 15th May.


Vince Negri

unread,
Jul 27, 2010, 9:37:31 AM7/27/10
to vim...@googlegroups.com
From: Benjamin Fritz [mailto:fritzo...@gmail.com]

> I see mostly what I would expect, but the line that matches the
> "concealends" syntax rule is missing the listchars replacement for the
> first concealed end. See conceal_bug_start.png.

> Now, I press 'j' several times to move past all the comment lines, and
> see the two wholly concealed lines disappear entirely from view,
> without even the cchar replacement character. See conceal_bug_end.png.

This bug crept in with changeset 2391 - "Give each syntax item a sequence number, so that we know when it starts and.."
rev 2390 is fine, 2391 is broken.

Maybe there is a place where "syntax_seqnr" needs to be incremented but isn't?


Vince

Vince Negri

unread,
Jul 27, 2010, 9:52:17 AM7/27/10
to vim...@googlegroups.com, Bram Moolenaar
From: Vince Negri

> This bug crept in with changeset 2391 -

> Maybe there is a place where "syntax_seqnr" needs to be incremented but isn't?

This patch (against 2391) appears to fix the broken concealends. Not the blank
lines in a region though.

diff -r 0371401d9d33 src/syntax.c
--- a/src/syntax.c Sat Jul 24 17:29:03 2010 +0200
+++ b/src/syntax.c Tue Jul 27 14:50:39 2010 +0100
@@ -2492,7 +2492,10 @@
#ifdef FEAT_CONCEAL
cur_si->si_flags |= save_flags;
if (cur_si->si_flags & HL_CONCEALENDS)
+ {
cur_si->si_flags |= HL_CONCEAL;
+ cur_si->si_seqnr = next_seqnr++;
+ }
#endif
cur_si->si_next_list = NULL;
check_keepend();


sc

unread,
Jul 27, 2010, 9:58:07 AM7/27/10
to vim...@googlegroups.com
On Tuesday 27 July 2010 08:37:31 Vince Negri wrote:

> This bug crept in with changeset 2391 - "Give each syntax item
> a sequence number, so that we know when it starts and.." rev
> 2390 is fine, 2391 is broken.

you cannot use that first number to communicate -- the "Give
each item a sequence number" changeset for me was 2432 -- that
number is different for everybody -- you must use the horking
and unambiguous 0371401d9d33

sorry to go off topic

sc

Vince Negri

unread,
Jul 27, 2010, 10:43:09 AM7/27/10
to vim...@googlegroups.com
From: sc [mailto:toot...@swbell.net]

> you cannot use that first number to communicate -- the "Give
> each item a sequence number" changeset for me was 2432 -- that
> number is different for everybody -- you must use the horking
> and unambiguous 0371401d9d33

> sorry to go off topic

No need to apologise - thanks for the correction (I am something of a Mercurial n00b.)

Back on topic - in order to fix the missing cchars in wholly concealed lines in a region,
we need to somehow increment the seqnr with each new line begun in the region. Any ideas
how to do this? It wasn't obvious as it was in the case of "concealends".

Bram Moolenaar

unread,
Jul 27, 2010, 2:48:30 PM7/27/10
to Vince Negri, vim...@googlegroups.com

Vince Negri wrote:

Would it be possible on the other end: decrement the expected sequence
number when going to the next line?

--
God made machine language; all the rest is the work of man.

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

Bram Moolenaar

unread,
Jul 27, 2010, 2:48:30 PM7/27/10
to Vince Negri, vim...@googlegroups.com

Vince Negri wrote:

Glad to hear from you again Vince. I've been making changes to the
conceal feature and had not received remarks from you yet. Especially
about the 'concealcursor' option. And also this issue with consecutive
matches of concealed items.

I found another place where HL_CONCEAL was set and the si_seqnr wasn't.
I'll push that right away.

--
The chat program is in public domain. This is not the GNU public license.
If it breaks then you get to keep both pieces.
-- Copyright notice for the chat program

Bram Moolenaar

unread,
Jul 28, 2010, 12:17:17 PM7/28/10
to Benjamin Fritz, vim_dev

Benjamin Fritz wrote:

> I brought these up initially in another thread but I'm posting a new
> one so it doesn't get lost in the shuffle. And I said I'd try to
> reproduce it from the latest update and without my .vimrc.
>
> I'm running the latest version of Vim 7.3 on Windows XP, compiled
> myself with MinGW from changeset acfb7eddf13c (Update TeX syntax
> file).
>
> Using the attached test.vim script, I start Vim with:
>
> gvim -N -u NONE -i NONE test.vim -c "source %"
>
> I see mostly what I would expect, but the line that matches the
> "concealends" syntax rule is missing the listchars replacement for the
> first concealed end. See conceal_bug_start.png.
>
> Now, I press 'j' several times to move past all the comment lines, and
> see the two wholly concealed lines disappear entirely from view,
> without even the cchar replacement character. See conceal_bug_end.png.
>
> Now, I can use :redraw! (with the '!') to restore Vim back to the
> state I started with. Moving the cursor over the concealed lines
> repeats the process.

I have fixed this now. Please check for any remaining problems.

--
If you don't get everything you want, think of
everything you didn't get and don't want.

Dimitar DIMITROV

unread,
Jul 29, 2010, 4:49:25 AM7/29/10
to vim...@googlegroups.com
Hi,

I've noticed that there is no mention in the help files that one can use things like:

1. :h i^x^k or even
    :h^x^k instead of
    :h i_CTRL-X_CTRL-K

2. [count] gqq will format count lines

Cheers

Dimitar DIMITROV

unread,
Jul 29, 2010, 7:19:55 AM7/29/10
to vim...@googlegroups.com
Hi,

On linux systems I can open Vim and type:

:e~/d<tab> which expands (for me) to :e~/dev/ and I can go on...

but on Windows:

:e~/d<tab> expands to :eD:\dev\ and therefore I can't go on with my completion
unless I start over again using :e ~/d<tab> (note the space)

The whole point is:

I need a space before trying to complete after ~
which I would like to avoid

Ben Fritz

unread,
Jul 29, 2010, 11:28:35 AM7/29/10
to vim_dev


On Jul 28, 11:17 am, Bram Moolenaar <B...@Moolenaar.net> wrote:
>
> I have fixed this now.  Please check for any remaining problems.
>

Confirmed, latest build fixes all the problems I saw in my test file.

Bram Moolenaar

unread,
Jul 29, 2010, 4:19:29 PM7/29/10
to Dimitar DIMITROV, vim...@googlegroups.com

Dimitar Dimitrov wrote:

> I've noticed that there is no mention in the help files that one can use things
> like:
>
> 1. :h i^x^k or even
> :h^x^k instead of
> :h i_CTRL-X_CTRL-K

I'll add something about that in helphelp.txt.

> 2. [count] gqq will format count lines

The count is not explicitly mentioned, this applies to more commands,
probably.

--
"The future's already arrived - it's just not evenly distributed yet."
-- William Gibson

Tony Mechelynck

unread,
Jul 30, 2010, 3:11:27 AM7/30/10
to vim...@googlegroups.com, Dimitar DIMITROV
> --
> 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

I didn't know about i^x, but I knew about :help :| and :help "x (and
similar) which will replace | by bar or " by quote. I don't know if it's
documented anywhere either.

i^x^k doesn't work, at least not if compiled with +digraphs (the Ctrl-K
waits for a digraph or special key).


Best regards,
Tony.
--
Men may not be seen publicly in any kind of strapless gown.
[real standing law in Florida, United States of America]

Dimitar DIMITROV

unread,
Jul 30, 2010, 4:56:45 AM7/30/10
to vim...@googlegroups.com
Dimitar Dimitrov wrote:

> On 29/07/10 10:49, Dimitar DIMITROV wrote:
> > Hi,
> >
> > I've noticed that there is no mention in the help files that one can use
> > things like:
> >
> > 1. :h i^x^k or even
> > :h^x^k instead of
> > :h i_CTRL-X_CTRL-K
> >
> > 2. [count] gqq will format count lines
> >
> > Cheers
> >
> > --
> > 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
>
> I didn't know about i^x, but I knew about :help :| and :help "x (and
> similar) which will replace | by bar or " by quote. I don't know if it's
> documented anywhere either.
>
> i^x^k doesn't work, at least not if compiled with +digraphs (the Ctrl-K
> waits for a digraph or special key).

You can type ^ then k. For ^x you can use the Ctrl modifier

> Best regards,
> Tony.

Reply all
Reply to author
Forward
0 new messages