# eric3.QScintilla.Editor

Module implementing the editor component of the eric3 IDE.

### Classes

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

### Functions

None

## Editor

Class implementing the editor component of the eric3 IDE.

#### Signals

autoCompletionAPIsAvailable(avail)
  emitted after the autocompletion function has been configured
bookmarkToggled(editor)
  emitted when a bookmark is toggled
breakpointEnabledToggled(editor)
  emitted when a breakpoint's enabled status 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
undoAvailable(boolean)
  emitted to signal the undo availability

### Derived from

QextScintillaCompat

### Methods

Editor | Constructor
_updateReadOnly | Private method to update the readOnly information for this editor.
autoComplete | Public method to perform an autocompletion.
autoSyntaxCheck | Private method to perform an automatic syntax check of the file.
bindLexer | Private slot to set the correct lexer depending on language.
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.
checkDirty | Private method to check dirty status and open a message window.
checkLanguage | Private method to check the selected language of the language submenu.
clearBreakpoint | Public method to clear a breakpoint.
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.
event | Protected method called to process an event.
eventFilter | Private method called to filter interesting events.
extractTasks | Public slot to extract all tasks.
fileRenamed | Public slot to handle the editorRenamed signal.
focusInEvent | Public method called when the editor receives focus.
focusOutEvent | Public method called when the editor loses focus.
getBookmarks | Public method to retrieve the bookmarks.
getBreakpoints | Public method to retrieve all breakpoints.
getCodeCoverageFile | Private method to get the filename of the file containing coverage info.
getExtension | Private method to get the fileextension without a leading '.'.
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.
getMacroName | Private method to select a macro name from the list of macros.
getSyntaxErrors | Public method to retrieve the syntax error markers.
getZoom | Public method used to retrieve the current zoom factor.
gotoLine | Public slot to jump to the beginning of a line.
handleAutoCompletionEnable | Private slot to handle the Enable Autocompletion context menu entry.
handleAutosaveEnable | Private slot handling the autosave enable context menu action.
handleBookmark | Public method to toggle a bookmark.
handleClearBookmarks | Private slot to handle the 'Clear all bookmarks' context menu action.
handleClearBreakpoints | Private slot to handle the 'Clear all breakpoints' context menu action.
handleClearSyntaxError | Private slot to handle the 'Clear all syntax error' context menu action.
handleCodeCoverage | Private method to handle the code coverage context menu action.
handleCodeCoverageHideAnnotations | Private method to handle the hide code coverage annotations context menu action.
handleCodeCoverageShowAnnotations | Private method to handle the show code coverage annotations context menu action.
handleCodeMetrics | Private method to handle the code metrics context menu action.
handleContextClose | Private slot handling the close context menu entry.
handleContextSave | Private slot handling the save context menu entry.
handleContextSaveAs | Private slot handling the save as context menu entry.
handleCursorPositionChanged | Private slot to handle the cursorPositionChanged signal.
handleCyclopsReport | Private method to handle the Cyclops report context menu action.
handleDeleteMacro | Public method to delete a macro.
handleDeselectAll | Private slot handling the deselect all context menu action.
handleEditBreakpoint | Private slot to handle the 'Edit breakpoint' context menu action.
handleGotoSyntaxError | Private slot to handle the 'Goto syntax error' context menu action.
handleLMBbookmarks | Private method to handle the 'LMB toggles bookmark' context menu action.
handleLMBbreakpoints | Private method to handle the 'LMB toggles breakpoint' context menu action.
handleLanguage | Private method to handle the selection of a lexer language.
handleLoadMacro | Public method to load a macro from a file.
handleMarginClicked | Private slot to handle the marginClicked signal.
handleModificationChanged | Private slot to handle the modificationChanged signal.
handleModificationReadOnly | Private slot to handle the modificationAttempted signal.
handleMonospacedEnable | Private slot to handle the Use Monospaced Font context menu entry.
handleNewView | Private slot to create a new view to an open document.
handleNextBookmark | Private slot to handle the 'Next bookmark' context menu action.
handleNextBreakpoint | Private slot to handle the 'Next breakpoint' context menu action.
handleNextUncovered | Private slot to handle the 'Next uncovered' context menu action.
handlePreviousBookmark | Private slot to handle the 'Previous bookmark' context menu action.
handlePreviousBreakpoint | Private slot to handle the 'Previous breakpoint' context menu action.
handlePreviousUncovered | Private slot to handle the 'Previous uncovered' context menu action.
handleProfileData | Private method to handle the show profile data context menu action.
handleRemoveCyclopsReport | Private method to handle the Remove Cyclops report context menu action.
handleRenamed | Public slot to handle the editorRenamed signal.
handleRunMacro | Public method to execute a macro.
handleSaveMacro | Public method to save a macro to a file.
handleSelectAll | Private slot handling the select all context menu action.
handleShortenEmptyLines | Public slot to compress lines consisting solely of whitespace characters.
handleShowContextMenu | Private slot handling the aboutToShow signal of the context menu.
handleShowMarginContextMenu | Private slot handling the aboutToShow signal of the margins context menu.
handleShowShowMenu | Private slot called before the show menu is shown.
handleShowSyntaxError | Private slot to handle the 'Show syntax error message' context menu action.
handleStartMacroRecording | Public method to start macro recording.
handleStopMacroRecording | Public method to stop macro recording.
handleSyntaxCheck | Private method to handle the syntax check context menu action.
handleSyntaxError | Public method to toggle a syntax error indicator.
handleTabnanny | Private method to handle the tabnanny context menu action.
handleTemporaryBreakpoint |
handleToggleBookmark | Private slot to handle the 'Toggle bookmark' context menu action.
handleToggleBreakpoint | Private slot to handle the 'Toggle breakpoint' context menu action.
handleToggleBreakpointEnabled | Private slot to handle the 'Enable/Disable breakpoint' context menu action.
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.
highlight | Public method to highlight (or de-highlight) a particular line.
highlightVisible | Public method to make sure that the highlight is visible.
indentLine | Private method to indent or unindent the current line.
indentLineOrSelection | Public slot to indent the current line or current selection
indentSelection | Private method to indent or unindent the current selection.
initContextMenu | Private method used to setup the context menu
initContextMenuChecks | Private method used to setup the Checks 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.
initContextMenuShow | Private method used to setup the Show context sub menu.
initMarginContextMenu | Private method used to setup the context menu for the margins
isPyFile | Public method to return a flag indicating a Python file.
isRubyFile | Public method to return a flag indicating a Ruby file.
lineAt | Public method to calculate the line at a position.
marginsWidth | Private method to determin the width of all margins.
newBreakpointWithProperties | Public method to set a new breakpoint and its properties.
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.
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.
resetLanguage |
revertToUnmodified | Private 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.
setAutoCompletion | Private method to configure the autocompletion function.
setAutoCompletionEnabled | Public method to enable/disable autocompletion.
setBreakpointIgnoreCount | Public method to set a breakpoints ignore count.
setBreakpointProperties | Public method to set a breakpoints properties.
setCallTips | Private method to configure the calltips function.
setLanguage | Private method to set a lexer language.
setLineMarkerColours | Private method to set the line marker colours.
setMargin0and2 | Private method to configure margins 0 and 2.
setMonospaced | Public method to set/reset a monospaced font.
setTextDisplay | Private method to configure the text display.
shouldAutosave | Public slot to check the autosave flags.
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.
syntaxCheck | Private method to perform a syntax check of the file.
toggleBreakpoint | Public method to toggle a breakpoint.
toggleBreakpointEnabled | Public method to toggle a breakpoints enabled status.
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.
zoomIn | Public method used to increase the zoom factor.
zoomOut | Public method used to decrease the zoom factor.
zoomTo | Public method used to zoom to a specific zoom factor.

