Commit Graph

514 Commits

Author SHA1 Message Date
Christian Kamm
8a6d767a8f Refactoring changes: Cleanup and improvements.
Previously RefactoringFiles were usually passed around by value.
However, since a RefactoringFile may sometimes own a QTextDocument
(when it was read from a file), that's not great and caused the
file to be reread after every copy.

With this change RefactoringFile becomes noncopyable and is always
owned by a shared pointer.

This change also allowed having const RefactoringFiles which is
useful because they can be safely used from other threads. See
CppRefactoringChanges::fileNoEditor.

Change-Id: I9045921d6d0f6349f9558ff2a3d8317ea172193b
Reviewed-on: http://codereview.qt.nokia.com/3084
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-19 11:12:09 +02:00
Christian Kamm
a91001d44d BaseTextEditor: Remove stray qDebug.
Change-Id: I544c23aa06d533933162bcc9623ef632981e5053
Reviewed-on: http://codereview.qt.nokia.com/3191
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-08-18 15:36:07 +02:00
Friedemann Kleint
610f77ed33 Header cleanup in TextEditor.
Change-Id: I832d255a4d8f291426d54ad0353641db515a511a
Reviewed-on: http://codereview.qt.nokia.com/3182
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-08-18 14:23:43 +02:00
Leandro Melo
3b0a43802e Editors: Enhance smart backspace behavior
Adds a new smart backspace behavior option. Now it's also possible
to simply unindent (like a backtab). This is particularly useful
when the cursor is not inside an "indentation area" but the user
still wants to go backwards by indent levels when possible (for
example before a comment that appears after the code line). The
option also allows the user to reach a new indent level which has
not been seen so far in previous lines.

The original follows indentation user setting will be lost with this
patch, but we consider this ok for not very "significant" settings.

Change-Id: I49efb6b0309d9b7d7ff2a589413446bc16fb753c
Reviewed-on: http://codereview.qt.nokia.com/3105
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
2011-08-18 10:09:17 +02:00
Christian Kamm
676036a1c8 QmlJS: Allow for more markers than just Qt Quick Toolbar.
Change-Id: Id132b2fd42034a354baa548760083ca47d62697b
Reviewed-on: http://codereview.qt.nokia.com/2904
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-15 12:54:38 +02:00
Eike Ziller
99ba300ae3 Merge remote-tracking branch 'origin/2.3'
Conflicts:
	qtcreator.pri
	src/libs/libs.pro
	src/plugins/debugger/watchwindow.cpp
	src/plugins/remotelinux/maemopackagecreationstep.h

Change-Id: Ic67c46256d0060ee9845b92ef82539f6f8fbe639
2011-08-10 16:03:57 +02:00
Eike Ziller
b1c881ceaa Highlight matches when opening editor from advanced text search.
When you close the search pane it will remove the highlight, even if the
find tool bar is open with a different search, though.

Task-number: QTCREATORBUG-2606
Change-Id: I7defe15c844d37ae80ab66c6b9e68e1ef1afdf92
Reviewed-on: http://codereview.qt.nokia.com/2786
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-08-09 15:44:31 +02:00
Jarek Kobus
0c8df0597f Refactor: Get rid of BaseTextEditorWidget from Indenter
Provide directly TabSettings instead.
This will be used for indenting a text for which
there is no editor instance.

Change-Id: Ia5f11a481f42464cf4820efdf2c7c4c32166f55e
Reviewed-on: http://codereview.qt.nokia.com/2622
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-05 10:29:41 +02:00
Eike Ziller
bfed87f9c4 Avoid multiple context menus popping up.
On Mac in debug mode, right-clicking on extra text area would first open
the markers menu, and after that the menu where you select which debug
widgets to show (like Stack or Locals and Expressions).
Opening the markers menu in a context menu event on the extra area is
both the more sensible thing to do, and works around the Mac
inconsistency.

Task-number: QTCREATORBUG-4699
Change-Id: I38efaffac80a98773deeeada3d0e3ef4f872c03b
Reviewed-on: http://codereview.qt.nokia.com/2434
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-08-01 13:27:49 +02:00
Leandro Melo
d89e2e14f1 Editors: Introduce option to constrain tooltips
It's now possible to have tooltips popup only when the Shift key is down.
This has been requested quite a lot.

Task-number: QTCREATORBUG-5282
Change-Id: Ibc8568737fecbeff981ba97d9f155a70f6072413
Reviewed-on: http://codereview.qt.nokia.com/1881
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@nokia.com>
2011-07-20 15:46:18 +02:00
Christian Kamm
1dfd78a9c8 Indenters: Fix dangling pointer when project settings are deleted.
Task-number: QTCREATORBUG-5390
Change-Id: I68517955a86fbb2ded53f6235a7fe27793e2b2c8
Reviewed-on: http://codereview.qt.nokia.com/1481
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2011-07-12 11:50:53 +02:00
Thorbjørn Lindeijer
405a16292f Extend the editor sidebar background to the folding markers
Previously, there was a gab between the text and the sidebar which
contained the folding markers. This is disturbing for some users.

Change-Id: Ib3c90d9cb01de533d16049bc1a0f5f10f1f7847a
Task-number: QTCREATORBUG-2915
Reviewed-on: http://codereview.qt.nokia.com/355
Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
2011-06-21 13:09:52 +02:00
Leandro Melo
8e84872ace Documentation: Code assist API
Change-Id: Id703725708823edc24171f7c1b28befe99032d63
Reviewed-on: http://codereview.qt.nokia.com/154
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-05-27 08:44:13 +02:00
Christian Kamm
779fafcbfe Make C++ code style configurable.
Change-Id: Iaf08edb2361146e6b5e1cbafdb716a23c938875b
Done-with: Jarek Kobus
Task-number: QTCREATORBUG-2670
Task-number: QTCREATORBUG-4310
Task-number: QTCREATORBUG-2763
Task-number: QTCREATORBUG-3623
Task-number: QTCREATORBUG-567
Reviewed-on: http://codereview.qt.nokia.com/74
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-24 12:45:07 +02:00
Leandro Melo
2b2b5aec23 Editor: Removing comments
They are not really necessary. This workaround is used in quite a few
places. Also, the commit message which introduces them
(230445996816eafaa43e40341f382bf63d9d73a8) is already explanatory.

Change-Id: Idb94ab77b47008e7867b9fba21843778aeaaebb7
Reviewed-on: http://codereview.qt.nokia.com/72
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-05-23 16:22:33 +02:00
Christian Hoenig
10dd9c9a8c Workaround to fix cursor movements with invisible cursor
Task-number: QTCREATORBUG-4957
Change-Id: I730550b4d558a2d7fbe34a4052b6cfc5e27fe6e5
Reviewed-on: http://codereview.qt.nokia.com/71
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-05-23 16:16:15 +02:00
Leandro Melo
bec4f02495 New code assist API
This is a re-work of our completion engine. Primary goals are:

- Allow the computation to run in a separate thread so the GUI is not locked.
- Support a model-based approach. QStrings are still needed (filtering, etc), but
internal structures are free to use more efficient representations.
- Unifiy all kinds of *assist* into a more reusable and extensible framework.
- Remove unnecessary dependencies on the text editor so we have more generic
and easily "plugable" components (still things to be resolved).
2011-05-18 10:46:20 +02:00
Oswald Buddenhagen
9ac137fb06 add auto-saving of modified editors
Task-number: QTCREATORBUG-2847
2011-05-12 20:10:03 +02:00
Oswald Buddenhagen
882e34ee28 rewrite editor info bar handling
the info about the bars is now stored in the IFile, not in the
EditorView. this is somewhat more expensive for the bars which
identically apply to all editors of one type, but fixes consistency
issues between views.

additionally, it is now possible to set several simultaneous
info bars per file, which ensures that no information is lost.

