Commit Graph

386 Commits

Author SHA1 Message Date
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
hjk
d909d8ba64 debugger/basehoverhandler: introduce tooltipOverrideRequested and use it
Reviewed-by: con
Task-number: QTCREATOR-201
2011-01-04 13:58:05 +01:00
con
b1bcf081d8 Merge branch '2.1'
Conflicts:
	src/plugins/coreplugin/basemode.cpp
	src/plugins/coreplugin/basemode.h
	src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp
	src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h
	src/plugins/debugger/cdb/cdbsymbolpathlisteditor.cpp
	src/plugins/debugger/debuggeragents.cpp
	src/plugins/debugger/debuggeruiswitcher.cpp
	src/plugins/debugger/debuggeruiswitcher.h
	src/plugins/projectexplorer/buildconfigdialog.cpp
	src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp
	src/plugins/qmldesigner/components/propertyeditor/colorwidget.h
	src/plugins/qmldesigner/designercore/include/enumeratormetainfo.h
	src/plugins/qmldesigner/designercore/include/modelutilities.h
	src/plugins/qmldesigner/designercore/include/nodeinstance.h
	src/plugins/qmldesigner/designercore/include/propertymetainfo.h
	src/plugins/qmldesigner/designercore/instances/graphicsscenenodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicsscenenodeinstance.h
	src/plugins/qmldesigner/designercore/instances/graphicsviewnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicswidgetnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicswidgetnodeinstance.h
	src/plugins/qmldesigner/designercore/instances/nodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/qmlviewnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/widgetnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/widgetnodeinstance.h
	src/plugins/qmldesigner/designercore/metainfo/enumeratormetainfo.cpp
	src/plugins/qmldesigner/designercore/metainfo/propertymetainfo.cpp
	src/plugins/qmldesigner/designercore/model/modelutilities.cpp
	src/plugins/snippets/inputwidget.cpp
	src/plugins/snippets/snippetscompletion.cpp
	src/plugins/snippets/snippetscompletion.h
	src/plugins/snippets/snippetspec.cpp
	src/plugins/snippets/snippetsplugin.cpp
	src/plugins/snippets/snippetswindow.cpp
	src/plugins/snippets/snippetswindow.h
	src/plugins/texteditor/snippetsparser.cpp
	src/tools/qml/qmldom/main.cpp
	tests/manual/trk/runner.cpp
	tests/manual/trk/trkolddevice.cpp
	tests/manual/trk/trkolddevice.h
	tests/manual/trk/trkserver.cpp
2010-12-17 17:00:53 +01:00
con
04e32b0049 License headers. 2010-12-17 16:03:42 +01:00
Roberto Raggi
d7e826771d Don't request a new completion when the completion box is already visible. 2010-12-14 12:57:58 +01:00
Leandro Melo
fdbb34adb8 Snippets: Track begin of first selection
Since in the snippets overlay the selections are created with
ExpandBegin the interest is mostly in detecting when the first one
moved to the left (for example, when an undo is performed right
after inserting the snippet). However, this tracking doesn't need
to necessarily be associated with that flag.
2010-12-08 17:22:12 +01:00
Leandro Melo
7eecf3940c Snippets: Synchronize editing of equivalent variables inside snippets.
When editing one variable from a code snippet, all other variables
with the same name are updated accordingly.
2010-12-08 17:22:08 +01:00
Leandro Melo
7528c6d617 Snippets: Feature enhancement start...
Provide an interface so users can create/edit/remove snippets.
2010-12-08 17:22:07 +01:00
Leandro Melo
ea8cb4764b Editors: Move auto-completion code out of the editor
This is basically a continuation of the commits which
refactor code out of the base text editor. For instance,
36fa1de4c6 and
3a684586fa.

Also removed the doXXXX() forwarding methods.
2010-12-01 09:07:15 +01:00
con
af99e09b05 Window title didn't show nice name for e.g. diff views.
Use the editor's displayName for the window title.
Also there were missing change signal emissions in setDisplayName
implementations.
Moves the actual handling of the window title from Session to
EditorManager (so it now is also done for the hypothetical case of no
project explorer plugin).

Task-number: QTCREATORBUG-3207
2010-11-30 13:18:34 +01:00
Francois Ferrand
cda026ee34 Surround selected text with matching symbols on (, [, {, " and '.
Merge-request: 198
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2010-11-24 19:44:54 +01:00
Thorbjørn Lindeijer
68266eae2e Fixed visible wrap column on systems with non-fractional fonts sizes
QFontMetricsF::averageCharWidth seems to always return a fractional size
(at least on Linux/GNOME with DejaVu Mono), even when the font is not
actually drawn at sub-pixels. This caused the visible wrap column to
appear in the wrong place.

As a workaround, use the width of the character 'x', which is pretty
average and does align to pixels when needed.

Task-number: QTCREATORBUG-2746
Reviewed-by: con
2010-11-22 16:41:04 +01:00
Tobias Hunger
f84c228568 Git: Add options to diff editor 2010-11-22 12:03:07 +01:00
con
46d289e4f5 Visible wrap column wrong with fractional font metrics.
E.g. on Mac.
2010-11-15 13:41:23 +01:00
Leandro Melo
5723a73ba5 Editors: Make block highlights go beyond the margin
Block highlights should still be visible even outside the margin (when
margins are displayed naturally), since it acts only as indicator of
the character limit.

Apparently this had already been noticed before and recently there was
a merge request (no. 204) with an attempt to fix it. However, the
implementation was not handling it in a nice form. This is a small
patch that solves the issue and keeps the editor beautiful. (Check
the merge request for more details.)

Reviewed-by: Thorbjorn Lindeijer
2010-11-12 14:06:45 +01:00
dt
4ac7253205 Merge remote branch 'origin/2.1'
Conflicts:
	share/qtcreator/static.pro
	src/plugins/cppeditor/cppeditor.cpp
	src/plugins/qmljseditor/qmljseditor.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.ui
	src/plugins/qt4projectmanager/qtoutputformatter.cpp
	src/plugins/texteditor/generichighlighter/highlightersettings.cpp
2010-11-10 17:02:40 +01:00
Leandro Melo
fb46c31934 Plain text editor: Make sure user setting about folding markers is used
It was being reset based on the highlighter definitions.

Consider some refactoring with the related options as well to avoid
overriding user's settings.

Done-with: Thorbjorn Lindeijer
2010-11-10 16:05:10 +01:00
mae
b14e54b458 Extend camel-case cursor movement
We now have different actions to bind to (saves us an explicit option).
Small fixes to state machines.

Done-with: Erik Verbruggen
2010-11-10 12:54:06 +01:00
mae
d7516902c9 Extend camel-case cursor movement
Fix small issue with forward movement, and overwrite deleting to start
or end of word (normally Ctrl+Delete and Ctrl+Backspace)

Reviewed-by: Erik Verbruggen
2010-11-10 12:26:33 +01:00
mae
87d8adb1c3 Support camel-case for word-wise movement
This was DevDay's 3rd most requested feature

Done-with: Erik Verbruggen
2010-11-10 10:56:32 +01:00
Leandro Melo
c8a53a66ad Editors: Continue refactoring indenters out of the editors.
This is pretty much a complement of commit 3a684586fa,
which is an attempt to make editors and indenters a bit more decoupled.

Reviewed-by: Thorbjorn Lindeijer
2010-11-09 11:01:48 +01:00
Leandro Melo
36fa1de4c6 Editors: Refactor auto-complete code out of the editors for better reusability.
Reviewed-by: Thorbjorn Lindeijer
2010-11-09 11:01:47 +01:00
Leandro Melo
3a684586fa Editors: Refactor indenters out of the editors for better reusability.
Reviewed-by: ckamm
2010-11-05 14:28:38 +01:00
Friedemann Kleint
68d4d35cae Coreplugin: Header cleanup.
Clean icore.h.
2010-11-02 16:53:56 +01:00
mae
8415d0faa0 Fix painting order
text on top of seach results on top of find scope on
top of ifdefed out lines.
2010-11-02 13:48:32 +01:00
Friedemann Kleint
6063fb84c2 Fix exported headers in Core and TextEditor.
- Unexport Core::Internal::MainWindow and remove its includes.
- Move RssFetcher from Core::Internal to Core.
- Unexport CopyTaskHandler.
- Move TextEditor's completion support and Refactor Overlay
  helper classes from TextEditor::Internal to TextEditor as they
  are exported.
- Move internal BaseTextBlockSelection into private header.
- Unexport TextEditorOverlay as they are not used.
2010-11-01 16:29:45 +01:00
Francois Ferrand
c0b02c61d2 Fix margin drawing when disabled code has a 'transparent' background
(default).

Merge-request: 201
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2010-10-26 11:02:49 +02:00
Oswald Buddenhagen
dfee3388af Merge remote branch 'origin/2.1'
Conflicts:
	share/qtcreator/templates/qmlapp/app.pro
	src/libs/utils/filesearch.cpp
2010-10-18 20:59:12 +02:00
Thorbjørn Lindeijer
c5d5657c13 Don't cut off zoomed font sizes to the nearest integer point size
This caused it to go to 0 when for example displaying size 9 at 10%,
which is an invalid value so it caused the text to revert back to the
default size.

It also caused zooming to sometimes appearing to have no effect. For
example zooming size 9 to 110% would still yield size 9 rather than 9.9.

Task-number: QTCREATORBUG-2744
Task-number: QTCREATORBUG-2745
Reviewed-by: Robert Loehning
Reviewed-by: hjk
2010-10-15 17:44:15 +02:00