I'm using version 3.4.1, the ScintillaEditBase component, compiled with Qt 5.3.
I took the Haven sample project (http://www.scintilla.org/Haven.zip) and modified it to use the Python lexer SCLEX_PYTHON. I commented out the line allowing user access to virtual space. I added the necessary code to catch the notification of the folding.
if (pscn->nmhdr.code == SCN_MARGINCLICK && pscn->margin == 2)
const int position = pscn->position;
const int line_number = Call(SCI_LINEFROMPOSITION, position, 0);
Call(SCI_TOGGLEFOLD, line_number, 0);
I created a short python script:
for x in range(0, 3):
print "We're on time %d" % (x)
print "something else"
FOLD the "for" line and select the folded line entirely. (Attached screenshot 1).
Now delete the line by using backspace/delete/typing any key.
The result (attached screenshot 2) is that the line above gets the folded marker (-).
Now, if you click on that marker TWICE, you'll get the folded text back on the screen as if it was never deleted. (attached screenshot 3).
Log in to post a comment.