Currently, pressing Ctrl + Shift + Up/Down with a commented block of
text selected will indent that block if the line two lines above the
block is indented. This is undesirable, because the indenting for that
block is incorrect when it is uncommented. See the following example:
Step 1:
void f()
{
int x;
// int y;
}
Step 2 - After Ctrl + Shift + Up:
void f()
{
int x;
// int y;
}
Step 3 - After uncommenting the block:
void f()
{
int x;
int y;
}
This patch tells the CPP and QmlJs editors not to indent commented
blocks when moving them. Blocks that are not entirely within comments
(excluding whitespace) are not affected.
Tested with (C++ and JavaScript, respectively):
http://paste.kde.org/688778/http://paste.kde.org/688784/
Change-Id: I35414e6dfd5a1084fd997594e711ea9932231981
Reviewed-by: David Schulz <david.schulz@digia.com>
solve problems depending on the destructor sequence:
- avoid setting code style to a destroyed code style
- avoid hiding a potentially destroyed pane
(which will be cleared in any case)
Task-number: QTCREATORBUG-8818
Change-Id: Idd7817d99bf4ff04c5e152b00857f6e35825fd37
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Cleanup code and added shortcuts and menu entries for
- open header/source in next split
- follow symbol under cursor in next split
- open declaration/definition in next split
Change-Id: I2c4347749d26669d88b7c2968f30f60710f442b1
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Removes the "Add/Remove UTF-8 BOM" entry in the context menu
of the project file editor. Also ignores the setting
"Add If Encoding Is UTF-8" under
Options -> Text Editor -> Behavior -> File Encodings.
Task-number: QTCREATORBUG-8501
Change-Id: I368966b5235ee60011f2051ebdb82f9fe09bc4cc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This changes current behavior while opening links. Link is now opened in
next split by default. If you use CTRL+Click to open links, it will also
open in next split. However, by using CTRL+ALT+click it will open in
current split.
There are two new checkboxes in Tools/Options/Text Editor/Display:
- "Open Links in New Split" - if it is checked, links will not be opened
in current split. However, if document with link is already opened, it
will be used to open the split
- "Force open links in next split" - Links will always open in next
split, even if their document is already opened somewhere else.
Task-number: QTCREATORBUG-8117
Change-Id: Ib99075b55d9e9683ed2c2386767227457de0a3fc
Reviewed-by: David Schulz <david.schulz@digia.com>
Moving it to line end scrolls right with long lines
Change-Id: I1fb0cb072a6c57b7e7e53b258567f6842b845fb0
Reviewed-by: David Schulz <david.schulz@digia.com>
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
Currently, pressing Ctrl+Shift+Enter to insert a line above the current
line does not work consistently when the current line is the first in
the document. For example, if the cursor (|) is not on the first line:
1. #include <QDebug>
2.|#include <QTest>
becomes
1. #include <QDebug>
2.|
3. #include <QTest>
after Ctrl+Shift+Enter. When the cursor is on the first line, however:
1.|#include <QDebug>
2. #include <QTest>
becomes
1. #include <QDebug>
2.|
3. #include <QTest>
after Ctrl+Shift+Enter. This patch corrects the above result:
1. |
2. #include <QDebug>
3. #include <QTest>
This is also in line with Eclipse's behaviour, for example.
Change-Id: I542050b6090ed0cfdf613bf67bbd2651eb99ec9d
Reviewed-by: David Schulz <david.schulz@digia.com>
Only start dragging, when a draggable marker was clicked.
Reset drag after releasing mouse button.
Change-Id: I2dc275fc108b55d84b9ff5c69847b116c3307c41
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <qthjk@ovi.com>
Fixes case when cursor jumps on hidden line in folded block which is in
another folded block. All parent folded blocks will be unfolded until
cursor is visible.
Change-Id: I3d41542506d9f40cb9e75d1b2818bc5767384d93
Reviewed-by: hjk <qthjk@ovi.com>
In replace mode highlight parentheses that are right under the block
cursor.
Change-Id: I6cef5fe302b0797c66ed9541d28ec495fb1db1d1
Reviewed-by: David Schulz <david.schulz@digia.com>
After switching from "Overwrite" to "Normal" mode using the Insert-key.
Task-number: QTCREATORBUG-6831
Change-Id: I5507c91318af1f2d2244e9ca978ef9badfd8c2b0
Reviewed-by: Christian Stenger <christian.stenger@nokia.com>
The class' member functions are intended to be used
instead of the Q_OS_* macros in all contexts where
the latter are not syntactically required.
This lowers the likelihood of changes made on one
platform breaking the build on another, e.g. due to
the code model missing symbols in #ifdef'ed out code
when refactoring.
Change-Id: I4a54788591b4c8f8d589b8368a6c683d4155c9fa
Reviewed-by: hjk <qthjk@ovi.com>