List the main functions of a text editor.

Subject Introduction to Computer System
NU Year Set: 2.(c) Marks: 3 Year: 2012

Main functions of a text editor

editor.fold_range(start, end[, label])

Fold (hides) the given range of text. The optional label parameter (a string) is shown as a placeholder. By default, the word count is used.

editor.unfold_range(start, end)

Unfold all text in the given range. Note that the unfolding is recursive, i.e. if there are nested folds, they are all unfolded at once. The return value is the unfolded text.

editor.unfold_all()

Unfold all text in the current document.

editor.close()

Close the document that is currently loaded in the editor. Changes are saved automatically.

editor.get_text([unfold])

Return the entire text of the document that is currently being edited.

The optional unfold argument controls how folded (hidden) text is treated. By default, any folded text is represented by a placeholder character (\ufffc). If unfold is True, the text is returned as if all text was unfolded.

editor.get_selection()

Return the selected range as a tuple of the form (start, end).

If no file is currently open in the editor, None is returned.

editor.get_selected_text()

Return the text that is currently selected in the editor, or None if no document is open (if a document is open, but no text is selected, an empty string is returned).

editor.get_line_selection()

Return the range of all lines that are part of the current selection as a tuple of the form (start, end)

If no file is currently open in the editor, None is returned.

editor.get_path()

Return the absolute file path of the document that is currently open in the editor, or None if no document is open.

 

Login to post your comment.