SCI_DELEOL and SCI_DELBOL

14 views
Skip to first unread message

seasoned_geek

unread,
Aug 16, 2021, 10:15:09 AM8/16/21
to scintilla-interest
All,
I'm up to Example3 for the CopperSpice port/fork/experiment where I was adding EDT Keypad navigation. Don't judge. EDT and its younger brother LSE is still a favorite among many gray hairs.

edt-keypad-and-help.png

It was late and I was tired last night, but I didn't see anything along the lines of SCI_DELEOL (Delete to End of Line without removing the newline)
or SCI_DELBOL (Delete to Beginning of Line without removing preceeding End of Line marker)
The DEL L of EDT is rather misleading for the uninitiated. That is Delete through End of Line from wherever the cursor is. I know some of the other Scintilla based editors implement DELEOL and DELBOL (usually just one function that is direction sensitive) so I thought I would ask if I'm just blind? Seems like it should exist and be in the doc.

I guess I can read the Notepadd++ code base and see what was done there. I know it had/has something similar.

Thanks in advance.

seasoned_geek

unread,
Aug 16, 2021, 4:11:50 PM8/16/21
to scintilla-interest
Yeah, I'm kinda-sorta-blind.

    void delLineLeft();
    void delLineRight();

That will get me most of the way there. We just use different terminology.

Neil Hodgson

unread,
Aug 16, 2021, 5:41:21 PM8/16/21
to Scintilla mailing list
seasoned_geek:

> It was late and I was tired last night, but I didn't see anything along the lines of SCI_DELEOL (Delete to End of Line without removing the newline)
> or SCI_DELBOL (Delete to Beginning of Line without removing preceeding End of Line marker)

SCI_DELLINELEFT SCI_DELLINERIGHT

Neil

seasoned_geek

unread,
Aug 28, 2021, 7:22:23 AM8/28/21
to scintilla-interest
Thanks.

Is there access to the contents of the undo buffer/list? The DEL functions seem to write to an undo buffer that I cannot find a way to read the contents of. Under EDT, DELWORD, DELLINE, DELCHAR, and CUT each had their own paste buffer.

Thanks again

Mitchell

unread,
Aug 28, 2021, 10:42:12 AM8/28/21
to scintilla...@googlegroups.com
Hi,

On Sat, 28 Aug 2021 04:22:22 -0700 (PDT)
"'seasoned_geek' via scintilla-interest" <scintilla...@googlegroups.com> wrote:

> Thanks.
>
> Is there access to the contents of the undo buffer/list? The DEL functions
> seem to write to an undo buffer that I cannot find a way to read the
> contents of. Under EDT, DELWORD, DELLINE, DELCHAR, and CUT each had their
> own paste buffer.

No, the undo buffer/list is opaque. I think the best you can do is subscribe to SCN_MODIFIED events and listen for SC_MOD_INSERTTEXT and SC_MOD_DELETETEXT events to detect document changes.

Cheers,
Mitchell

seasoned_geek

unread,
Aug 28, 2021, 11:34:01 AM8/28/21
to scintilla-interest
Thanks man. I was hoping to avoid re-inventing the wheel.

I was re-inventing the wheel with the delete line stuff before I asked here. You pointed me in a good direction

SC_MOD_BEFOREDELETE
   0x800 Text is about to be deleted from the document.     position, length

I just have to decide if I'm going to deal with the shaky chicken-and-egg situation. That will tell what was deleted, but not how. What is good to know, but how determines what buffer to put it in.

Just thinking out loud here that would also expose me to undo/redo issues.

Thanks again for the reply.
Reply all
Reply to author
Forward
0 new messages