Delphi IDE emulation additions.

53 views
Skip to first unread message

Ross McMillan

unread,
Jan 4, 2022, 5:43:41 AM1/4/22
to PyScripter
One thing I like about PyScripter is the closeness with which the Delphi IDE is emulated - minimal rewiring of my brain is needed when switching between the two.

There are a couple of minor omissions that continue to trip me up, however:

Ctrl-Del

On my Delphi version, Ctrl-Del (actually Ctrl-numeric keypad del only) implements a sort of smart syntax-aware delete word function.  It deletes anything from where the caret is at up until white space or punctuation, and then (only if white space broke the delete) everything up until the next non-whitespace character.  This is probably among my most-used key bindings

On PyScripter IDE, the default Ctrl-Del key binding deletes everything from the caret until the end of the line.  Delphi-muscle-memory means I have to frequently go back and undo unintended deletions.

Another difference between the two is that Delphi Ctrl-Del looks past line endings, which is also useful.

Code Completion

Code completion on PS requires the Enter key to emit the suggested completion to the editor, whereas Delphi IDE completes the suggestion when Enter is pressed, but also if any of Space or a punctuation character is typed, and it includes the trigger character used in the text, so the source text:

    Writeln (OutputFile, LineToWrite) ;

can be entered with as few keystrokes as:

    "W", "r", Space, "(", "o" "u", Comma, Space, "L", "i", ")", Space, Semicolon  

and without requiring any returns.  

While these might seem like petty differences, a partial emulation of the Delphi IDE (even one as complete as PyScripter)  can slow you down quite a bit.  

As an example, Delphi implements positioning of the caret past the end-of-line, scrolling vertically preserves the column position of the cursor, and it isn't possible to scroll back past the beginning of the line.  None of these was the behavior of PS out of the box, but luckily there were PS editor options I found that I could turn on, so all good.  Similar options for the Ctrl-Del behavior and code completion would be nice.

More than happy to test any first look releases. ;-)

PyScripter

unread,
Jan 4, 2022, 7:32:44 AM1/4/22
to PyScripter
The editor of PyScripter provides the Delete Word, Delete Last Word and Delete EOL commands, which you can remap to the keystrokes of your liking.  You could implement custom editor commands using the External Tools functionality.  Have a look at the Advanced Replace external tool as a guide.

Regarding code completion have you looked at the Tools, Options, IDE options, Code Completion?  I think what you wish is already supported.

Ross McMillan

unread,
Jan 4, 2022, 3:24:04 PM1/4/22
to PyScripter
Thanks for the prompt reply.

Full marks for the auto-complete options.  Just what I wanted.

As far as extending the  IDE goes, I'm keen to give it a go. So I have added a new external command and assigned it to Ctrl-Del.  Where to from here?   In the examples provided, the functionality seems to be implemented as another instance of Python executing a script one-liner supplied as a command line parameter.  Is this the editor scripting language?  How do I access the editor primitives such as delete a character, find and replace, etc?
Reply all
Reply to author
Forward
0 new messages