Co-authored-by: mae
2011-05-12 20:10:02 +02:00
Tobias Hunger
aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
con
14487af86c Merge remote branch 'origin/2.2'
Conflicts:
	src/plugins/projectexplorer/gcctoolchain.cpp
	src/plugins/projectexplorer/target.cpp
	src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp
2011-04-27 11:27:29 +02:00
con
a130ebf413 Debug views menu would show after using the text marker menu.
The right-click event that is handled by the extra text area for the
marker menu needs to be accepted, so it's not propagated further as a
context menu event.

Reviewed-by: Friedemann Kleint
2011-04-27 09:25:16 +02:00
Oswald Buddenhagen
fae7dc9584 add errorString output argument to IFile::reload() & IEditor::open()
add/unify read error handling in all affected classes
2011-04-18 14:10:13 +02:00
Oswald Buddenhagen
dc3c156cac Merge branch '2.2'
Conflicts:
	src/plugins/debugger/gdb/pythongdbengine.cpp
	src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp
	src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h
	src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp
	src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.h
	src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
	src/plugins/qt4projectmanager/qt-maemo/qt4maemotargetfactory.cpp
	src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp
	src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp
	src/plugins/qt4projectmanager/qt4target.cpp
	src/plugins/qt4projectmanager/qt4target.h
	src/plugins/qt4projectmanager/qtoptionspage.h
	src/plugins/qt4projectmanager/qtversionmanager.cpp
	src/plugins/welcome/welcomemode.cpp
2011-04-14 12:39:31 +02:00
hjk
70d392d235 core: make context and widget IContext data members 2011-04-14 11:15:07 +02:00
hjk
8397663964 Update license. 2011-04-13 11:49:28 +02:00
hjk
54eac56c00 fakevim: support snippets, by doing nothing.
Reviewed-by: con
Task-number: QTCREATORBUG-4379
2011-04-06 14:56:25 +02:00
hjk
f67e9a54c9 Adjust mark area width to mark width.
Patch by Kevin Funk
2011-03-23 10:49:00 +01:00
hjk
6fd2aaaa32 texteditor: introduce a widthFactor to enable non-quadratic text marks 2011-03-21 17:32:53 +01:00
hjk
a18d0572bd texteditor: simplify basetextmark architecture
ITextMark is not abstract anymore and has an icon and a priority.
This means separate breakpoint and location marker classes that
are only "plain" marks with icons and priorities are not needed.

BaseTextMark directly inherits from ITextMark, instead of owning
an ITextMark derived InternalMark.

Also, there is now ITextMark::paint() to make it a bit more flexible
then icon()[->paint()]
2011-03-21 17:15:02 +01:00
Leandro Melo
126aa9ec39 Editors: Change shortcut for copy line operation
Change the key binding for the copy line operation
introduced at 8ae4317394
to Ctrl+Ins. We already use Shift+Del for the cut line
operation, so this would be CUA consistent.
2011-03-17 11:17:47 +01:00
Kostas Karanikolas
8ae4317394 Added "Copy Line" keyboard command and associated action
Merge-request: 223
Reviewed-by: Leandro Melo
2011-03-17 10:51:46 +01:00
Leandro Melo
e4baf9e359 Editors: Continue indent behavior change...
For single line selection. Following 5e81630a23
2011-03-16 11:12:31 +01:00
Yuchen Deng
5e81630a23 Editors: Change indent behavior for single line selection
When only one line is selected when press the TAB key, should delete
the selected contents, then perform indent.
It like other more editor behavior.

Reviewer notes: Indeed this seems to be a common behavior in other
editors (for example Visual Studio, Code Blocks, Eclipse). But in
order to preserve the indentation consistent with the multiple-line
case it would be nice an approach like Eclipse's: If the single
line is completely selected, do the indentation as usual. Otherwise
remove the selected text.

The author of the request is not able to revise this minor change
because he claims to be busy (and actually asked for the help). So
I will keep this patch in the original state and implement the
detail I mentioned above in a following commit.

Merge-request: 252
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2011-03-16 10:55:43 +01:00
Thorbjørn Lindeijer
9229a9a60b Stop line number label from resizing too often
For example when changing options in the git blame editor, the label
would resize since it took into account the block count, which is
temporarily 0 while the blame is calculated.

Done-with: Tobias Hunger
2011-02-25 16:11:20 +01:00
Thorbjørn Lindeijer
70b70770a4 Fixed layout issues in some editor toolbars
Cleaned up some hacky code in the process.

Done-with: Tobias Hunger
2011-02-25 16:11:20 +01:00
Steffen Imhof
b316970101 Add uppercase and lowercase selection actions to the text editor.
Merge-request: 256
Reviewed-by: Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
2011-02-25 16:11:20 +01:00
hjk
3e7d9bdeff texteditor: directly call completion instead using ITextEditor interface
Reviewed-By: con
2011-02-22 16:55:39 +01:00
hjk
f576ad9f2c texteditor: merge ITextEditable into ITextEditor
rename BastTextEditor->BaseTextEditorWidget, BaseTextEditorEditable->BaseTextEditor
rename BaseTextEditor{,Widget} subclasses
rename editableInterface->editorInterface
rename createEditableInterface->createEditor
minor cleanups after renamings
2011-02-22 11:23:53 +01:00
Leandro Melo
ea313f3ec8 Text editor: Introduce per project settings
With some refactorings to make the code look better.

Reviewed-by: con
2011-02-21 17:22:24 +01:00
Friedemann Kleint
cbafc50acc Debugger: Make tooltips use standard text editor tooltips.
Extend text editor tooltips by a 'widget content', making
it possible to show any widget utilizing the fact that the
QTipLabel actually is a frame (and thus a container).
Introduce concept of 'interactive' tooltips and modify
the tooltip-closing mechanism such that simple interaction
is possible. Emit the base text editor's tooltip signals
with the correct position and add API to calculate the tooltip
position from the cursor position.
Add API for pinning tooltips to the text editor (by removing
them from the QTipLabel layout).
Modify the Debugger's tooltipmanager not to manage tooltips
under TextEditor control and to take over control only once
tooltips are pinned.

Rubber-stamped-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-02-21 16:51:00 +01:00
hjk
ed5f80048a completion: call directly from base text editor
Reviewed-by: con
2011-02-21 14:46:06 +01:00
hjk
9a6c4a42f7 completion: enable multiple completors for different use cases.
Introduce CompletionPolicy enum, use 'TextCompletion' for the new plain
text completion, and 'SemanticCompletion' or 'QuickFixCompletion' for
the existing cases.

Reviewed-by: Erik Verbruggen
2011-02-21 14:04:43 +01:00
con
1d1a5a70c1 Continue on fancy open-vi-in-Terminal AppleScript. 2011-02-18 17:15:36 +01:00
Thorbjørn Lindeijer
7741db1220 Code cosmetics 2011-02-16 11:36:06 +01:00
Leandro Melo
25bacd6a63 Text editor: Fix copying extra line in "Copy Line Up/Down"
... when there's a selection.

Task-number: QTCREATORBUG-3638
2011-02-09 11:24:37 +01:00
Leandro Melo
7ccddd85f2 Text editor: Set cursor after finished editing
With a couple aesthetical simple changes.

Task-number: QTCREATORBUG-3724
2011-02-09 10:35:16 +01:00
Leandro Melo
1a55de5d0e Text editor: Redraw cursor when indenting
The one line patch was submited as part of the report.

Task-number: QTCREATORBUG-3497
2011-02-02 11:10:09 +01:00
con
d1023c7614 It's 2011 now.
Reviewed-by: hjk
2011-01-12 09:46:24 +01:00
mae
2ec0eaf62d Pressing cursor keys did not clear selection
Creator got a feature that pressing cursor keys without effect did not
clear the selection. E.g. Left at position 0, or End at the end of a
block. This was not in sync with other editors. Pressing the cursor keys
without selection modifier should ALWAYS clear the selection.

Task-number: QTCREATORBUG-3327
2011-01-05 13:47:08 +01:00