### Editor (Constructor)

Editor(dbs, fn=None, parent=None, name=None, flags=0, isPythonFile=0, 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
parent
  parent widget (viewmanager) of this editor (QWidget)
name
  name of this editor (string or QString)
flags
  window flags
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._updateReadOnly

_updateReadOnly(bForce=1)

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
  1 to force change, 0 to only update and emit signal if there was an attribute change.

### Editor.autoComplete

autoComplete()

Public method to perform an autocompletion.

### Editor.autoSyntaxCheck

autoSyntaxCheck()

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

### 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.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.checkDirty

checkDirty()

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

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

### Editor.checkLanguage

checkLanguage()

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

### 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.close

close(alsoDelete=0)

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)

Returns:
  flag indicating that the event was handled (boolean)

### Editor.dragLeaveEvent

dragLeaveEvent(event)

Protected method to handle the drag leave event.

event
  the drag leave event (QDragLeaveEvent)

Returns:
  flag indicating that the event was handled (boolean)

### Editor.dragMoveEvent

dragMoveEvent(event)

Protected method to handle the drag move event.

event
  the drag move event (QDragMoveEvent)

Returns:
  flag indicating that the event was handled (boolean)

### Editor.dropEvent

dropEvent(event)

Protected method to handle the drop event.

event
  the drop event (QDropEvent)

Returns:
  flag indicating that the event was handled (boolean)

### 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.event

