# eric4.QScintilla.Editor

Module implementing the editor component of the eric4 IDE.

### Classes

Editor | Class implementing the editor component of the eric4 IDE.

### Functions

None

## Editor

Class implementing the editor component of the eric4 IDE.

#### Signals

autoCompletionAPIsAvailable(avail)
  emitted after the autocompletion function has been configured
bookmarkToggled(editor)
  emitted when a bookmark is toggled
breakpointToggled(editor)
  emitted when a breakpoint is toggled
captionChanged(string, editor)
  emitted when the caption is updated. Typically due to a readOnly attribute change.
coverageMarkersShown(boolean)
  emitted after the coverage markers have been shown or cleared
cursorChanged(string, int, int)
  emitted when the cursor position was changed
editorRenamed(string)
  emitted after the editor got a new name (i.e. after a 'Save As')
editorSaved(string)
  emitted after the editor has been saved
modificationStatusChanged(boolean, editor)
  emitted when the modification status has changed
redoAvailable(boolean)
  emitted to signal the redo availability
syntaxerrorToggled(editor)
  emitted when a syntax error was discovered
taskMarkersUpdated(editor)
  emitted when the task markers were updated
undoAvailable(boolean)
  emitted to signal the undo availability

### Derived from

QsciScintillaCompat

### Methods

