Commit Graph

645 Commits

Author SHA1 Message Date
hjk
98fd59fd09 TextEditor: Start moving data from *EditorWidget to *Editor
Goal is to consolidate "controller" related data in the *Editor hierarchy.
This patch introduces temporary "cross-Private" accessors dd() to
keep the patches small.

First item moved is the AutoCompleter, a glimps at long term benefits
is the simplification in the JavaEditorWidget which is now essentially
a BaseTextEditorWidget, only containing the still-wrong createEditor().
But that can only be move if the *Editors are self-contained, i.e.
keep data themselves, not indirectly through the *EditorWidgets.

Change-Id: Ia0ab90f0322bb17ac20458e6581069eed30acbaf
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-31 16:45:31 +02:00
hjk
9fd2fe5a9a TextEditor: Make completion assist provider a data member
In case of the CppEditor a direct member is not possible due
to setup restrictions inside the CppEditor machinery. I'd expect
that to be fixable when the editor base system is in good shape.

Change-Id: I184e219ca2dff6f67c9b58c182212eb12972cc84
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-07-31 12:40:52 +02:00
hjk
f6b48950ed 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>
2014-07-31 10:54:49 +02:00
Thiago Macieira
5da75dba06 Replace the PMF to certain QString members with a regular function
Qt 5.4 is adding ref-qualified overloads to toUpper, toLower, trimmed
and some others, so the cast becomes ambiguous or just plain wrong.

Change-Id: Idff0b3e100f075b9b995aeb84d88575afecb2d6f
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-31 03:24:02 +02:00
hjk
1924fdb90f TextEditor: Merge PlainTextEditor into Base
Same patter. Plain is fully merged now, so remove the files, too.

Change-Id: Id8c0ba5689ad9980a0db3580cb9833344fd911f3
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-07-30 15:17:53 +02:00
hjk
faa0e5b96c TextEditor: Replace PlainTextEditorWidget by Base + a setup function
Change-Id: I91a3bfb66a72e9234ca59f97d5260bbfc3ccb0d3
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-30 14:41:09 +02:00
hjk
ce6f3477b5 TextEditor: Move remaining PlainTextEditorWidget functions to Base
Change-Id: Ib10d938fce352f59bcd40f1c6aa493794fe90f8d
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-30 14:21:23 +02:00
hjk
fde176e51c TextEditor: Move highlighting support from Plain to Base
Goal is to squash the 'Plain' layer.

Change-Id: I2513de57fbbc09e9d0d9d4f1eb008dced76038f0
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-30 14:19:55 +02:00
hjk
78bb9cd525 TextEditor: Pimpl BaseTextEditor
Change-Id: I876025562678513dd8e8c6537783c81aef7cb2aa
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-28 13:50:00 +02:00
hjk
5aa1b50617 TextEditor: Slim down BaseTextEditorWidget interface
By moving some private functions to the pimpl.
Also, re-order some member function declarations.

Change-Id: If8a6c7ae1c27386511a5fa0a92c88a13541c2d94
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-28 12:34:45 +02:00
hjk
adfb30743d TextEditor: Merge BaseTextEditorDocument into BaseTextDocument
That was the only user of that layer of abstraction.

Change-Id: I2bdc4abb8b2b33bfb70398dd11f7ecc4745ddc43
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-28 12:33:47 +02:00
hjk
96d3449acd TextEditor: Remove itexteditor.{h,cpp}
Move the remaining contents to more appropriate places.

Change-Id: I55eed5c572bd33dafe2187523d9aa381c211fdd6
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-25 14:53:11 +02:00
hjk
bf5e43be94 TextEditor: Merge ITextEditor and BaseTextEditor
Adjust all callers, de-export BaseTextEditorAnimator

Change-Id: I2329d976c1398e2449844bb480a4d4ed29859506
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-25 13:45:55 +02:00
Alessandro Portale
dff9a5f4b0 TextEditor: Compile fix for MSVC 2010
MSVC suddenly has this problem when bulding Qt Creator master Qt5 dev.

error C2352: 'TextEditor::BaseTextEditorWidget::extraSelections' :
illegal call of non-static member function
error C2825: 'T': must be a class or namespace when followed by '::'
...

This patch works it around by simply using this->

Change-Id: I8aae3e76f80248e1dd27d87552d14a81eda0d25f
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-23 11:22:41 +02:00
hjk
cf8a614419 Merge ITextMark and BaseTextMark
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>
2014-07-23 10:38:31 +02:00
Christian Kandeler
93304df038 Always pass Core::Id by value.
Currently we pass in some places by value, elsewhere by const ref and
for some weird reason also by const value in a lot of places. The latter
is particularly annoying, as it is also used in interfaces and therefore
forces all implementors to do the same, since leaving the "const" off is
causing compiler warnings with MSVC.