event(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.eventFilter

eventFilter(object, event)

Private method called to filter interesting events.

object
  object, that generated the event (QObject)
event
  the event, that was generated by object (QEvent)

Returns:
  flag indicating if event was filtered out (bool)

### 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)

Public 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.getBreakpoints

getBreakpoints()

Public method to retrieve all breakpoints. This method will update the internal list of breakpoints before the list is returned.

Returns:
  a list of tuples with linenumber and condition

### Editor.getCodeCoverageFile

getCodeCoverageFile()

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

### Editor.getExtension

getExtension(fname)

Private method to get the fileextension without a leading '.'.

fname
  filename (string)

Returns:
  extension of the filename (string)

### 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.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.getSyntaxErrors

getSyntaxErrors()

Public method to retrieve the syntax error markers.

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

### Editor.getZoom

getZoom()

Public method used to retrieve the current zoom factor.

Returns:
  zoom factor (int)

### Editor.gotoLine

gotoLine(line)

Public slot to jump to the beginning of a line.

line
  line number to go to

### Editor.handleAutoCompletionEnable

handleAutoCompletionEnable()

Private slot to handle the Enable Autocompletion context menu entry.

### Editor.handleAutosaveEnable

handleAutosaveEnable()

Private slot handling the autosave enable context menu action.

### Editor.handleBookmark

handleBookmark(line)

Public method to toggle a bookmark.

line
  line number of the bookmark

### Editor.handleClearBookmarks

handleClearBookmarks()

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

### Editor.handleClearBreakpoints

handleClearBreakpoints()

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

### Editor.handleClearSyntaxError

handleClearSyntaxError()

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

### Editor.handleCodeCoverage

handleCodeCoverage()

Private method to handle the code coverage context menu action.

### Editor.handleCodeCoverageHideAnnotations

handleCodeCoverageHideAnnotations()

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

### Editor.handleCodeCoverageShowAnnotations

handleCodeCoverageShowAnnotations()

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

### Editor.handleCodeMetrics

handleCodeMetrics()

Private method to handle the code metrics context menu action.

### Editor.handleContextClose

handleContextClose()

Private slot handling the close context menu entry.

### Editor.handleContextSave

handleContextSave()

Private slot handling the save context menu entry.

### Editor.handleContextSaveAs

handleContextSaveAs()

Private slot handling the save as context menu entry.

### Editor.handleCursorPositionChanged

handleCursorPositionChanged(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.handleCyclopsReport

handleCyclopsReport()

Private method to handle the Cyclops report context menu action.

### Editor.handleDeleteMacro

handleDeleteMacro()

Public method to delete a macro.

### Editor.handleDeselectAll

handleDeselectAll()

Private slot handling the deselect all context menu action.

### Editor.handleEditBreakpoint

handleEditBreakpoint()

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

### Editor.handleGotoSyntaxError

handleGotoSyntaxError()

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

### Editor.handleLMBbookmarks

handleLMBbookmarks()

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

### Editor.handleLMBbreakpoints

handleLMBbreakpoints()

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

### Editor.handleLanguage

handleLanguage(idx)

Private method to handle the selection of a lexer language.

idx
  index of the lexer language (int)

### Editor.handleLoadMacro

handleLoadMacro()

Public method to load a macro from a file.

### Editor.handleMarginClicked

handleMarginClicked(margin, line, state)

Private slot to handle the marginClicked signal.

margin
  id of the clicked margin
line
  line number pf the click
state
  mouse button state

### Editor.handleModificationChanged

handleModificationChanged(m)

Private slot to handle the modificationChanged signal. It emits the signal modificationStatusChanged with parameters m and self.

m
  modification status

### Editor.handleModificationReadOnly

handleModificationReadOnly()

Private slot to handle the modificationAttempted signal.

### Editor.handleMonospacedEnable

handleMonospacedEnable()

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

### Editor.handleNewView

handleNewView()

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

### Editor.handleNextBookmark

handleNextBookmark()

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

### Editor.handleNextBreakpoint

handleNextBreakpoint()

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

### Editor.handleNextUncovered

handleNextUncovered()

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

### Editor.handlePreviousBookmark

handlePreviousBookmark()

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

### Editor.handlePreviousBreakpoint

handlePreviousBreakpoint()

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

### Editor.handlePreviousUncovered

handlePreviousUncovered()

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

### Editor.handleProfileData

handleProfileData()

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

### Editor.handleRemoveCyclopsReport

handleRemoveCyclopsReport()

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

### Editor.handleRenamed

handleRenamed(fn)

Public slot to handle the editorRenamed signal.

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

### Editor.handleRunMacro

handleRunMacro()

Public method to execute a macro.

### Editor.handleSaveMacro

handleSaveMacro()

Public method to save a macro to a file.

### Editor.handleSelectAll

handleSelectAll()

Private slot handling the select all context menu action.

### Editor.handleShortenEmptyLines

handleShortenEmptyLines()

Public slot to compress lines consisting solely of whitespace characters.

### Editor.handleShowContextMenu

handleShowContextMenu()

Private slot handling the aboutToShow signal of the context menu.

### Editor.handleShowMarginContextMenu

handleShowMarginContextMenu()

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

### Editor.handleShowShowMenu

handleShowShowMenu()

Private slot called before the show menu is shown.

### Editor.handleShowSyntaxError

handleShowSyntaxError()

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

### Editor.handleStartMacroRecording

handleStartMacroRecording()

Public method to start macro recording.

### Editor.handleStopMacroRecording

handleStopMacroRecording()

Public method to stop macro recording.

### Editor.handleSyntaxCheck

handleSyntaxCheck()

Private method to handle the syntax check context menu action.

### Editor.handleSyntaxError

handleSyntaxError(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.handleTabnanny

handleTabnanny()

Private method to handle the tabnanny context menu action.

### Editor.handleTemporaryBreakpoint

handleTemporaryBreakpoint()

### Editor.handleToggleBookmark

handleToggleBookmark()

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

### Editor.handleToggleBreakpoint

handleToggleBreakpoint()

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

### Editor.handleToggleBreakpointEnabled

handleToggleBreakpointEnabled()

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

### 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.highlight

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

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.indentLine

indentLine(indent = 1)

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.indentLineOrSelection

indentLineOrSelection()

Public slot to indent the current line or current selection

### Editor.indentSelection

indentSelection(indent = 1)

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.initContextMenuChecks

initContextMenuChecks()

Private method used to setup the Checks 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.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.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.lineAt

lineAt(pos)

Public method to calculate the line at a position. This variant is able to calculate the line for positions in the margins and for empty lines.

pos
  position to calculate the line for (QPoint)

Returns:
  linenumber at position or -1, if there is no line at pos (integer, zero based)

### Editor.marginsWidth

marginsWidth()

Private method to determin the width of all margins.

Returns:
  width of all margins in pixels (integer)

### Editor.newBreakpointWithProperties

newBreakpointWithProperties(line, properties)

Public 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.printFile

printFile()

Public slot to print the text.

### Editor.printSelection

printSelection()

Public slot to print the selected text.

### Editor.readFile

readFile(fn)

Public slot to read the text from a file.

fn
  filename to read from (string or QString)

### 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.resetLanguage

resetLanguage()

### Editor.revertToUnmodified

revertToUnmodified()

Private method to revert back to the last saved state.

### Editor.saveFile

saveFile(saveas = 0, 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.setAutoCompletion

setAutoCompletion()

Private method to configure the autocompletion function.

### Editor.setAutoCompletionEnabled

setAutoCompletionEnabled(enable)

Public method to enable/disable autocompletion.

enable
  flag indicating the desired autocompletion status

### Editor.setBreakpointIgnoreCount

setBreakpointIgnoreCount(line, count)

Public method to set a breakpoints ignore count.

line
  line number of the breakpoint
count
  ignore count for the breakpoint (integer)

### Editor.setBreakpointProperties

setBreakpointProperties(line, properties)

Public method to set a breakpoints properties.

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

### Editor.setCallTips

setCallTips()

Private method to configure the calltips function.

### Editor.setLanguage

setLanguage(filename, initTextDisplay = 1)

Private 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.setLineMarkerColours

setLineMarkerColours()

Private method to set the line marker colours.

### Editor.setMargin0and2

setMargin0and2()

Private method to configure margins 0 and 2.

### Editor.setMonospaced

setMonospaced(on)

Public method to set/reset a monospaced font.

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

### Editor.setTextDisplay

setTextDisplay()

Private method to configure the text display.

### Editor.shouldAutosave

shouldAutosave()

Public slot to check the autosave flags.

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

### 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.syntaxCheck

syntaxCheck(quiet = 0)

Private method to perform a syntax check of the file.

quiet
  flag indicating quiet operation (Boolean)

### Editor.toggleBreakpoint

toggleBreakpoint(line, temporary = 0)

Public method to toggle a breakpoint.

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

### Editor.toggleBreakpointEnabled

toggleBreakpointEnabled(line)

Public method to toggle a breakpoints enabled status.

line
  line number of the breakpoint

### 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

### Editor.zoomIn

zoomIn(zoom = 1)

Public method used to increase the zoom factor.

zoom
  zoom factor increment

### Editor.zoomOut

zoomOut(zoom = 1)

Public method used to decrease the zoom factor.

zoom
  zoom factor decrement

### Editor.zoomTo

zoomTo(zoom)

Public method used to zoom to a specific zoom factor.

zoom
  zoom factor

Up