editor — Text editor class#

Text editor class for your favourite editor.

Note

This module uses userinterfaces.gui and has depedencies from other partially external modules.

class editor.TextEditor[source]#

Bases: object

Text editor.

Changed in version 8.0: Editor detection functions were moved from config.

Setup external Editor.

edit(text, jumpIndex=None, highlight=None)[source]#

Call the editor and thus allows the user to change the text.

Halts the thread’s operation until the editor is closed.

Parameters:
  • text (str) – the text to be edited

  • jumpIndex (int | None) – position at which to put the caret

  • highlight (str | None) – each occurrence of this substring will be highlighted

Returns:

the modified text, or None if the user didn’t save the text file in his text editor

Return type:

str | None