Editor | Constructor
__addBreakPoints | Private slot to add breakpoints.
__addFileAliasResource | Private method to handle the Add aliased file context menu action.
__addFileResource | Private method to handle the Add file context menu action.
__addFileResources | Private method to handle the Add files context menu action.
__addLocalizedResource | Private method to handle the Add localized resource context menu action.
__addResourceFrame | Private method to handle the Add resource frame context menu action.
__autoSyntaxCheck | Private method to perform an automatic syntax check of the file.
__autosaveEnable | Private slot handling the autosave enable context menu action.
__bindCompleter | Private slot to set the correct typing completer depending on language.
__bindLexer | Private slot to set the correct lexer depending on language.
__bindName | Private method to generate a dummy filename for binding a lexer.
__breakPointDataAboutToBeChanged | Private slot to handle the dataAboutToBeChanged signal of the breakpoint model.
__changeBreakPoints | Private slot to set changed breakpoints.
__checkLanguage | Private method to check the selected language of the language submenu.
__codeCoverageHideAnnotations | Private method to handle the hide code coverage annotations context menu action.
__codeCoverageShowAnnotations | Private method to handle the show code coverage annotations context menu action.
__contextClose | Private slot handling the close context menu entry.
__contextSave | Private slot handling the save context menu entry.
__contextSaveAs | Private slot handling the save as context menu entry.
__cursorPositionChanged | Private slot to handle the cursorPositionChanged signal.
__deleteBreakPoints | Private slot to delete breakpoints.
__deselectAll | Private slot handling the deselect all context menu action.
__doSyntaxCheck | Private method to handle the syntax check context menu action.
__doTabnanny | Private method to handle the tabnanny context menu action.
__getCodeCoverageFile | Private method to get the filename of the file containing coverage info.
__getExtension | Private method to get the file extension without a leading '.'.
__getMacroName | Private method to select a macro name from the list of macros.
__getWord | Private method to get the word at a position.
__indentLine | Private method to indent or unindent the current line.
__indentSelection | Private method to indent or unindent the current selection.
__initContextMenu | Private method used to setup the context menu
__initContextMenuAutocompletion | Private method used to setup the Checks context sub menu.
__initContextMenuChecks | Private method used to setup the Checks context sub menu.
__initContextMenuGraphics | Private method used to setup the diagrams context sub menu.
__initContextMenuLanguages | Private method used to setup the Languages context sub menu.
__initContextMenuRefactoring | Private method used to setup the refactoring context sub menu.
__initContextMenuResources | Private method used to setup the Resources context sub menu.
__initContextMenuShow | Private method used to setup the Show context sub menu.
__initMarginContextMenu | Private method used to setup the context menu for the margins
__languageMenuTriggered | Private method to handle the selection of a lexer language.
__linesChanged | Private method to track text changes.
__lmBbookmarks | Private method to handle the 'LMB toggles bookmark' context menu action.
__lmBbreakpoints | Private method to handle the 'LMB toggles breakpoint' context menu action.
__marginClicked | Private slot to handle the marginClicked signal.
__marginsWidth | Private method to determine the width of all margins.
__menuClearBreakpoints | Private slot to handle the 'Clear all breakpoints' context menu action.
__menuToggleBreakpointEnabled | Private slot to handle the 'Enable/Disable breakpoint' context menu action.
__menuToggleTemporaryBreakpoint | Private slot to handle the 'Toggle temporary breakpoint' context menu action.
__modificationChanged | Private slot to handle the modificationChanged signal.
__modificationReadOnly | Private slot to handle the modificationAttempted signal.
__newView | Private slot to create a new view to an open document.
__newViewNewSplit | Private slot to create a new view to an open document.
__removeCyclopsReport | Private method to handle the Remove Cyclops report context menu action.
__resetLanguage | Private method used to reset the language selection.
__restoreBreakpoints | Private method to restore the breakpoints.
__selectAll | Private slot handling the select all context menu action.
__setAutoCompletion | Private method to configure the autocompletion function.
__setCallTips | Private method to configure the calltips function.
__setLineMarkerColours | Private method to set the line marker colours.
__setMargin0and2 | Private method to configure margins 0 and 2.
__setTextDisplay | Private method to configure the text display.
__showApplicationDiagram | Private method to handle the Imports Diagram context menu action.
__showAutocompletionMenu | Private slot called before the autocompletion menu is shown.
__showClassDiagram | Private method to handle the Class Diagram context menu action.
__showCodeCoverage | Private method to handle the code coverage context menu action.
__showCodeMetrics | Private method to handle the code metrics context menu action.
__showContextMenu | Private slot handling the aboutToShow signal of the context menu.
__showContextMenuGraphics | Private slot handling the aboutToShow signal of the diagrams context menu.
__showCyclopsReport | Private method to handle the Cyclops report context menu action.
__showImportsDiagram | Private method to handle the Imports Diagram context menu action.
__showMarginContextMenu | Private slot handling the aboutToShow signal of the margins context menu.
__showPackageDiagram | Private method to handle the Package Diagram context menu action.
__showProfileData | Private method to handle the show profile data context menu action.
__showShowMenu | Private slot called before the show menu is shown.
__showSyntaxError | Private slot to handle the 'Show syntax error message' context menu action.
__syntaxCheck | Private method to perform a syntax check of the file.
__toggleAutoCompletionEnable | Private slot to handle the Enable Autocompletion context menu entry.
__toggleBreakpoint | Private method to toggle a breakpoint.
__toggleBreakpointEnabled | Private method to toggle a breakpoints enabled status.
__updateReadOnly | Private method to update the readOnly information for this editor.
autoComplete | Public method to perform an autocompletion.
boxCommentLine | Public slot to box comment the current line.
boxCommentLineOrSelection | Public slot to box comment the current line or current selection.
boxCommentSelection | Public slot to box comment the current selection.
canAutoCompleteFromAPIs | Public method to check for API availablity.
changeEvent | Protected method called to process an event.
checkDirty | Public method to check dirty status and open a message window.
clearBookmarks | Public slot to handle the 'Clear all bookmarks' context menu action.
clearBreakpoint | Public method to clear a breakpoint.
clearSyntaxError | Public slot to handle the 'Clear all syntax error' context menu action.
close | Public method called when the window gets closed.
closeIt | Public method called by the viewmanager to finally get rid of us.
commentLine | Public slot to comment the current line.
commentLineOrSelection | Public slot to comment the current line or current selection.
commentSelection | Public slot to comment the current selection.
contextMenuEvent | Private method implementing the context menu event.
curLineHasBreakpoint | Public method to check for the presence of a breakpoint at the current line.
dragEnterEvent | Protected method to handle the drag enter event.
dragLeaveEvent | Protected method to handle the drag leave event.
dragMoveEvent | Protected method to handle the drag move event.
dropEvent | Protected method to handle the drop event.
ensureVisible | Public slot to ensure, that the specified line is visible.
ensureVisibleTop | Public slot to ensure, that the specified line is visible at the top of the editor.
extractTasks | Public slot to extract all tasks.
fileRenamed | Public slot to handle the editorRenamed signal.
focusInEvent | Protected method called when the editor receives focus.
focusOutEvent | Public method called when the editor loses focus.
getBookmarks | Public method to retrieve the bookmarks.
getCompleter | Public method to retrieve a reference to the completer object.
getFileName | Public method to return the name of the file being displayed.
getHighlightPosition | Public method to return the position of the highlight bar.
getLexer | Public method to retrieve a reference to the lexer object.
getLineSeparator | Public slot to get the line separator for the current eol mode.
getNoName | Public method to get the display string for an unnamed editor.
getSearchText | Public method to determine the selection or the current word for the next search operation.
getSyntaxErrors | Public method to retrieve the syntax error markers.
gotoLine | Public slot to jump to the beginning of a line.
gotoSyntaxError | Public slot to handle the 'Goto syntax error' context menu action.
handleMonospacedEnable | Private slot to handle the Use Monospaced Font context menu entry.
handleRenamed | Public slot to handle the editorRenamed signal.
hasBookmarks | Public method to check for the presence of bookmarks.
hasBreakpoints | Public method to check for the presence of breakpoints.
hasCoverageMarkers | Public method to test, if there are coverage markers.
hasSyntaxErrors | Public method to check for the presence of bookmarks.
hasTaskMarkers | Public method to determine, if this editor contains any task markers.
highlight | Public method to highlight (or de-highlight) a particular line.
highlightVisible | Public method to make sure that the highlight is visible.
indentLineOrSelection | Public slot to indent the current line or current selection
isPyFile | Public method to return a flag indicating a Python file.
isRubyFile | Public method to return a flag indicating a Ruby file.
keyPressEvent | Re-implemented to handle the user input a key at a time.
macroDelete | Public method to delete a macro.
macroLoad | Public method to load a macro from a file.
macroRecordingStart | Public method to start macro recording.
macroRecordingStop | Public method to stop macro recording.
macroRun | Public method to execute a macro.
macroSave | Public method to save a macro to a file.
menuEditBreakpoint | Public slot to handle the 'Edit breakpoint' context menu action.
menuNextBreakpoint | Public slot to handle the 'Next breakpoint' context menu action.
menuPreviousBreakpoint | Public slot to handle the 'Previous breakpoint' context menu action.
menuToggleBookmark | Public slot to handle the 'Toggle bookmark' context menu action.
menuToggleBreakpoint | Public slot to handle the 'Toggle breakpoint' context menu action.
mousePressEvent | Protected method to handle the mouse press event.
newBreakpointWithProperties | Private method to set a new breakpoint and its properties.
nextBookmark | Public slot to handle the 'Next bookmark' context menu action.
nextTask | Public slot to handle the 'Next task' context menu action.
nextUncovered | Public slot to handle the 'Next uncovered' context menu action.
previousBookmark | Public slot to handle the 'Previous bookmark' context menu action.
previousTask | Public slot to handle the 'Previous task' context menu action.
previousUncovered | Public slot to handle the 'Previous uncovered' context menu action.
printFile | Public slot to print the text.
printSelection | Public slot to print the selected text.
readFile | Public slot to read the text from a file.
readLine0 | Public slot to read the first line from a file.
readSettings | Public slot to read the settings into our lexer.
redo | Public method to redo the last recorded change.
refresh | Public slot to refresh the editor contents.
revertToUnmodified | Public method to revert back to the last saved state.
saveFile | Public slot to save the text to a file.
saveFileAs | Public slot to save a file with a new name.
setAutoCompletionEnabled | Public method to enable/disable autocompletion.
setLanguage | Public method to set a lexer language.
setMonospaced | Public method to set/reset a monospaced font.
setNoName | Public method to set the display string for an unnamed editor.
shortenEmptyLines | Public slot to compress lines consisting solely of whitespace characters.
shouldAutosave | Public slot to check the autosave flags.
smartIndentLineOrSelection | Public slot to indent current line smartly.
streamCommentLine | Public slot to stream comment the current line.
streamCommentLineOrSelection | Public slot to stream comment the current line or current selection.
streamCommentSelection | Public slot to comment the current selection.
toggleBookmark | Public method to toggle a bookmark.
toggleSyntaxError | Public method to toggle a syntax error indicator.
uncommentLine | Public slot to uncomment the current line.
uncommentLineOrSelection | Public slot to uncomment the current line or current selection.
uncommentSelection | Public slot to uncomment the current selection.
undo | Public method to undo the last recorded change.
unindentLineOrSelection | Public slot to unindent the current line or current selection.
writeFile | Public slot to write the text to a file.

