Friday, October 28, 2022

New feature preview: Selection color options

One of the editor improvements is the ability to customize the painting of text selection.  The default option now is the alpha blending of the selection color with the background.

Selection in previous versions:

Before

Current default selection painting (alpha blending):

Current

 

In previous versions, when a whole line is selected, the full line from the left to the right border was highlighted.  Now you have the option to highlight just the text.  This matches the behavior of other editors such as VS Code.

This is how it looks:

partial

 

The above options are controlled via Tools, Options, IDE Options, Editor, Selection Color:

Options

To get the the old behavior, set Alpha to 1 and check FillWholeLines.  You can also change the selection colors.  In addition to picking a color from the drop-down list, you can also type a hexadecimal value (e.g. $3399FF)

Feature preview: Better Unicode handling

In the forthcoming release of PyScripter, there are numerous editor improvements.  One are that has been revamped is the handling of Unicode, which is now on a par with the best editors around (e.g. VS Code, Scintilla, etc.).  More specically,  there are improvements in the handling of:

  • Wide glyphs (e.g. Chinese characters)
  • Surrogate pairs and combining characters
  • emojis  (you can enter with the Windows key + .)
  • Bi-directional text.

The picture below demonstrates these improvements:

Unicode

Wednesday, October 26, 2022

New feature: Track changes bar

The forthcoming version includes an editor enhancement, the Track Changes bar. It is feature “borrowed” from Visual Studio, and it helps you locate the changes introduced to an edited file.  The picture below showcases the feature:

Track changes
  • Changed lines are shown in yellow.
  • Changed but saved lines show in green.
  • Changed, saved, but later changed again lines are shown in orange.
  • Finally if you undo a changed and saved line to its original form (before saving) it is shown in blue.

The Track Changes bar is shown by default, but you can hide it or change the width and the colors via Tools, Options, IDE Options, Editor, Trach changes

IDE Options

Feature preview: Spell checking

A new version of PyScripter will be released soon.   Alongside python 11 support, it will include a number of enhancements and new features.  One of them is the implementation of the long-standing request for spell checking comments and strings.

The  Edit menu and the editor context menu, include a sub-menu “Spelling”:

Spelling

 

The options are self-explanatory.  You can spell-check the current word, line, selection or the entire file.

There are some IDE Options which affect spelling:

IDE Options

These option are:

  • The language code for the dictionary used,
  • If Spell check as you type is checked then spell checking occurs as you type like in Word.  This can also be set from the editor context menu.
  • “Spell check syntax tokens” is a comma separated list of syntax tokens that controls what parts of your code are spell checked.   By default this includes all strings and comments.

When the speller finds an error it is decorated with a red squiggly line:

Spelling error

With the cursor on a spelling error the spelling context menu changes to:

Suggestions

On top of the menu you can see one or more suggestions.  Clicking on one of them replaces the error with the suggestion.  You can also add the error word to the dictionary, delete it, ignore the error once, or ignore the error for the whole document.

Dictionaries

This feature is using the standard windows spell checker available since Windows 8. You can get dictionaries for different languages using the Windows Language settings.

Friday, October 22, 2021

Completion with python extension modules such as PyQt5 and Pandas

Code Completion in the editor when you are using python extension modules has always been hard, primarily because these are not implemented in python code but rather in a compiled language (typically C) and come as dynamic link libraries.  PyScripter in the past the option to import such modules when code completion was requested and used introspection of the imported modules to provide code completion and general IntelliSense support.

With the implementation of the Language Server Protocol and the inclusion of the Jedi language server there is now a better option. The use of stubs described in PEP 484.

pip install PyQt5-stubs

You would use the pip external Tool for installing the stubs.  Then restart the language server, using the command under the Tools menu and presto,  you have near perfect code completion with PyQt5.

Many packages such as numpy come with their stubs included.  For others you can in internet for stub support.

Another way to improve code completion is to add the package/module name to the list of “Special packages” in the IDE options under code completion.  Jedi will load these modules and this in many cases can improve the speed and quality of code completion.  This works well with the pandas library for example.

 

Wednesday, October 20, 2021

PyScripter v4.1.1 released

PyScripter v4.1.1 is now available at Sourceforge.  This is a hotfix release addressing a couple of critical issues with version 4.1.0 (error on shutdown and errors while editing large files).  See the earlier announcement about version 4.1.0 for information about new features and issues addressed in the v4.1 as compared to v4.0.

Sunday, October 17, 2021

PyScripter 4.1.0 released

PyScripter 4.1 is now available at Sourceforge..  As discussed in an earlier blog post, the major new feature of this release is the implementation of the Language Server Protocol (LSP).  Code IntelliSence is now provided by the widely used Jedi Language Server. Here follows a list of new features and bug fixes in this release:

New features:

  • Implementation of the Language Server Protocol
  • Python language support provided by the Jedi language server
  • Two new styles added Windows11_Light and Windows11_Dark
  • Copy and paste code as html to Powerpoint and other applications
  • Removed support for python 3.3-3.5
  • Read-only indicator on tabs
  • Added traditional Chinese translation

Issues Addressed: