We have lacked the setter and dedicated notifier before.
Change-Id: I58845a48259d260c5cc90ae94b173c79cddcfef9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Adds an option (enabled by default) to close older documents when
opening new documents. These documents are put into "suspended" state,
similar to when restoring sessions: They editors and document are
removed, freeing the memory from their content and attached resources
(e.g. code model resources), but keeping the entry in the open editor
list (and history list, of course).
This is limited to editor/document types that can restore their UI state
when the document is reopened.
Task-number: QTCREATORBUG-10016
Change-Id: Icb5595aec950e3f666d42177fe2fd233954f2772
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Currently we are just using the first that is found. Which could lead
to unexpected behavior. Adjust the API to make clear just one assistant
is supported per editor type.
Change-Id: I711e66b4c5c5f347118357a8bafa0ffc6d650f7e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The TextBlockUserData is destructed from QTextBlockData::free which
deletes the layout right before. So triggering a direct update from
within this destructor could result in a crash when the already deleted
layout is used.
Task-number: QTCREATORBUG-16046
Change-Id: Ifd1d4334ba8ef47c41e0b9ae078ceaf1112b5908
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
If single line was indented with tab, and the insertion point was at the
beginning of the line, the selection moved away from the beginning of
the line. Pressing tab a second time then deletes the line, because the
line is no longer completely selected.
This behavior was also not consistent to the case where the insertion
point is not at the beginning of the line.
The patch makes sure that the selection stays at the beginning of the
line.
Task-number: QTCREATORBUG-8421
Change-Id: I9847c2fe41e2e4f993f5e486c071acc112adb45d
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
To fallbackSaveAsPath and fallbackSaveAsFileName. That makes it clearer
what they are for, and that they actually belong to each other.
Change-Id: Ie5b83b9db77d39a7fe9e979cc8f22b7f5b9101a3
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
On normal selection it should *not* be indented.
On block selection it should.
Task-number: QTCREATORBUG-15300
Change-Id: I40ca1c24c6e14d05ca3c2d92a7562aac0eabb4c7
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This reverts commit 67cfdbd224.
We cannot just resolve symlinks when opening files.
The resolved name might not have much to do with the name of
the symlink (e.g. some version control systems do that).
Change-Id: I373bfc3d4474fe6b7ef4723de254293665fe87ea
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Symlinks need to be resolved, similar to project paths resolving.
Task-number: QTCREATORBUG-15145
Change-Id: I034b99d2a34ddaa664ec6d97b9be76bd4131d706
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reparsing a document is expensive so we should avoid it by all means. In
this patch we prevent that the same document is send again. It isn't send
too in advance of a code completion if there was no changes before the
the completion position.
Change-Id: I0bb786ba1d4e7ce08611a518cb32f8cf8f4d0037
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Made indentation work for block selection mode the same way it does in default mode:
1. delete text if any selected
2. indent block if no text selected
3. indent last line if cursor in first column (QTCREATORBUG-12697)
Task-number: QTCREATORBUG-12697
Change-Id: I1f6b218b389f3fdc5232ec02857aa76f5ccbaaf0
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Adds the opportunity to recover unsaved changes of a file
that was externally modified and reloaded inside Qt Creator.
Task-number: QTCREATORBUG-10281
Change-Id: Ifa7f61daa8a8d336508b0d9c1c300b0f77c207ea
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
We show a dialog that offers opening a file in a different editor type
if opening a file fails, but we should not do that if opening the file
fails because it is not readable.
With this change, documents now specify if they failed to open a file
because reading failed, or because they could not handle the file
contents.
Task-number: QTCREATORBUG-14495
Change-Id: I5d4b7cfa74b87ef21b9b55bc30b3ebe2f8238dfa
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
For non-editor documents it currently is not used, but for editors it
makes more sense to have that on the document instead of the editor.
Most actual implementations of "open" were done in the documents already
anyhow, because it is needed for reloading.
Change-Id: I29d4df2078995cbe80172b51a9bebeecb3afad3c
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
... to the editor factories and pass it to the document, not the widget.
Saves some code, puts fewer objects into the object pool.
Change-Id: Iaaf250af74dc4e0c62700873accbb40ba88b7d9e
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
... and some of the related implementation details
Change-Id: I1f03aa5acf2d3fb2cfc2a6a7845f3d3578b0408d
Reviewed-by: David Schulz <david.schulz@digia.com>