#### Editor (Constructor)

Editor(dbs, fn = None, vm = None, isPythonFile = False, editor = None, tv = None)

Constructor

dbs
  reference to the debug server object
fn
  name of the file to be opened (string). If it is None, a new (empty) editor is opened
vm
  reference to the view manager object (ViewManager.ViewManager)
isPythonFile
  flag indicating that this is a Python file even if it doesn't have the .py extension (boolean)
editor
  reference to an Editor object, if this is a cloned view
tv
  reference to the task viewer object

#### Editor.__addBreakPoints

__addBreakPoints(parentIndex, start, end)

Private slot to add breakpoints.

parentIndex
  index of parent item (QModelIndex)
start
  start row (integer)
end
  end row (integer)

#### Editor.__addFileAliasResource

__addFileAliasResource()

Private method to handle the Add aliased file context menu action.

#### Editor.__addFileResource

__addFileResource()

Private method to handle the Add file context menu action.

#### Editor.__addFileResources

__addFileResources()

Private method to handle the Add files context menu action.

#### Editor.__addLocalizedResource

__addLocalizedResource()

Private method to handle the Add localized resource context menu action.

#### Editor.__addResourceFrame

__addResourceFrame()

Private method to handle the Add resource frame context menu action.

#### Editor.__autoSyntaxCheck

__autoSyntaxCheck()

Private method to perform an automatic syntax check of the file.

#### Editor.__autosaveEnable

__autosaveEnable()

Private slot handling the autosave enable context menu action.

#### Editor.__bindCompleter

__bindCompleter(filename)

