Commit Graph

333 Commits

Author SHA1 Message Date
Erik Verbruggen
f6a99f6163 Editor: don't leave snippet mode when user pasts/completes. 2010-09-24 11:35:53 +02:00
Thorbjørn Lindeijer
24548a4d44 Fixed cursor width inconsistency
While it was set to 2 for most editors, some editors, like the .pro file
editor, set another document on the BaseTextEditor, which then did not
get its cursor width set.

Also removed a duplicated line.

Reviewed-by: dt
2010-09-16 18:17:18 +02:00
hjk
80bc682d2e fakevim: more selection refactoring 2010-09-14 17:18:44 +02:00
hjk
fb05c7a9e2 basetexteditor: make block selection accessible 2010-09-14 17:18:44 +02:00
mae
31de38601b Leave block selection mode
The patch makes the editor leave block selection
mode when users continue to select text with
the keyboard. The editor will smoothly convert
to standard selection mode.
2010-09-08 13:43:15 +02:00
mae
ebc305b0d8 Fix: Folded code is deleted on save
Also fixes a crash when folding code at the very end
of the document

Task-number: QTCREATORBUG-2159
2010-09-07 16:38:03 +02:00
Thomas Hartmann
5c72f73d26 TextEditor: update text markers in moveLineUpDown()
When the user moves a block up or down the text markers have to be
updated correctly.
This is done now in moveLineUpDown().
We check if a text marker is in the block that is about to be moved and
set the position of the QTextCursor to the correct value, afterwards.

Reviewed-by: mae
2010-09-07 16:31:23 +02:00
Friedemann Kleint
763b59aa73 Debugger: Fix debugger switching to edit mode.
... on clicking stack frames or disassembler/
memory views.

Introduce flags to openEditorAt, pass
EditorManager::NoModeSwitch where applicable.

Task-number: QTCREATORBUG-2278
2010-09-07 09:51:20 +02:00
Christian Kamm
726985303b TextEditor: Fix extra selection for snippets to match the editable area.
Task-number: QTCREATORBUG-2099
Reviewed-by: mae
2010-08-25 14:34:13 +02:00
Leandro Melo
14ffff317c Better flexibility and extensibility in text editor tooltip's internals. 2010-08-24 13:39:40 +02:00
Kai Koehne
ef1e52dfd1 Merge branch '2.0' of scm.dev.nokia.troll.no:creator/mainline
Conflicts:
	doc/qtcreator.qdoc
	doc/qtcreator.qdocconf
	share/qtcreator/gdbmacros/dumper.py
	share/qtcreator/gdbmacros/gdbmacros.py
	src/plugins/debugger/debuggermanager.cpp
	src/plugins/debugger/gdb/attachgdbadapter.cpp
	src/plugins/debugger/gdb/gdbengine.cpp
	src/plugins/debugger/watchhandler.cpp
	src/plugins/mercurial/mercurialjobrunner.h
	src/plugins/qmljseditor/qmljseditor.cpp
	src/plugins/qmljseditor/qmljseditor.pro
	src/plugins/qmljseditor/qmljseditorplugin.cpp
	src/plugins/qmljseditor/qmljseditorplugin.h
	src/plugins/qmljseditor/qmljspreviewrunner.cpp
	src/plugins/qmljseditor/qmljspreviewrunner.h
	src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
	src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp
	src/plugins/qt4projectmanager/qt4projectmanager.pro
	src/plugins/qt4projectmanager/qtversionmanager.h
	src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp
	src/plugins/qt4projectmanager/wizards/targetsetuppage.h
2010-08-23 16:00:24 +02:00
Thorbjørn Lindeijer
07845306db Fixed the Goto Next/Previous Line actions
Due to the wrong enumerators being used, it was impossible to define
custom shortcuts for these actions.

Reviewed-by: mae
Task-number: QTCREATORBUG-2139
2010-08-23 11:21:03 +02:00
Roberto Raggi
fe1010046f Use QFontMetricsF instead of QFontMetric. 2010-08-06 16:41:57 +02:00
mae
47046ec1ce Fix editor color scheme
Use the defined foreground for search scope instead of calculating
something from background. Support empty foreground for the standard
selections (allows us to match certain popular colorschemes)
2010-08-06 12:59:18 +02:00
mae
29b073e92e Refactor block selection
Block selection was "broken" when using tabs, or rather
incomplete: It treated tabs as normal characters, which
has shown to be unexpected by people using tabs in code.

The new implementation has a vastly improved find scope
as well. In addition, creating a blog selection with
mouse or keyboard feels a lot more solid now, as the
actual selection is detached from possible valid cursor
positions.

Task-number: QTCREATORBUG-1541
2010-08-05 15:26:58 +02:00
Thorbjørn Lindeijer
dace83badc Avoid retriggering the completion box when it's already there
There should be no need for the text editor to request an update of the
completion box, since when it's there it will have focus and update
itself.

