Commit Graph

649 Commits

Author SHA1 Message Date
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
Eike Ziller
8aedff7f22 TextEditors: Move some auto-indentation code to document
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>
2014-01-16 15:50:56 +01:00
Eike Ziller
7422b47942 TextEditors: Remove "optimization"
I couldn't find a situation where this code actually resulted in
performance improvement.

Change-Id: I7d905af36ef11dcba43030dc83670c3d1558f650
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-16 15:50:26 +01:00
Eike Ziller
3ad3876611 TextEditors: Move indenter to document.
Change-Id: I8bdf7134562d007aa16cc63a34f5a15a708577ae
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-15 15:02:25 +01:00
Daniel Teske
c1ff105a0c BaseTextEditWidget: Forward everything with ControlModifier to QPTE
Task-number: QTCREATORBUG-11137
Change-Id: Icd1bd55cb8bb3087667b01e18b6774987971601b
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-15 12:46:36 +01:00
Eike Ziller
b7ce718d4c TextEditors: Make function static
Change-Id: I4297651458f6efb28a3bbeb83b4c038956d64305
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-15 10:44:12 +01:00
Eike Ziller
4d99f6e9ad BaseTextEditor: Make internally used function static
Change-Id: I365e4c56b45dda205caa009e7733579d40bca9d0
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-14 09:05:34 +01:00
Eike Ziller
2a2837a683 BaseTextEditor: Remove unused method and member
Change-Id: I9b9081df454aae35c42744f4bbd385e8bd6c50d2
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-14 09:05:18 +01:00
Eike Ziller
355f104d0e BaseTextEditor: Remove some unnecessary indirections through widget
Change-Id: I4f71448d6788a4e553b1495b72263a004e65d8c0
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-14 09:05:06 +01:00
Eike Ziller
cfad9bdc3c TextEditors: Move contentsChanged signal from editor to document
Change-Id: Ic935a8971705cb3238deda71aa2b5d19e4f62593
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-14 09:03:58 +01:00
hjk
4d96fa7aba Core: Merge Find and Locator into Core plugin
Change-Id: I7053310272235d854c9f409670ff52a10a7add8b
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-14 07:43:00 +01:00
Eike Ziller
2251958375 TextEditors: Avoid changing document after construction.
Also when duplicating editors, we don't want to change the document
after construction. Actually at some places (e.g. CppEditorSupport
creation) we don't handle document changes correctly, and we are only
lucky that things still (more or less?) work. Get rid of
BaseTextEditorWidget::duplicateFrom and use copy-constructor style instead.

Change-Id: I7f688b7fcc51d1bb5e222bb333f0d28479b597a6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-01-10 14:38:36 +01:00
Eike Ziller
a3608f595a Editors: Remove BaseTextEditorWidget::setBaseTextDocument
First step in never changing the text document after construction,
because that is actually not really supported.
Second step will be to fix that for the editor duplicate() methods too.

Change-Id: I3d112ba0895e7ee7ac6dd8ae2318f0de7d2cebc9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-01-10 14:31:11 +01:00
Erik Verbruggen
02314e24f0 Editor: add margin displaying to project settings.
This patch also moves the showMargin and marginColumn settings into a
new settings class.

Change-Id: I676447be751c13ee438edc1e31e5998b999c6771
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-10 12:11:24 +01:00
Eike Ziller
f9ce335a6d Editors: Remove useless parent widget argument from create/duplicate
It was never called with a sensible value anyhow, and only complicates things.

Change-Id: I005848700b6c00114d91495670d4a0e15a2d2e64
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-08 11:46:11 +01:00
Eike Ziller
236ea9efb9 Merge remote-tracking branch 'origin/3.0'
Conflicts:
	share/qtcreator/debugger/dumper.cpp
	share/qtcreator/debugger/dumper_p.h
	share/qtcreator/debugger/test/main.cpp
	src/plugins/debugger/gdb/classicgdbengine.cpp
	src/plugins/debugger/gdb/pythongdbengine.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.h
	src/plugins/debugger/lldblib/guest/main.cpp
	src/plugins/debugger/lldblib/ipcengineguest.cpp
	src/plugins/debugger/lldblib/ipcengineguest.h
	src/plugins/debugger/lldblib/ipcenginehost.cpp
	src/plugins/debugger/lldblib/ipcenginehost.h
	src/plugins/debugger/lldblib/lldbenginehost.cpp
	src/plugins/debugger/lldblib/lldboptionspage.cpp
	src/plugins/qbsprojectmanager/qbsstep.cpp
	src/plugins/qbsprojectmanager/qbsstep.h
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas_p.h
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d_p.h
	src/plugins/qmlprofiler/canvas/qmlprofilercanvas.cpp
	src/plugins/qnx/blackberrycheckdevmodestep.cpp
	src/plugins/qtsupport/debugginghelper.cpp

Change-Id: Ie9fd0a885fb6264a6a8a72daee071b75bcbd2e9d
2014-01-08 11:01:06 +01:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Eike Ziller
f161f1a25d Move some BaseTextDocument setup from BaseTextEditorWidget
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>
2014-01-07 11:59:34 +01:00
Eike Ziller
8a2f38683c TextEditor: Remove unused signal.
Change-Id: I50a32f435451ffb8991f5e0c0d7e7da950ce19c9
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-07 11:28:30 +01:00
Eike Ziller
025446b02b Move document -> code assist connect to CodeAssistant::configure
Change-Id: I6124c12a269093fbd54cbbbb47b4d7f15ffaae2f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-12-18 11:37:27 +01:00
Eike Ziller
1adab4c4cc Merge BaseTextEditorWidget::editorDocument() and ::baseTextDocument()
Doesn't really make sense to have the additional IDocument *editorDocument()
method.

Change-Id: I0a7420eb1afaa76f63c3f7e9c4b373acf624ffb9
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-12-18 11:34:34 +01:00
Eike Ziller
b55df87a7b TextEditor: Remove "actionHack" and utilize contexts instead.
The actionHack was used to only forward actions to editors that "belong"
to that action handler instance. That is already clearly defined by the
context that the action handler is created for, so we can just use that
instead.

Change-Id: Ia4c6795c80bb281c1ed258324925f56ca7fd8150
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2013-12-11 16:02:07 +01:00
Eike Ziller
18313bdb33 Move markableInterface() to ITextEditorDocument
And remove the indirection over BaseTextEditorWidget.

Change-Id: I2c570edf46b9ca72a11704ce27d8ae3f2218dcf0
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-12-10 09:11:45 +01:00
Joerg Bornemann
5efee477b6 remove left-over Q_UNUSED macros
Change-Id: I8dd6861219bc8221030a850779baed2a596d5944
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-11-26 13:51:05 +01:00
Orgad Shaneh
c1c25a0704 TextEditor: Allow only a single "select encoding" infobar entry
Change-Id: I2e8ac37b2e980bed88e270ccd10cb7319f1f9ffd
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-11-14 10:45:03 +01:00
Orgad Shaneh
4442a92729 Braces cleanup
Change-Id: I8413252c90a1487d291f15d92837c30ab697b245
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-11-14 08:13:52 +01:00
David Schulz
88c647ce68 TextEditor: Update actions after toggling read only mode.
Task-number: QTCREATORBUG-9188

Change-Id: I3448645397e7a39487f2e961728ebef924eec7f6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-10-30 09:51:07 +01:00
Eike Ziller
c9cf3d1464 TextEditors: Fix document changed indicator in case of splits
Since the changed signal was moved from the editor to the document, we
now need to set up all the connections in the setupDocumentSignals.
Otherwise split editors, which get a different document after creation,
do no longer set up the right connections.

Task-number: QTCREATORBUG-10301
Change-Id: Ifc7b426abf87ab73ea37379c1a55e5af2005fc43
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-10-18 09:00:27 +02:00
Nikolai Kosjar
b8dbac0b9c Rename "[Mm]ethod(s)" to "[Ff]unction(s)"
Only methods as programming functions are affected. Besides renaming
some actions like "Switch Between Function Declaration/Definition" this
mostly touches (api) code comments.

This is a follow-up patch to commit 872bfb7.

Change-Id: Icb65e8d73b59a022f8885b14df497169543a3b92
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-10-10 15:56:12 +02:00
Nikolai Kosjar
713e4dd5e3 Revert "Pass ShortcutOverride events to base class in BaseTextEditorWidget."
This reverts commit 36552d17ea because it
broke Ctrl+v among others.

Change-Id: I1c1eecdc9c3e003e96b9c836cd638ead9a3b444d
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-10-09 17:12:16 +02:00
David Schulz
36552d17ea Pass ShortcutOverride events to base class in BaseTextEditorWidget.
Task-number: QTCREATORBUG-9820
Change-Id: I34493bf655cc2c5bc21d6dadbe2cf668093cfa0a
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-10-09 13:28:44 +02:00
Orgad Shaneh
2e15e54d95 Fix MSVC warning
basetexteditor.cpp:6013: warning: C4189: 'ts' : local variable is
initialized but not referenced

Change-Id: Ia5d6531f8dab8debbb41da79f1cdf152ee831676
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-10-08 13:38:17 +02:00
jkobus
2cbb64e0f9 Fix a crash on codestylesettings
Task-number: QTCREATORBUG-10235

Instead of rely on ICodeStylePreferences::destroyed() signal,
when all other objects might be in destruction phase,
clear project code style settings explicitly, when project
closes.