Private slot to set the correct typing completer depending on language.

filename
  filename used to determine the associated typing completer language (string)

#### Editor.__bindLexer

__bindLexer(filename)

Private slot to set the correct lexer depending on language.

filename
  filename used to determine the associated lexer language (string)

#### Editor.__bindName

__bindName(txt)

Private method to generate a dummy filename for binding a lexer.

txt
  first line of text to use in the generation process (QString or string)

#### Editor.__breakPointDataAboutToBeChanged

__breakPointDataAboutToBeChanged(startIndex, endIndex)

Private slot to handle the dataAboutToBeChanged signal of the breakpoint model.

startIndex
  start index of the rows to be changed (QModelIndex)
endIndex
  end index of the rows to be changed (QModelIndex)

#### Editor.__changeBreakPoints

__changeBreakPoints(startIndex, endIndex)

Private slot to set changed breakpoints.

indexes
  indexes of changed breakpoints.

#### Editor.__checkLanguage

__checkLanguage()

Private method to check the selected language of the language submenu.

#### Editor.__codeCoverageHideAnnotations

__codeCoverageHideAnnotations()

Private method to handle the hide code coverage annotations context menu action.

#### Editor.__codeCoverageShowAnnotations

__codeCoverageShowAnnotations()

Private method to handle the show code coverage annotations context menu action.

#### Editor.__contextClose

__contextClose()

Private slot handling the close context menu entry.

#### Editor.__contextSave

__contextSave()

Private slot handling the save context menu entry.

#### Editor.__contextSaveAs

__contextSaveAs()

Private slot handling the save as context menu entry.

#### Editor.__cursorPositionChanged

__cursorPositionChanged(line, pos)

Private slot to handle the cursorPositionChanged signal.

It emits the signal cursorChanged with parameters fileName, line and pos.

line
  line number of the cursor
pos
  position in line of the cursor

#### Editor.__deleteBreakPoints

__deleteBreakPoints(parentIndex, start, end)

Private slot to delete breakpoints.

parentIndex
  index of parent item (QModelIndex)
start
  start row (integer)
end
  end row (integer)

#### Editor.__deselectAll

__deselectAll()

Private slot handling the deselect all context menu action.

#### Editor.__doSyntaxCheck

__doSyntaxCheck()

Private method to handle the syntax check context menu action.

#### Editor.__doTabnanny

__doTabnanny()

Private method to handle the tabnanny context menu action.

#### Editor.__getCodeCoverageFile

__getCodeCoverageFile()

Private method to get the filename of the file containing coverage info.

#### Editor.__getExtension

__getExtension(fname)

Private method to get the file extension without a leading '.'.

fname
  filename (string)

Returns:
  extension of the filename (string)

#### Editor.__getMacroName

__getMacroName()

Private method to select a macro name from the list of macros.

Returns:
  Tuple of macro name and a flag, indicating, if the user pressed ok or canceled the operation. (QString, boolean)

#### Editor.__getWord

__getWord(line, index)

Private method to get the word at a position.

line
  number of line to look at (int)
index
  position to look at (int)

Returns:
  the word at that position

#### Editor.__indentLine

__indentLine(indent = True)

Private method to indent or unindent the current line.

indent
  flag indicating an indent operation
  If the flag is true, an indent operation is performed. Otherwise the current line is unindented.

#### Editor.__indentSelection

__indentSelection(indent = True)

Private method to indent or unindent the current selection.

indent
  flag indicating an indent operation
  If the flag is true, an indent operation is performed. Otherwise the current line is unindented.

#### Editor.__initContextMenu

__initContextMenu()

Private method used to setup the context menu

#### Editor.__initContextMenuAutocompletion

__initContextMenuAutocompletion()

Private method used to setup the Checks context sub menu.

#### Editor.__initContextMenuChecks

__initContextMenuChecks()

Private method used to setup the Checks context sub menu.

#### Editor.__initContextMenuGraphics

__initContextMenuGraphics()

Private method used to setup the diagrams context sub menu.

#### Editor.__initContextMenuLanguages

__initContextMenuLanguages()

Private method used to setup the Languages context sub menu.

#### Editor.__initContextMenuRefactoring

__initContextMenuRefactoring()

Private method used to setup the refactoring context sub menu.

#### Editor.__initContextMenuResources

__initContextMenuResources()

Private method used to setup the Resources context sub menu.

#### Editor.__initContextMenuShow

__initContextMenuShow()

Private method used to setup the Show context sub menu.

#### Editor.__initMarginContextMenu

__initMarginContextMenu()

Private method used to setup the context menu for the margins

#### Editor.__languageMenuTriggered

__languageMenuTriggered(act)

Private method to handle the selection of a lexer language.

act
  reference to the action that was triggered (QAction)

#### Editor.__linesChanged

__linesChanged()

Private method to track text changes.