Reviewed-by: Roberto Raggi
2010-08-03 14:36:03 +02:00
Roberto Raggi
ac124d39f4 Check the cursor position before to trigger an automatic completion. 2010-07-20 14:36:01 +02:00
Roberto Raggi
a0faf279d5 Delay the automatic completion. 2010-07-19 14:06:19 +02:00
con
cecf9ac25a Move find flags from IFindSupport to more accessible place.
For later use in IFindFilter.
2010-07-15 16:42:31 +02:00
Thomas Hartmann
874a185f53 crash fix
the block might be invalid
2010-07-14 10:42:24 +02:00
mae
72bb7c5c11 Convert semantic highlighter to use additional formats
instead of extra selections. This requires a recent
version of Qt 4.7, the beta 2 will not do.

Done-with: Roberto Raggi
2010-07-13 14:37:48 +02:00
Friedemann Kleint
36f5545f5a VCS[git]: Limit text size to be displayed.
in VCSBaseEditor  and BaseTextEditor::createNew to the size
used for limiting file size.

Reviewed-by: Robert Loehning <robert.loehning@nokia.com>
Task-number: QTCREATORBUG-1847
2010-07-12 14:15:38 +02:00
mae
ab8a8c018d Fix brace states
The lexer needs its own lexerState, before it was using
the syntax highlighter user state. This breaks the brace
depth calculation of the highlighter.

Reviewed-by: Roberto Raggi
2010-07-12 11:18:31 +02:00
Thomas Hartmann
208b3746a6 BaseTextEditor: adding translatedLineRegion()
this function returns the bound region for the text in
lineStart to lineEnd

We use this to position the context pane
2010-07-09 16:10:12 +02:00
Roberto Raggi
8acde74d79 Forked QSyntaxHighlighter from Qt 4.7.
We need our very own syntax highlighter in Qt Creator.
2010-07-09 14:47:18 +02:00
Christian Kamm
c514884207 C++ editor: Drop extra selections before large editing operations.
Updating the text cursors that the extra selections are based on can
get quite slow if there are changes in a lot of positions - like when
reindenting a file.

Dropping some text cursors can increase performance significantly in
these cases.

Done-with: mae
2010-07-06 12:36:20 +02:00
con
e1b74a647e Cut off the forward navigation history to avoid messing it up.
There are cases like when editing, or when jumping to a line, where we
shouldn't cut it though (so we don't).

Task-number: QTCREATORBUG-1535
2010-07-06 12:21:24 +02:00
mae
6ef602d121 add basic support to show refactor markers
See BaseTextEditor::setRefactorMarkers(...). The markers support
a clicked signal via BaseTextEditor and tooltips. They feature
a cursor, but are always positioned at the end of the line (not block!).

As special gimmick they do extend the document width when they
are positioned outside the document area.
2010-07-02 13:48:57 +02:00
mae
6f67360efe Fix long freeze when reloading files
The semantic highlighting and all the extra selections create
many cursors, this does cost time in setText().
Solution: remove all extra selections on reload.

Reviewed-by: Oswald Buddenhagen
Task-number: QTCREATORBUG-1720
2010-06-24 20:15:25 +02:00
Thorbjørn Lindeijer
173cdff56c Merge branch '2.0'
Conflicts:
	src/plugins/cppeditor/cppquickfix.cpp
	src/plugins/mercurial/mercurialjobrunner.cpp
	src/plugins/subversion/subversionplugin.cpp
2010-06-15 13:22:33 +02:00
Thorbjørn Lindeijer
83dba068ce Avoid triggering indent for electric characters in comments and strings
In comments and strings, electric characters have no syntactical
significance and the unnecessary automatic reindent can be annoying.

