Fix warning 'suggest a space before ";" or explicit braces around
empty body in "for" statement'
Change-Id: Ib4bff046cbdb6756fbcf66000a9197863d4f3b41
Reviewed-by: hjk <hjk121@nokiamail.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>
Set cursor column after some commands and position the cursor on same
column after vertical movement. If line is too short set cursor to the
end of line but don't remember the new cursor column.
Change-Id: I4f5592925b9b360e7393f6ac966025f1466f483d
Reviewed-by: hjk <qthjk@ovi.com>
Escape inserted string for repeatition, e.g. command "2i<up>" will
insert text "<up><up>".
Undo position for "I" is start of selection or line.
Change-Id: Ic7e6d8dbf712197b36be20b17ef6d1c0814b1a51
Reviewed-by: hjk <qthjk@ovi.com>
Restore selection and cursor position (may have been changed externally)
before any text processing.
Change-Id: I424523512f8f83c276e7d29760aad29bf7921dab
Reviewed-by: hjk <qthjk@ovi.com>
Command 'gv' restores proper position in selection -- except in visual
line mode ('V') only positions at beginning and end are supported.
Change-Id: I0810808606c340b5c18fe7551a2d5fda29abfeca
Reviewed-by: hjk <qthjk@ovi.com>
Commands in visual block mode '[count]A', '[count]I' and 's' (ignores
[count]) are repeated on every selected line (before or after the block
selection).
Task-number: QTCREATORBUG-8366
Change-Id: I9832656248a8706d1bd4066bd8cf49beded1d8aa
Reviewed-by: hjk <qthjk@ovi.com>
Commands '[z' and ']z' to move [count] times to top or bottom of current
folds.
Change-Id: Ia087e47bd5f9d63a2b9a4b2ffd3fc57559dfba6b
Reviewed-by: hjk <qthjk@ovi.com>
It's possible to do '2dzj' to delete everything up to beginning of
second unfolded block or whole folded block.
Change-Id: I080c9ec4d12471faf09cabea3c96b448b5fc7f4d
Reviewed-by: hjk <qthjk@ovi.com>
Restore position on undo and redo after <C-A> and <C-X> commands.
Do not set dot command if no number was found.
Change-Id: Ia4e6d53ecfbd7f56e874d6a39c0939557f6cdc3d
Reviewed-by: hjk <qthjk@ovi.com>
Hexadecimal (prefix '0x' or '0X') and octal (prefix '0') numbers are
unsigned. Decimal number can be signed (with leading '-').
Preserve width of hexadecimal and octal numbers (i.e. append leading
zeroes if result is shorter or remove leading zeroes if any and result
is longer).
Change-Id: I93769546ff40a586458986909fcee1e4e9143bc2
Reviewed-by: hjk <qthjk@ovi.com>
Text inserted without FakeVim's intervention (code completion) is
handled in insert and replace mode so that '.' command also inserts any
externally inserted text.
After movement in insert mode last command (initiated by '.') is not
cleared until new text is inserted.
Deletion in insert mode is part of dot command.
Change-Id: Ic55b3cdecaf4323e88cd321b218fae661de7a63e
Reviewed-by: hjk <qthjk@ovi.com>
Yank followed by vertical movement ends in same column as at the
beginning of the command (or at the end of line if line ha less
columns).
Change-Id: I573a8435ba9b76430fa3778e536726882f4c6ce1
Reviewed-by: hjk <qthjk@ovi.com>
Overwriting a mark with new position and undoing restores the previous
state of the mark.
Creating new mark (not overwriting old value) on a position and undoing
won't remove the mark.
Change-Id: I673874ef9df0aae16f86efe8599a43a77aae19ee
Reviewed-by: hjk <qthjk@ovi.com>
After Ctrl+O combination in insert or replace mode enter command mode
and after a single command (can consist of entering Ex command or can be
switch to other buffer) or escape key return to previous insert or
replace mode. One exception is that if entering insert mode is part of
the command after <C-O> pressing escape key will exit to command mode
(Vim behavior).
Change-Id: I37d684b691157001e2cab156687d6771afdec7b9
Reviewed-by: hjk <qthjk@ovi.com>
Correctly convert Vim regular expression with braces to QRegExp.
E.g. [a-z] in case insensitive mode should be [a-zA-Z].
Change-Id: Iea4e0220ef7d82041884f61b3ee0fed9f912e7b0
Reviewed-by: hjk <qthjk@ovi.com>
Use showcmd Vim option to show current partial command.
Removed unneeded updateMiniBuffer() calls.
Change-Id: Iddacd364b7c92882b6169a6894c89cdb202a32bf
Reviewed-by: hjk <qthjk@ovi.com>