This method checks, if lines have been inserted or removed in order to update the breakpoints.

#### Editor.__lmBbookmarks

__lmBbookmarks()

Private method to handle the 'LMB toggles bookmark' context menu action.

#### Editor.__lmBbreakpoints

__lmBbreakpoints()

Private method to handle the 'LMB toggles breakpoint' context menu action.

#### Editor.__marginClicked

__marginClicked(margin, line, modifiers)

Private slot to handle the marginClicked signal.

margin
  id of the clicked margin
line
  line number pf the click
modifiers
  keyboard modifiers (Qt.KeyboardModifiers)

#### Editor.__marginsWidth

__marginsWidth()

Private method to determine the width of all margins.

Returns:
  width of all margins in pixels (integer)

#### Editor.__menuClearBreakpoints

__menuClearBreakpoints()

Private slot to handle the 'Clear all breakpoints' context menu action.

#### Editor.__menuToggleBreakpointEnabled

__menuToggleBreakpointEnabled()

Private slot to handle the 'Enable/Disable breakpoint' context menu action.

#### Editor.__menuToggleTemporaryBreakpoint

__menuToggleTemporaryBreakpoint()

Private slot to handle the 'Toggle temporary breakpoint' context menu action.

#### Editor.__modificationChanged

__modificationChanged(m)

Private slot to handle the modificationChanged signal.

It emits the signal modificationStatusChanged with parameters m and self.

m
  modification status

#### Editor.__modificationReadOnly

__modificationReadOnly()

Private slot to handle the modificationAttempted signal.

#### Editor.__newView

__newView()

Private slot to create a new view to an open document.

#### Editor.__newViewNewSplit

__newViewNewSplit()

Private slot to create a new view to an open document.

#### Editor.__removeCyclopsReport

__removeCyclopsReport()

Private method to handle the Remove Cyclops report context menu action.

#### Editor.__resetLanguage

__resetLanguage()

Private method used to reset the language selection.

#### Editor.__restoreBreakpoints

__restoreBreakpoints()

Private method to restore the breakpoints.

#### Editor.__selectAll

__selectAll()

Private slot handling the select all context menu action.

#### Editor.__setAutoCompletion

__setAutoCompletion()

Private method to configure the autocompletion function.

#### Editor.__setCallTips

__setCallTips()

Private method to configure the calltips function.

#### Editor.__setLineMarkerColours

__setLineMarkerColours()

Private method to set the line marker colours.

#### Editor.__setMargin0and2

__setMargin0and2()

Private method to configure margins 0 and 2.

#### Editor.__setTextDisplay

__setTextDisplay()

Private method to configure the text display.

#### Editor.__showApplicationDiagram

__showApplicationDiagram()

Private method to handle the Imports Diagram context menu action.

#### Editor.__showAutocompletionMenu

__showAutocompletionMenu()

Private slot called before the autocompletion menu is shown.

#### Editor.__showClassDiagram

__showClassDiagram()

Private method to handle the Class Diagram context menu action.

#### Editor.__showCodeCoverage

__showCodeCoverage()

Private method to handle the code coverage context menu action.

#### Editor.__showCodeMetrics

__showCodeMetrics()

Private method to handle the code metrics context menu action.

#### Editor.__showContextMenu

__showContextMenu()

Private slot handling the aboutToShow signal of the context menu.

#### Editor.__showContextMenuGraphics

__showContextMenuGraphics()

Private slot handling the aboutToShow signal of the diagrams context menu.

#### Editor.__showCyclopsReport

__showCyclopsReport()

Private method to handle the Cyclops report context menu action.

#### Editor.__showImportsDiagram

__showImportsDiagram()

Private method to handle the Imports Diagram context menu action.

#### Editor.__showMarginContextMenu

__showMarginContextMenu()

Private slot handling the aboutToShow signal of the margins context menu.

#### Editor.__showPackageDiagram

__showPackageDiagram()

Private method to handle the Package Diagram context menu action.

#### Editor.__showProfileData

__showProfileData()

Private method to handle the show profile data context menu action.

#### Editor.__showShowMenu

__showShowMenu()

Private slot called before the show menu is shown.

#### Editor.__showSyntaxError

__showSyntaxError()

Private slot to handle the 'Show syntax error message' context menu action.

#### Editor.__syntaxCheck

__syntaxCheck(quiet = False)

Private method to perform a syntax check of the file.

quiet
  flag indicating quiet operation (Boolean)

#### Editor.__toggleAutoCompletionEnable

__toggleAutoCompletionEnable()

Private slot to handle the Enable Autocompletion context menu entry.

#### Editor.__toggleBreakpoint

__toggleBreakpoint(line, temporary = False)

Private method to toggle a breakpoint.

line
  line number of the breakpoint
temporary
  flag indicating a temporary breakpoint

#### Editor.__toggleBreakpointEnabled

__toggleBreakpointEnabled(line)