Change-Id: I65b87dc3cce0986b8a55ff6119cb752361027803
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-01 11:52:08 +02:00
David Schulz
6e9b724006 Editor: Blockselection rewrite.
Also adding the possibility to insert text into the blockselection.

Task-number: QTCREATORBUG-7773
Change-Id: I7a47a1d630f769a8253ee1a2f21057820ea170d5
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-06-20 13:16:54 +02:00
David Schulz
6144a0b32f Editor: Don't show help popups when alt was part of a shortcut.
Task-number: QTCREATORBUG-12382
Change-Id: I2825f8197dbac1f1ef805892dc1191df86b84dbb
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-06-13 14:40:41 +02:00
Eike Ziller
ade2710725 TextEditors: Keep visible position in editor for 'external' changes
If contents of a text editor change from outside the editor,
the visible portion of the text in the viewport should stay the same.
That is especially apparent when opening a document in a split view, and
adding/removing lines in one of them, above the first visible line in
the other.

Task-number: QTCREATORBUG-11486
Change-Id: I28cde17ecf98cb98c1d6f1259dc66d3671585ee3
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-06-06 13:37:35 +02:00
Eike Ziller
db5f2f1411 Text editors: Do not show tool tip for empty area
The editors were showing tool tips for the last cursor position in a
line, even if the mouse was hovered over the empty space behind the
line.

Task-number: QTCREATORBUG-9437
Change-Id: Ibe3b0140b73c3a15811eeaf50a15d75f378f37f4
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-06-02 15:18:26 +02:00
David Schulz
714d56a381 Editor: Add actions for view page/line up/down.
Task-number: QTCREATORBUG-4994
Change-Id: Ia6ce1a01cd78dd1987404d77f6b0c0da41b4929e
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-06-02 15:07:35 +02:00
David Schulz
9c2852615c Editor: Handle Tab as printable character.
Task-number: QTCREATORBUG-2225
Change-Id: Ia557e0c1d61b61b31b28a1d3e32f846d7efd70f0
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-05-26 13:28:41 +02:00
Orgad Shaneh
04f0891fb4 TextEditor: Avoid repetitive calls
Change-Id: Iae1e32c1c078bbc6605b8baa8d856cd30f84b239
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-05-21 07:40:28 +02:00
Orgad Shaneh
245c0deb69 TextEditor: Pass some const values by reference
Change-Id: I059ee93d986425ebf6896bfad92845246d351831
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-05-20 11:43:47 +02:00
Orgad Shaneh
86319398b6 TextEditor: Remove duplicate condition
Change-Id: I606276670bb78f5e705bbe98cd4c7e5f59a7723e
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-05-20 11:42:09 +02:00
Vicken Simonian
abe4bff86a Editor: Utilize Current Line Number background color
Task-number: QTCREATORBUG-12170
Change-Id: Ib27962a6f72b903fa2caadc441cd6ef51b5b1810
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-05-13 12:28:13 +02:00
David Schulz
adb5a7a708 Editor: Set correct title to the print job.
Fix proposed by Alex Sokolov.

Task-number: QTCREATORBUG-12161
Change-Id: I1a7d4e9579dbb518970ea7bdb76a740e8e5d870d
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-05-12 08:19:41 +02:00
Wiebe Cazemier
b63d9c6df0 Adds option to make editor not scroll on debugging
Added an option to change the behavior of the debuggercore so that
the current editor isn't always centered on the current line, to stop
unnecessary jumping of the code.

Change-Id: I9406df518bb1b977e39a0265ee7fd6fae2069ed9
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-05-08 15:20:48 +02:00
jkobus
671ffc8f73 Fix a warning about a position out of range.
May happen when selecting a text in diff editor.

Change-Id: I2c4790c42c91623fc8b4cabef8a4604de9fd4cef
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-05-07 08:07:42 +02:00
Mitch Curtis
243362b774 Highlight single character search results.
The logic behind the old code was that it was pointless to highlight
single characters, but it didn't explain why. This is useful for
searching for single character variable names, for instance.

Change-Id: Ic8cf60190c1a9caa1eb4441921e60f377fbee8d4
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-03-19 17:30:47 +01:00
Oswald Buddenhagen
52bf71fbdf Merge remote-tracking branch 'origin/3.1'
Conflicts:
	README
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: Ib9aef37a246bc3bb9bca0c32a902af3b09ef3146
2014-03-11 13:39:55 +01:00
Eike Ziller
12b25ebd2e TextEditors: remove unused variables
Change-Id: Id0d2115c7d8819d35dc626d5605650f7b450ee87
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-03-07 12:53:13 +01:00
Eike Ziller
32a017122b Merge remote-tracking branch 'origin/3.1'
Conflicts:
	qtcreator.pri