Reviewed-by: Erik Verbruggen
2010-06-15 12:25:01 +02:00
Erik Verbruggen
05639e4688 Merge branch 'origin/2.0' (early part) 2010-06-15 11:30:51 +02:00
Thorbjørn Lindeijer
6875a50d27 Don't pass QChar as const & since it's just a unsigned short
Reviewed-by: ogoffart
2010-06-14 16:10:35 +02:00
con
7f733b1545 Merge remote branch 'origin/2.0'
Conflicts:
	README
	doc/qt-html-templates.qdocconf
	doc/qtcreator.qdoc
	doc/qtcreator.qdocconf
	src/app/Info.plist
	src/plugins/bineditor/BinEditor.pluginspec
	src/plugins/bookmarks/Bookmarks.pluginspec
	src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec
	src/plugins/coreplugin/Core.pluginspec
	src/plugins/coreplugin/coreconstants.h
	src/plugins/cpaster/CodePaster.pluginspec
	src/plugins/cppeditor/CppEditor.pluginspec
	src/plugins/cpptools/CppTools.pluginspec
	src/plugins/cvs/CVS.pluginspec
	src/plugins/debugger/Debugger.pluginspec
	src/plugins/designer/Designer.pluginspec
	src/plugins/fakevim/FakeVim.pluginspec
	src/plugins/find/Find.pluginspec
	src/plugins/genericprojectmanager/GenericProjectManager.pluginspec
	src/plugins/git/ScmGit.pluginspec
	src/plugins/helloworld/HelloWorld.pluginspec
	src/plugins/help/Help.pluginspec
	src/plugins/locator/Locator.pluginspec
	src/plugins/mercurial/Mercurial.pluginspec
	src/plugins/perforce/Perforce.pluginspec
	src/plugins/projectexplorer/ProjectExplorer.pluginspec
	src/plugins/qmldesigner/QmlDesigner.pluginspec
	src/plugins/qmlinspector/QmlInspector.pluginspec
	src/plugins/qmljseditor/QmlJSEditor.pluginspec
	src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec
	src/plugins/qt4projectmanager/Qt4ProjectManager.pluginspec
	src/plugins/regexp/RegExp.pluginspec
	src/plugins/resourceeditor/ResourceEditor.pluginspec
	src/plugins/snippets/Snippets.pluginspec
	src/plugins/subversion/Subversion.pluginspec
	src/plugins/texteditor/TextEditor.pluginspec
	src/plugins/vcsbase/VCSBase.pluginspec
	src/plugins/welcome/Welcome.pluginspec
2010-06-08 10:39:45 +02:00
mae
530016aa2f Fix cursor positioning for up/down after backspace
Reviewed-by: Roberto Raggi
2010-06-04 13:40:10 +02:00
Erik Verbruggen
5f749306f1 Fixed member initialization order. 2010-06-04 11:47:55 +02:00
Erik Verbruggen
d4c9a47460 Fixed uninitialized members by initializing them. 2010-06-04 11:15:39 +02:00
Thorbjørn Lindeijer
502e86b737 Only do line selection in the gutter when the line numbers are visible
While 2641496a99 removed the marks check entirely, a fix for the same
issue made on the master branch (1263babfc6) changed it to check
whether the line numbers are visible. This is more correct.

Reviewed-by: mae
2010-06-02 13:39:45 +02:00
hjk
5806009d29 Merge remote branch 'origin/2.0'
Conflicts:
	doc/qtcreator.qdoc
	src/plugins/debugger/debuggermanager.cpp
	src/plugins/texteditor/basetexteditor.cpp
2010-06-02 09:57:23 +02:00
Thorbjørn Lindeijer
2641496a99 Fixed line select in gutter when text marks are not visible
The ProjectFilesEditor used for editing the generic project's files does
not show text marks, which broke the line select in the gutter.

Task-number: QTCREATORBUG-1238
Reviewed-by: mae
2010-06-01 13:33:35 +02:00
Thorbjørn Lindeijer
8ffc25bbad Fixed the collapsed block popup to draw on top of cursor/highlights
The various text editor overlays and the text cursor were being painted
on top of the collapsed block popup.

Reviewed-by: mae
2010-06-01 12:01:23 +02:00
Erik Verbruggen
d349cafe2d Fixes rounding errors in block positions.
Influences the position of the folded-block markers.

Reviewed-by: thorbjorn
2010-05-31 15:06:30 +02:00
Jarek Kobus
1263babfc6 Enable line numbers selection in pro editor
Make it possible to select multiple lines in pro editor by d'n'd over
the line numbers like in the cpp editor.

Reviewed-by: mae <qt-info@nokia.com>
2010-05-25 17:58:54 +02:00
mae
886aef937f Merge commit 'origin/2.0' 2010-05-21 16:10:46 +02:00
mae
076c03498f Fix critical vertical block selection issue
Vertical block selections could be painted where there was no
selection, or they could jump randomly to columns futher right.

Reviewed-by: dt
2010-05-21 16:06:31 +02:00
mae
576a8ae799 Fix current line highlighting
we now draw it with alpha, so block highlighting and find scope
paintings shine through
2010-05-20 17:01:58 +02:00
mae
e07c34017e Rework code folding
The new and cleaner foldingIndent in the block user data will
make it easier to support other kinds of indentation for various
other programming languages (like Python).
2010-05-20 15:11:31 +02:00
con
7f4cbe2383 Merge remote branch 'origin/2.0'
Conflicts:
	src/plugins/debugger/moduleshandler.cpp
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemopackagecontents.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemosshthread.cpp
2010-05-20 09:28:00 +02:00
con
04840b0ea7 Fix text highlighting on Mac.
Broke with 8c9a97479a

Reviewed-by: Thorbjørn Lindeijer
2010-05-19 11:40:27 +02:00
mae
8c9a97479a Small fixes for vertical block selection
The find scope was sometimes painted incorrectly, and the last
line was occassionally ommited from the standard selection paint.

Reviewed-by: thorbjorn
2010-05-18 16:02:03 +02:00