If I delete the header line of some folded text (folding done with my own
lexer), I get into a mess! The text below (view in fixed pitch font, like
Courier) shows what I see - it is symbolic, not real code.
Initial state (please excuse the crude attempt at showing the folding
bracket):
a
- if () then
| something
\ endif
b
Fold:
a
+ if () then
b
If I select all the line with the fold mark (+) and delete it I get:
a
b
The clipboard only holds "if() then <CR><LF>". The 2 hidden lines are still
in the document, but they have not been made visible. The
ContractionState::DeleteLines() code just moves the visible, expanded and
height properties, it does not notice that a visible header for invisible
lines has been deleted.
However, if I do the same in Scite, the invisible lines become visible when
a header is deleted. That is if I do the same in Scite with:
a
- if (){
something
}
b
This does not happen as the invisible lines do become visible again. A quick
look at Scite suggests that cutting is done by sending SCI_CUT to Scintilla,
and there is nothing special done by Scite.
I am assuming that the problem lies in my lexer, but I fail to see what I
can have done wrong as the level flags set in the styler look reasonable:
Before After delete old line 1
line 0, 1024, 1024
line 1, 9216, 1024
line 2, 1025, 1024
line 3, 1024, 1024
line 4, 1024
Can someone give me a clue as to where the magic happens that causes the
contraction state list to be checked against the level flags (to stop
orphaning invisible lines) so I can figure out where I have screwed up?
Greg Smith
p.s. One of my uses pointed out that when they selected the header of a
folded section and hit Cut, they expected to cut the entire folded section,
not just the header (let alone having the problem described above).
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest