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>
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>
Widget for Ex and search mode is QLineEdit.
Messages are displayed using QLabel widget with different style for
error, warnings etc.
Change-Id: I4d4f799bbe261febaf6c2c21c01f6b66e1beec6e
Reviewed-by: hjk <qthjk@ovi.com>
They are deprecated in Qt 5. Use fromLatin1() and toLatin1() instead. In
Qt 5, these always do the same thing as their "Ascii" counterparts. The
same goes for Qt 4, provided QTextCodec::setCodecForCStrings has not
been set, which it hasn't.
Change-Id: I04edeb376762b6671eff8156094f0d5e2cb8e1ea
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Command line history should be global.
Keep last submitted command/search visible.
Change-Id: I0fc60786d486eb07c849d016aa23f71875d2cede
Reviewed-by: hjk <qthjk@ovi.com>
Do not wait for incomplete input indefinitely.
Handle shift correctly.
Change-Id: I9b500bd9c29de54008d6b940753fa0cf61217b75
Reviewed-by: hjk <qthjk@ovi.com>
Traverse only history items starting with current command line content.
Clear messages only if necessary.
Change-Id: I6862fe7e32ec0235576e64287481d72c4194e759
Reviewed-by: hjk <qthjk@ovi.com>
While searching for expression that is not found keep text cursor on
position before search.
Make search work with visual mode.
Clear message on escape from search mode.
Change-Id: I44e843a5a16bcc45a1bdc573ecc409654c4eb910
Reviewed-by: hjk <qthjk@ovi.com>
Reset cursor position if search is canceled and always search from
initial cursor position if search expression changes.
Implemented Vim's wrapscan (ws) option.
Task-number: QTCREATORBUG-7251
Change-Id: Ic709cc4fb9dacdb94fbd17f85ac9b75738d5578c
Reviewed-by: hjk <qthjk@ovi.com>
Record jump before changing text cursor position.
Implemented "latest jump" mark (single quote).
Change-Id: Ia3392761f80c185b06ad326718ad9db0d3108d45
Reviewed-by: hjk <qthjk@ovi.com>