Page 1 of 1

Utilize "Multiple Views" Capability of Scintilla

Posted: 27 Mar 2019, 07:16
by kczx3
Instead of creating an instance of the Scintilla control for every open document, you can utilize the Multiple Views functionality instead to save on memory.

It is simple reference counting and all settings applied are for each separate document. So the lexer and any other settings can be different for each "document".

Re: Utilize "Multiple Views" Capability of Scintilla

Posted: 29 Mar 2019, 19:26
by Alguimist
Some time ago I noticed that Notepad++ reuses the same instance of Scintilla in all tabs, while Programmer's Notepad do not. And so I didn't bother to further investigate the subject.

But, as you mention, it sounds like a good suggestion, and I will soon do some tests.

If it's worth implementing, I'll have to revise and test the whole editor code. And that may be the occasion to adapt AutoGUI to AHK v2 - which I have not adhered to yet - as a new project. I'm also considering to extirpate the GUI designer from AutoGUI, turning it into a separate tool. What do you think about that?

Re: Utilize "Multiple Views" Capability of Scintilla

Posted: 29 Mar 2019, 20:19
by kczx3
See here for my very basic intro to utilizing multiple views within a control, as well as sharing a document between two Scintilla controls. https://www.autohotkey.com/boards/viewtopic.php?f=6&t=63034&p=270320#p269269

Regarding the GUI designer, I can’t say that I have an opinion to sway you either way. I don’t use it at all. I simply use the code editor of AutoGUI.

Re: Utilize "Multiple Views" Capability of Scintilla

Posted: 07 Jun 2019, 14:37
by need4speed
Alguimist wrote:
29 Mar 2019, 19:26
I'm also considering to extirpate the GUI designer from AutoGUI, turning it into a separate tool. What do you think about that?
good idea :thumbup:

Re: Utilize "Multiple Views" Capability of Scintilla

Posted: 03 Nov 2019, 17:33
by boiler
If you are still considering implementing multiple views capability, and it allows you accomplish this:
kczx3 wrote:
29 Mar 2019, 20:19
...sharing a document between two Scintilla controls.
...I just wanted to pass along that I think it would be a great addition to your editor. The lack of being able to view and edit the same document in two different (in-sync) panes is the only reason why I am using VS Code instead of one of the AHK-specific editors. It's such a valuable feature when working on large scripts, it would make it the hands-down AHK editor of choice in my view. It would make it very easy to recommend having it be the editor bundled with AHK as sort of an AHK IDE as has been proposed.

Re: Utilize "Multiple Views" Capability of Scintilla

Posted: 04 Nov 2019, 12:01
by kczx3
I'd like to someday take a stab at it. I was working on it within my SQLiteViewer application however I've had trouble conceptualizing the reference counting AND keeping track of tab indices. Harder than it looks I think.

Re: Utilize "Multiple Views" Capability of Scintilla

Posted: 04 Nov 2019, 14:52
by boiler
That would be great. Good luck with it.