forked from qt-creator/qt-creator
TextEditor: Re-work comment definition handling
No need for most of the machinery. Change-Id: I9078174582d83da94c6c7f20282fd3a5f1742911 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -53,10 +53,7 @@ PythonEditor::PythonEditor(EditorWidget *editorWidget)
|
||||
setContext(Core::Context(Constants::C_PYTHONEDITOR_ID,
|
||||
TextEditor::Constants::C_TEXTEDITOR));
|
||||
setDuplicateSupported(true);
|
||||
}
|
||||
|
||||
PythonEditor::~PythonEditor()
|
||||
{
|
||||
setCommentStyle(Utils::CommentDefinition::HashStyle);
|
||||
}
|
||||
|
||||
Core::IEditor *PythonEditor::duplicate()
|
||||
|
||||
@@ -43,7 +43,6 @@ class PythonEditor : public TextEditor::BaseTextEditor
|
||||
|
||||
public:
|
||||
explicit PythonEditor(EditorWidget *editorWidget);
|
||||
virtual ~PythonEditor();
|
||||
|
||||
Core::IEditor *duplicate();
|
||||
|
||||
|
||||
@@ -64,10 +64,6 @@ EditorWidget::EditorWidget(EditorWidget *other)
|
||||
|
||||
void EditorWidget::ctor()
|
||||
{
|
||||
m_commentDefinition.multiLineStart.clear();
|
||||
m_commentDefinition.multiLineEnd.clear();
|
||||
m_commentDefinition.singleLine = QLatin1Char('#');
|
||||
|
||||
setParenthesesMatchingEnabled(true);
|
||||
setMarksVisible(true);
|
||||
setCodeFoldingSupported(true);
|
||||
@@ -75,18 +71,6 @@ void EditorWidget::ctor()
|
||||
new PythonHighlighter(baseTextDocument());
|
||||
}
|
||||
|
||||
EditorWidget::~EditorWidget()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Comments or uncomments selection using Python commenting syntax
|
||||
*/
|
||||
void EditorWidget::unCommentSelection()
|
||||
{
|
||||
Utils::unCommentSelection(this, m_commentDefinition);
|
||||
}
|
||||
|
||||
TextEditor::BaseTextEditor *EditorWidget::createEditor()
|
||||
{
|
||||
return new PythonEditor(this);
|
||||
|
||||
@@ -43,9 +43,6 @@ class EditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
public:
|
||||
EditorWidget(QWidget *parent = 0);
|
||||
EditorWidget(EditorWidget *other);
|
||||
virtual ~EditorWidget();
|
||||
|
||||
virtual void unCommentSelection();
|
||||
|
||||
protected:
|
||||
TextEditor::BaseTextEditor *createEditor();
|
||||
@@ -53,7 +50,6 @@ protected:
|
||||
private:
|
||||
EditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
||||
void ctor();
|
||||
Utils::CommentDefinition m_commentDefinition;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user