Change-Id: Iae83884b818a3d2d812936f463d7d52cd1f7b42a
2014-02-27 09:44:20 +01:00
David Schulz
b4394dabdb Editor: fix upper and lower case on blockselection.
Task-number: QTCREATORBUG-11546

Change-Id: I2e8b5b05ff0044e5ab159119f24dff873be949d7
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-02-27 06:49:07 +01:00
David Schulz
6cac6f0ef6 Editor: Optimize out viewport update.
Change-Id: If4661d68d30e5ba36efbba3376242631ec0402d4
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-02-27 06:48:56 +01:00
Frantisek Vacek
fa998d2d2c Improve Copy/CutLine actions usability
This patch implements two features:
1. Reimplement CopyLine to move text cursor at the beginning of line
2. Add copy/cutLine action to Advanced Edit menu, to make it
   discoverable for editor users.

Change-Id: I0bf336ebee4dbf5afd2c759e47b1830271bd9d18
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-02-26 10:26:44 +01:00
Lorenz Haas
ac70c168da Optimize usage of QPalette
setPalette() does not replace the old one but rather adds the
difference. Thus a previous copy of the palette is unnecessary.

Change-Id: I5c06da456b76144efc4a984ccda13c7d2243a7bc
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-02-21 08:53:28 +01:00
Eike Ziller
f335da7a75 Editors: Add option to not hide the mouse cursor when typing
Task-number: QTCREATORBUG-3584

Change-Id: Iae5551d36b72c5712f3276b15dfa85982a776dcf
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-02-18 11:53:45 +01:00
Eike Ziller
30719c68fa TextEditors: update parentheses highlighting when font settings change
Change-Id: Ia9c43d52116a337abee8704f9fbbe80a56029caa
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-02-06 13:41:27 +01:00
Eike Ziller
99dec87406 TextEditors: Generalize update mechanism when editors become visible
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>
2014-02-06 13:14:56 +01:00
Eike Ziller
7e30653f8f TextEditors: Update block revisions only once per document
Instead of once per editor.
Also remove a related unused function.

Change-Id: I4bcd86b9b0ec61b87500e546cf2138ec5d854561
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-29 11:22:44 +01:00
Eike Ziller
0ec2a02fd4 TextEditors: Avoid multiple highlighting runs when changing font setting
And remove some unnecessary code in Python editor

Change-Id: I86cde74c244a16d1b36b0ac0e841ef8110ba832f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-24 08:00:45 +01:00
Eike Ziller
c99464dd9b TextEditors: Remove unnecessary duplicated caching
Change-Id: I3800360e3b9bd6874d6852dabcfc7a9a066e52c2
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-24 08:00:28 +01:00
Eike Ziller
3fa6b6737c TextEditors: Move font settings to document
Change-Id: I325764cbaa9684fa2758b0ea6c6ea58de142cb73
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-24 08:00:07 +01:00
Eike Ziller
5deb0f367e Editors: Add at least some short documentation.
Change-Id: I7fc7946405d3cbb1af0cf29a9d328d857eb8304a
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-23 09:21:15 +01:00
Eike Ziller
4eff289e03 TextEditors: Remove widget's setTabSettings method
Change-Id: If212b45e2d526534b7853f3fa23b170f61e1976e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-21 11:22:16 +01:00
Eike Ziller
c06e68c439 TextEditors: Remove tabSettings() from widget
It's part of the document.

Change-Id: I7288b09a0792fdae9c741016594e129f6b21f8e7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-21 10:53:37 +01:00
Eike Ziller
83c61f2eaf Revert "BaseTextEditWidget: Forward everything with ControlModifier to QPTE"
Lead to annoying behavior that pressing any disabled shortcut with control
modifier would lead to unwanted characters in the editor.
This reverts commit c1ff105a0c.

Change-Id: If61e52be9f11cabeafb46f5d71b901b4eab8e169
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-01-20 13:41:07 +01:00
Eike Ziller
61b0aacb12 TextEditors: Remove unused signal
Change-Id: Iee8d9393b9f203f3a43d7dcc000f4a01d3e3710f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-16 17:11:42 +01:00
Eike Ziller
3bc4bb3cb9 TextEditors: Move manual (un)indent code to document
Change-Id: I01e93a15b8280a55c31db6be28fe6eb39c7babb0
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-16 15:51:18 +01:00