Change-Id: I0dd6675d54c5495d4006acbc9ad12c95f1d0a00c
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
2013-10-07 11:06:43 +02:00
David Schulz
bd144ab0f5 Editor: TabSettings: Make some functions static.
Change-Id: I99597a22b333c44346eb890ebe615193bdbe66d6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-10-01 15:15:52 +02:00
Nikolai Kosjar
11aeaea86f CppEditor: "Follow Symbol Under Cursor" for virtual functions
F2 on a virtual function call presents a list of overrides in derived
classes. The function declaration of the static type is shown
immediately at the top.

Task-number: QTCREATORBUG-9611

Change-Id: I80ce906fa06272dc9fbd1662cd17500b8c77067f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-10-01 14:23:00 +02:00
Christian Kamm
88e054e845 Autoindent: Don't reindent on every autotext insert.
Currently the line is completely reintented whenever an autoText
insert is being done (like inserting a matching paren). This is un-
necessary as well as actively harmful.

Unnecessary, because the electric character mechanism is already
supposed to trigger reindents where necessary.

Harmful, because the reindent method that is used does not take care
to preserve explicit user indentation. The electric character reindent
does that (by only changing indentation if the actual current indent
is the same as the previously expected indent).

Change-Id: I19db853b6c30792f867baad919bd4eb9b4c23361
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-27 10:47:14 +02:00
Orgad Shaneh
9bf1be7f22 TextEditor: Update circular clipboard on cut
Task-number: QTCREATORBUG-8713
Change-Id: Ic83c78a4caf7f768259c8f6830e7b81016c70e5e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-09-25 09:54:49 +02:00
hjk
ca15d0aa95 Apply static pattern to TextEditorSetting
Change-Id: I4e6f573d893c0aa2bb4ca9812fc8db2961dac172
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-20 10:28:22 +02:00
hjk
8098c085fe Utils: Cleanup of Tooltip interface
Change-Id: If4908e7a5d5ce749ff1e2efc7a026604821737be
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-13 11:35:22 +02:00
Erik Verbruggen
7516ef4969 TextEditor: get CompletionAssistProvider from editor.
And not from the global object pool. This way, the editors that have
different highlighters for various language dialects, or editors that
support multiple languages in a single editor, can decide themselves on
what CompletionAssistProvider to provide.

Change-Id: Ieebc4a8e7b3de6470fdb8103035aa3b8b2ba6598
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-09 10:15:55 +02:00
Christian Kandeler
72d173829c Remove superfluous include paths from project files.
A lot of our build system files specify unneeded include
paths. These roughly fall into the following categories:
    a) Paths that are already set in more general files
       such as qtcreator.pri.
    b) Paths that serve no purpose at all, possibly
       left over from earlier versions of the project.
    c) Paths that act as workarounds for wrong include
       statements of the form '#include "xyz.h"', where
       xyz.h is not in the same directory as the including
      file.
This patch removes such path specifications and fixes the offending
include statements from case c).
Tested on Linux, Windows and OSX with qmake and qbs.

Change-Id: I039a8449f8a65df0d616b4c08081145c18ae4b15
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-02 17:28:17 +02:00
hjk
4a24df38a3 EditorManager: Use static pattern, adjust surrounding code
Change-Id: I3255a0150cd9a730336456c5a9f986eb74fefbff
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-08-30 11:22:56 +02:00
jkobus
e8801167aa Add common interface for text formats inside syntax highlighter
Change-Id: I87f64446161a57aea0896f68e4eafacef791969b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-26 13:39:40 +02:00
Tobias Hunger
ee47b652a6 Snippets: Allow lowercase/titlecase/uppercase modifiers for variables
Use the same syntax already used in the custom wizard to denote
variables that are modified to be lower-/title-/uppercase:

 $tESt:u$ will become TEST
 $tESt:c$ will become TESt
 $tESt:l$ will become test

The snippet will be inserted without any name mangling happening.
Once the editing is done the name mangling is applied to all fields.

Change-Id: I7c1f5a1ad2bb5acf1b88b54de51bb39391c64763
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-08-20 14:49:17 +02:00
Tobias Hunger
b589336e54 Snippets: Move snippet parsing into the snippet class
* Move the code to parse snippets into the snippet class
* Allow to escape $ so that this character can be used in
  snippets
* Add unit tests for the snippet parsing

Change-Id: I134f3c0de8290e1d7fcaf808577b31f5ac8fbc63
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-08-20 14:49:09 +02:00
Tobias Hunger
9de44134c0 Fix whitespaces
Change-Id: I80381a43cdae20654ebecf341a48cb22c1c018e5
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-08-20 13:59:22 +02:00
Erik Verbruggen
073e5d6632 C++: optionally let the highlighter handle ifdefed-out blocks.
Change-Id: I38cc0e55348cac0245d2ab8f3e39c68de76e3e6d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-08-19 13:01:07 +02:00