Private method to toggle a breakpoints enabled status.

line
  line number of the breakpoint

#### Editor.__updateReadOnly

__updateReadOnly(bForce = True)

Private method to update the readOnly information for this editor.

If bForce is True, then updates everything regardless if the attributes have actually changed, such as during initialization time. A signal is emitted after the caption change.

bForce
  True to force change, False to only update and emit signal if there was an attribute change.

#### Editor.autoComplete

autoComplete()

Public method to perform an autocompletion.

#### Editor.boxCommentLine

boxCommentLine()

Public slot to box comment the current line.

#### Editor.boxCommentLineOrSelection

boxCommentLineOrSelection()

Public slot to box comment the current line or current selection.

#### Editor.boxCommentSelection

boxCommentSelection()

Public slot to box comment the current selection.

#### Editor.canAutoCompleteFromAPIs

canAutoCompleteFromAPIs()

Public method to check for API availablity.

Returns:
  flag indicating autocompletion from APIs is available (boolean)

#### Editor.changeEvent

changeEvent(evt)

Protected method called to process an event.

This implements special handling for the events showMaximized, showMinimized and showNormal. The windows caption is shortened for the minimized mode and reset to the full filename for the other modes. This is to make the editor windows work nicer with the QWorkspace.

evt
  the event, that was generated (QEvent)

Returns:
  flag indicating if the event could be processed (bool)

#### Editor.checkDirty

checkDirty()

Public method to check dirty status and open a message window.

Returns:
  flag indicating successful reset of the dirty flag (boolean)

#### Editor.clearBookmarks

clearBookmarks()

Public slot to handle the 'Clear all bookmarks' context menu action.

#### Editor.clearBreakpoint

clearBreakpoint(line)

Public method to clear a breakpoint.

Note: This doesn't clear the breakpoint in the debugger, it just deletes it from the editor internal list of breakpoints.

line
  linenumber of the breakpoint

#### Editor.clearSyntaxError

clearSyntaxError()

Public slot to handle the 'Clear all syntax error' context menu action.

#### Editor.close

close(alsoDelete = False)

Public method called when the window gets closed.

This overwritten method redirects the action to our ViewManager.closeEditor, which in turn calls our closeIt method.

alsoDelete
  ignored

#### Editor.closeIt

closeIt()

Public method called by the viewmanager to finally get rid of us.

#### Editor.commentLine

commentLine()

Public slot to comment the current line.

#### Editor.commentLineOrSelection

commentLineOrSelection()

Public slot to comment the current line or current selection.

#### Editor.commentSelection

commentSelection()

Public slot to comment the current selection.

#### Editor.contextMenuEvent

contextMenuEvent(evt)

Private method implementing the context menu event.

evt
  the context menu event (QContextMenuEvent)

#### Editor.curLineHasBreakpoint

curLineHasBreakpoint()

Public method to check for the presence of a breakpoint at the current line.

Returns:
  flag indicating the presence of a breakpoint (boolean)

#### Editor.dragEnterEvent

dragEnterEvent(event)

Protected method to handle the drag enter event.

event
  the drag enter event (QDragEnterEvent)

#### Editor.dragLeaveEvent

dragLeaveEvent(event)

Protected method to handle the drag leave event.

event
  the drag leave event (QDragLeaveEvent)

#### Editor.dragMoveEvent

dragMoveEvent(event)

Protected method to handle the drag move event.

event
  the drag move event (QDragMoveEvent)

#### Editor.dropEvent

dropEvent(event)

Protected method to handle the drop event.

event
  the drop event (QDropEvent)

#### Editor.ensureVisible

ensureVisible(line)

Public slot to ensure, that the specified line is visible.

line
  line number to make visible

#### Editor.ensureVisibleTop

ensureVisibleTop(line)

Public slot to ensure, that the specified line is visible at the top of the editor.

line
  line number to make visible

#### Editor.extractTasks

extractTasks()

Public slot to extract all tasks.

#### Editor.fileRenamed

fileRenamed(fn)

Public slot to handle the editorRenamed signal.

fn
  filename to be set for the editor (QString or string).

#### Editor.focusInEvent

focusInEvent(event)

Protected method called when the editor receives focus.

This method checks for modifications of the current file and rereads it upon request. The cursor is placed at the current position assuming, that it is in the vicinity of the old position after the reread.

event
  the event object (QFocusEvent)

#### Editor.focusOutEvent

focusOutEvent(event)

Public method called when the editor loses focus.

event
  the event object (QFocusEvent)

#### Editor.getBookmarks

getBookmarks()

Public method to retrieve the bookmarks.

Returns:
  sorted list of all lines containing a bookmark (list of integer)

#### Editor.getCompleter

getCompleter()

Public method to retrieve a reference to the completer object.

Returns:
  the completer object (CompleterBase)

#### Editor.getFileName

getFileName()

