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>
Match same text on same regex in forward and backward search modes.
E.g. with '\w\{2}' Vim regex and 'abc' text always match '<ab>c'
(should never match 'a<bc>' as with QTextDocument::find()).
Change-Id: Ie920c76540f3be426fc7b842d38137e95c1a65b2
Reviewed-by: hjk <qthjk@ovi.com>
Code from handleCommandMode*() was moved to separate handle*SubMode()
methods. The common code is in handleCommandMode() which is called on
user input in command mode. This method additionally handles clearing
flags for command submodes.
Method handleMovement() handles movement input. This method is called if
no command is active (from handleNoSubMode()) or if current incomplete
command can be followed by movement (finishMovement() is called to
finalize the command).
Unneeded finishMovement() calls were removed.
Change-Id: Ib5ca5b6ec252224eee3285680572fb9fcefd0d46
Reviewed-by: hjk <qthjk@ovi.com>
Stop processing dot command or user mapping after it's no longer valid.
For example do not process the "text" part of command "ci)text" if
cursor is not in parenthesis block or "ctXtext" if character 'X' was not
found on current line after cursor. In these cases insert mode is not
set.
Change-Id: I54588f3beeb803e42a566f6381352aff7bb602c7
Reviewed-by: hjk <qthjk@ovi.com>
Commands ciw and diw should work on a single character.
Commands ci), di" and similar should work on in an empty block.
Change-Id: Id166a3fb80fc5ba2672231638ce126bd88b4f3ff
Reviewed-by: hjk <qthjk@ovi.com>
Workaround for crash when setting text cursor position while in edit
block (after QTextCursor::beginEditBlock() call and before
QTextCursor::endEditBlock() call).
Task-number: QTCREATORBUG-8148
Change-Id: I7faab2e878efea4106e375b32526ecd5984feac2
Reviewed-by: hjk <qthjk@ovi.com>
Workaround for crash when in edit block and adding text to the last
empty line.
Change-Id: I46b84074bd6f6fbcae698671716e151ebab98f5b
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: hjk <qthjk@ovi.com>
Added change and join Ex commands.
Ex command range and address with /.../, ?...?, \/, \? and \&.
Change-Id: I23f16d3e454f28bcfcf87aeab500830136546345
Reviewed-by: hjk <qthjk@ovi.com>
Automatic indentation, change letter case, correct position after
command.
Change-Id: I3e9659fca82fbc3fa443d593f915931bf7f17e93
Reviewed-by: hjk <qthjk@ovi.com>
Implemented folding commands "za" (toggle fold), "zA", "zR" and "zM"
(toggle/open/close all folds recursively).
Other commands should work with folded blocks, e.g. dd on folded block
deletes whole block.
Folding a block moves cursor to the top of the block. Moving cursor left
or right or unfolding the block again won't restore the cursor position
as it was before folding (in Vim the position is restored).
Change-Id: I9fde30ea9358760419486e092d1032e85f415dc1
Reviewed-by: hjk <qthjk@ovi.com>
Allow increasing/decreasing the first number after cursor position
(cursor doesn't have to be on the number).
Increase/decrease number by [count].
Change-Id: I5f4d41fed43556a46c3b63bea4efcdd6a66a81a4
Reviewed-by: hjk <qthjk@ovi.com>
State variables for the last search should be same for all buffers
(opened files).
Change-Id: I238085db630aeb99ec5c99db960df03e1da88771
Reviewed-by: hjk <qthjk@ovi.com>
Fixed indentation commands with movement and correct behavior in tests.
Change-Id: Idb77427c556f54c75658f806bb6c94402cab52ea
Reviewed-by: hjk <qthjk@ovi.com>
Highlighting text is always case sensitive regular expression.
Fix asterisk and hash search.
Change-Id: Ia41eee9266de4ed9bf0bd221609d8e02b72ada03
Reviewed-by: hjk <qthjk@ovi.com>
Browsing search history shouldn't change last search expression.
If submitted search expression is empty last one is use instead.
Change-Id: I279e2800baa98f48c8592149db16dde81714f24f
Reviewed-by: hjk <qthjk@ovi.com>
Multi-line commands (lines starting with backslash).
Subcommands separated by bar character (|).
Task-number: QTCREATORBUG-7376
Change-Id: I947b10ee5043824278c6ba71e8ebb19dc5787328
Reviewed-by: hjk <qthjk@ovi.com>
Highlight color is taken from current color scheme and changing the text
keeps highlighted matches valid for current search.
Change-Id: I9032b48589ff0c638b04f1bcf3a0e26f422af491
Reviewed-by: hjk <qthjk@ovi.com>