Move the remaining contents to more appropriate places.
Change-Id: I55eed5c572bd33dafe2187523d9aa381c211fdd6
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Turns out we don't even need two-phase initialization,
by transparently postponing registration until we get
a non-empty file name, either at constuction, or at
file name change times.
Change-Id: I3e87e47c820066e6707e946fc474ab9c1993e61f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
There was only a single user (TextEditor::DocumentMarker) which
in turn was only used in a single place (BaseTextDocument), so
merge the ITextMarkable into BaseTextDocument.
Change-Id: I1ca8675f9fc22cb56097b843dc5a0fe76875d3e7
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
The block revisions where no longer reset when the editor goes back to
unmodified state (when doing undo or redo), which broke in the recent
refactoring.
Task-number: QTCREATORBUG-11402
Change-Id: I2de24fcc42568f3f7e48a94d391bb9b83c8c4280
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Generalizes the special handling of font settings, which should only be
applied (on the document) when an editor is or becomes visible.
Change-Id: Icd1e3ba4355e1ff4a837c9679b537cc3f5ed7ea9
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Instead of once per editor.
Also remove a related unused function.
Change-Id: I4bcd86b9b0ec61b87500e546cf2138ec5d854561
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Resets the revisions when setting the contents of text editor documents
in general.
Task-number: QTCREATORBUG-11356
Change-Id: I4069d629d8a612d42c7deae707300d50690e2db7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
And remove some unnecessary code in Python editor
Change-Id: I86cde74c244a16d1b36b0ac0e841ef8110ba832f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
From the editor widget. Also name them autoIndent/autoReindent to
distinguish from the manual indent functions.
Change-Id: I4e1b9d503f53870b669fee66467e5e567eacefec
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
There is a 1-to-1 relationship between BaseTextDocument and QTextDocument,
so it doesn't make sense to do the setup between them in the editor widget.
Move creation of BaseTextDocumentLayout and setting up of 'changed' signal
to BaseTextDocument. This also avoids sending multiple
'changed' signals for a single QTextDocument::modificationChanged signal
in case of splits.
Change-Id: Iaab4fea594c5b50f502fd41c88948fac132de9f1
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
And remove the indirection over BaseTextEditorWidget.
Change-Id: I2c570edf46b9ca72a11704ce27d8ae3f2218dcf0
Reviewed-by: David Schulz <david.schulz@digia.com>
To differentiate it from the byte array based IDocument::setContents
Change-Id: Icc9600732c2742fb79254a0697870bacce3a59ee
Reviewed-by: David Schulz <david.schulz@digia.com>
Fix grammar and style issues and punctuation.
Use the \a command instead of \param (not a QDoc command).
Change-Id: Ib048f0219a2c857e5fc3fcd858afbcbd58819193
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
The method is for setting the contents, so it belongs to the document,
and should be named correspondingly.
Change-Id: I40363dc08f11268f530885b512e4a88e8b10d096
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
That is what it actually is, wrt how Qt API calls it.
Change-Id: Ied02055debf6aad75556b0d9d22e8ba2f72be555
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Instead of requiring subclasses to implement a method.
Also renames IDocument::rename to IDocument::setFileName,
since it doesn't really rename any files or such.
Change-Id: I1344025c24d2f74a6a983e04fb0a5245f1f37aad
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
If the file type (mime type) of an editor changes, it might need a
different kind of highlighter/highlighting-support.
Change-Id: I470dbf69e71856c9593d201416c4d4bd2958aaec
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Introduces ITextEditorDocument. This is part of a more general "use
documents instead of editors whereever possible". It will allow to move
to e.g. ITextEditor::openedTextDocumentContents() instead of
ITextEditor::openedTextEditorsContents().
Change-Id: I5ebceaa257a0d2c3e8ac4ac51b9b08b6faa42487
Reviewed-by: David Schulz <david.schulz@digia.com>
Calling beginEditBlock() triggers a textChanged() signal and
did "confuse" Qt Quick Designer.
We could just suppress the signal to work around the issue, but I think
it is cleaner to not alter the text document in autosave at all.
Changing the current text document in autosave might have other
unforeseeable implications.
What happened in the Qt Quick Designer was that textChanged() triggered
a reload of the document.
While the reload of the document usually just triggered a
short/unnoticed dealay, it can also trigger a message box with warnings.
Since we (correctly) assume the .QML file was altered outside
of Qt Quick Designer we do sanity checks and warn about code that
might not be supported.
Having those warnings whenever a file is autosaved is annoying.
Change-Id: I62f5486878956cbb776998e4aba468a91cb9ec8e
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Remove specific setting for warning suppression and use the global one
Change-Id: I1fe2b749d960283b8414cc5db5a5a7e9f20e7740
Reviewed-by: David Schulz <david.schulz@digia.com>
Restores the horizontal and vertical scroll bar values when autosaving.
Task-number: QTCREATORBUG-8590
Change-Id: I7e821118fd427264655bbdd18ba5db9bec35841e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Removes the "Add/Remove UTF-8 BOM" entry in the context menu
of the project file editor. Also ignores the setting
"Add If Encoding Is UTF-8" under
Options -> Text Editor -> Behavior -> File Encodings.
Task-number: QTCREATORBUG-8501
Change-Id: I368966b5235ee60011f2051ebdb82f9fe09bc4cc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Also removed all <QMainWindow> includes which are not needed
anymore.
Change-Id: I393c9a62a5c6df95d9f35d872e1473a4f13bcdc4
Reviewed-by: hjk <qthjk@ovi.com>
This also allows simple setting of breakpoints on failed asserts.
Change-Id: I6dd84cbfaf659d57e39f3447386cebc0221b2b84
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>