Public method to return the name of the file being displayed.

Returns:
  filename of the displayed file (string)

#### Editor.getHighlightPosition

getHighlightPosition()

Public method to return the position of the highlight bar.

Returns:
  line number of the highlight bar

#### Editor.getLexer

getLexer()

Public method to retrieve a reference to the lexer object.

Returns:
  the lexer object (Lexer)

#### Editor.getLineSeparator

getLineSeparator()

Public slot to get the line separator for the current eol mode.

Returns:
  eol string (string)

#### Editor.getNoName

getNoName()

Public method to get the display string for an unnamed editor.

Returns:
  display string for this unnamed editor (QString)

#### Editor.getSearchText

getSearchText(selectionOnly = False)

Public method to determine the selection or the current word for the next search operation.

selectionOnly
  flag indicating that only selected text should be returned (boolean)

Returns:
  selection or current word (QString)

#### Editor.getSyntaxErrors

getSyntaxErrors()

Public method to retrieve the syntax error markers.

Returns:
  sorted list of all lines containing a syntax error (list of integer)

#### Editor.gotoLine

gotoLine(line)

Public slot to jump to the beginning of a line.

line
  line number to go to

#### Editor.gotoSyntaxError

gotoSyntaxError()

Public slot to handle the 'Goto syntax error' context menu action.

#### Editor.handleMonospacedEnable

handleMonospacedEnable()

Private slot to handle the Use Monospaced Font context menu entry.

#### Editor.handleRenamed

handleRenamed(fn)

Public slot to handle the editorRenamed signal.

fn
  filename to be set for the editor (QString or string).

#### Editor.hasBookmarks

hasBookmarks()

Public method to check for the presence of bookmarks.

Returns:
  flag indicating the presence of bookmarks (boolean)

#### Editor.hasBreakpoints

hasBreakpoints()

Public method to check for the presence of breakpoints.

Returns:
  flag indicating the presence of breakpoints (boolean)

#### Editor.hasCoverageMarkers

hasCoverageMarkers()

Public method to test, if there are coverage markers.

#### Editor.hasSyntaxErrors

hasSyntaxErrors()

Public method to check for the presence of bookmarks.

Returns:
  flag indicating the presence of bookmarks (boolean)

#### Editor.hasTaskMarkers

hasTaskMarkers()

Public method to determine, if this editor contains any task markers.

Returns:
  flag indicating the presence of task markers (boolean)

#### Editor.highlight

highlight(line = None, error = False, syntaxError = False)

Public method to highlight (or de-highlight) a particular line.

line
  line number to highlight
error
  flag indicating whether the error highlight should be used
syntaxError
  flag indicating a syntax error

#### Editor.highlightVisible

highlightVisible()

Public method to make sure that the highlight is visible.

#### Editor.indentLineOrSelection

indentLineOrSelection()

Public slot to indent the current line or current selection

#### Editor.isPyFile

isPyFile()

Public method to return a flag indicating a Python file.

Returns:
  flag indicating a Python file (boolean)

#### Editor.isRubyFile

isRubyFile()

Public method to return a flag indicating a Ruby file.

Returns:
  flag indicating a Ruby file (boolean)

#### Editor.keyPressEvent

keyPressEvent(ev)

Re-implemented to handle the user input a key at a time.

ev
  key event (QKeyEvent)

#### Editor.macroDelete

macroDelete()

Public method to delete a macro.

#### Editor.macroLoad

macroLoad()

Public method to load a macro from a file.

#### Editor.macroRecordingStart

macroRecordingStart()

Public method to start macro recording.

#### Editor.macroRecordingStop

macroRecordingStop()

Public method to stop macro recording.

#### Editor.macroRun

macroRun()

Public method to execute a macro.

#### Editor.macroSave

macroSave()

Public method to save a macro to a file.

#### Editor.menuEditBreakpoint

menuEditBreakpoint(line = None)

Public slot to handle the 'Edit breakpoint' context menu action.

line
  linenumber of the breakpoint to edit

#### Editor.menuNextBreakpoint

menuNextBreakpoint()

Public slot to handle the 'Next breakpoint' context menu action.

#### Editor.menuPreviousBreakpoint

menuPreviousBreakpoint()

Public slot to handle the 'Previous breakpoint' context menu action.

#### Editor.menuToggleBookmark

menuToggleBookmark()

Public slot to handle the 'Toggle bookmark' context menu action.

#### Editor.menuToggleBreakpoint

menuToggleBreakpoint()

Public slot to handle the 'Toggle breakpoint' context menu action.

#### Editor.mousePressEvent

mousePressEvent(event)

Protected method to handle the mouse press event.

event
  the mouse press event (QMouseEvent)

#### Editor.newBreakpointWithProperties

newBreakpointWithProperties(line, properties)

Private method to set a new breakpoint and its properties.

line
  line number of the breakpoint
