View unanswered posts | View active topics



Reply to topic  [ 111 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8
[FD3] [FD4] Trace plugin - trace() generator 
Author Message
Member

Joined: Fri Jul 23, 2010 10:26 am
Posts: 146
Reply with quote
That C# macro you've added looks pretty simple. I like it! Where can I get a reference for all the Scintilla commands (with arguments and use cases if that is documented somewhere)?
For example, how do I find out about sci.InsertText? It's not mentioned in the Macros doc.

Your macro command + snippet example looks not bad except it pollutes the clipboard. I wonder if there're some SaveClipboard / RestoreClipboard commands?


Thu Aug 06, 2015 9:52 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
No there are no save/restore clipboard.

Generally the ScintillaCommands listed in the macro doc are safe and identical in C# (see how NewLine, LineEnd, etc. are listed).

More advanced functions, like InsertText, SetSel, aren't documented but easy enough to use with an editor offering code completion (Snippet Editor, VS, MonoDevelop). You just need to add "PluginCore.dll" from FD program files as a DLL reference and you'll get good code hinting.

However some advanced manipulations can become pretty tricky because Scintilla and .NET handle multi-byte characters differently (we added a number of "MBSafeXXX" methods for that) - the only reliable source of documentation will be ScintillaNet.cs in FD's github and ScintillaNet project itself. You also have to be very careful if you call the undo/redo API methods as you can really break the undo behaviour if commands aren't correctly paired.


Thu Aug 06, 2015 1:43 pm
Profile WWW
Member

Joined: Fri Jul 23, 2010 10:26 am
Posts: 146
Reply with quote
I see. Thanks a lot, Philippe!


Thu Aug 06, 2015 4:14 pm
Profile
Member

Joined: Fri Jul 23, 2010 10:26 am
Posts: 146
Reply with quote
I've added your Trace.cs unmodified as a Macro, it works pretty well. But I can't seem to get the shortcut working.
I've assigned Ctrl+0 as the shortcut to this Macro (Trace plugin uninstalled already), in the Macros menu there's Ctrl+0 listed next to the Trace macro, but pressing Ctrl+0 doesn't do anything. Running the macro form the macros menu or the toolbar works. I then tried to set the macro to some other shortcuts Ctrl+Shift+T - still no effect, End - FlashDevelop crashed with an exception. Is something up with the macro shortcut system? I thought maybe I'd find macros in the new tools > keyboard shortcuts menu, but they are not there.


Thu Aug 06, 2015 4:32 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
Yeah something seem a bit broken in the macro shortcuts.
I set Ctrl+Alt+T but I had to restart FD to get it working.


Fri Aug 07, 2015 8:19 am
Profile WWW
Member

Joined: Fri Jul 23, 2010 10:26 am
Posts: 146
Reply with quote
Didn't think about restarting - Ctrl+0 also working after a restart.


Fri Aug 07, 2015 8:36 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 111 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.