properties
  properties for the breakpoint (tuple) (condition, temporary flag, enabled flag, ignore count)

#### Editor.nextBookmark

nextBookmark()

Public slot to handle the 'Next bookmark' context menu action.

#### Editor.nextTask

nextTask()

Public slot to handle the 'Next task' context menu action.

#### Editor.nextUncovered

nextUncovered()

Public slot to handle the 'Next uncovered' context menu action.

#### Editor.previousBookmark

previousBookmark()

Public slot to handle the 'Previous bookmark' context menu action.

#### Editor.previousTask

previousTask()

Public slot to handle the 'Previous task' context menu action.

#### Editor.previousUncovered

previousUncovered()

Public slot to handle the 'Previous uncovered' context menu action.

#### Editor.printFile

printFile()

Public slot to print the text.

#### Editor.printSelection

printSelection()

Public slot to print the selected text.

#### Editor.readFile

readFile(fn, createIt = False)

Public slot to read the text from a file.

fn
  filename to read from (string or QString)
createIt
  flag indicating the creation of a new file, if the given one doesn't exist (boolean)

#### Editor.readLine0

readLine0(fn, createIt = False)

Public slot to read the first line from a file.

fn
  filename to read from (string or QString)
createIt
  flag indicating the creation of a new file, if the given one doesn't exist (boolean)

Returns:
  first line of the file (string)

#### Editor.readSettings

readSettings()

Public slot to read the settings into our lexer.

#### Editor.redo

redo()

Public method to redo the last recorded change.

#### Editor.refresh

refresh()

Public slot to refresh the editor contents.

#### Editor.revertToUnmodified

revertToUnmodified()

Public method to revert back to the last saved state.

#### Editor.saveFile

saveFile(saveas = False, path = None)

Public slot to save the text to a file.

saveas
  flag indicating a 'save as' action
path
  directory to save the file in (string or QString)

Returns:
  tuple of two values (boolean, string) giving a success indicator and the name of the saved file

#### Editor.saveFileAs

saveFileAs(path = None)

Public slot to save a file with a new name.

path
  directory to save the file in (string or QString)

Returns:
  tuple of two values (boolean, string) giving a success indicator and the name of the saved file

#### Editor.setAutoCompletionEnabled

setAutoCompletionEnabled(enable)

Public method to enable/disable autocompletion.

enable
  flag indicating the desired autocompletion status

#### Editor.setLanguage

setLanguage(filename, initTextDisplay = True)

Public method to set a lexer language.

filename
  filename used to determine the associated lexer language (string)
initTextDisplay
  flag indicating an initialization of the text display is required as well (boolean)

#### Editor.setMonospaced

setMonospaced(on)

Public method to set/reset a monospaced font.

on
  flag to indicate usage of a monospace font (boolean)

#### Editor.setNoName

setNoName(noName)

Public method to set the display string for an unnamed editor.

noName
  display string for this unnamed editor (QString)

#### Editor.shortenEmptyLines

shortenEmptyLines()

Public slot to compress lines consisting solely of whitespace characters.

#### Editor.shouldAutosave

shouldAutosave()

Public slot to check the autosave flags.

Returns:
  flag indicating this editor should be saved (boolean)

#### Editor.smartIndentLineOrSelection

smartIndentLineOrSelection()

Public slot to indent current line smartly.

#### Editor.streamCommentLine

streamCommentLine()

Public slot to stream comment the current line.

#### Editor.streamCommentLineOrSelection

streamCommentLineOrSelection()

Public slot to stream comment the current line or current selection.

#### Editor.streamCommentSelection

streamCommentSelection()

Public slot to comment the current selection.

#### Editor.toggleBookmark

toggleBookmark(line)

Public method to toggle a bookmark.

line
  line number of the bookmark

#### Editor.toggleSyntaxError

toggleSyntaxError(line, error, msg = "")

Public method to toggle a syntax error indicator.

line
  line number of the syntax error
error
  flag indicating if the error marker should be set or deleted (boolean)
msg
  error message (string)

#### Editor.uncommentLine

uncommentLine()

Public slot to uncomment the current line.

This happens only, if it was commented by using the commentLine() or commentSelection() slots

#### Editor.uncommentLineOrSelection

uncommentLineOrSelection()

Public slot to uncomment the current line or current selection.

This happens only, if it was commented by using the commentLine() or commentSelection() slots

#### Editor.uncommentSelection

uncommentSelection()

Public slot to uncomment the current selection.

This happens only, if it was commented by using the commentLine() or commentSelection() slots

#### Editor.undo

undo()

Public method to undo the last recorded change.

#### Editor.unindentLineOrSelection

unindentLineOrSelection()

Public slot to unindent the current line or current selection.

#### Editor.writeFile

writeFile(fn)

Public slot to write the text to a file.

fn
  filename to write to (string or QString)

Returns:
  flag indicating success

Up