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>
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>
If invalid range is passed to selectText() it should return empty
string.
Change-Id: I42ec26fb3dad3f1b521370b1a9596f3d52b92a64
Reviewed-by: hjk <qthjk@ovi.com>
Text pasted correctly [count] times and text cursor position
after the operation is same as in Vim.
P and p keys should work the same if pasting to selection.
Change-Id: Ic1cc82a71a2103b13a37e270ad9b7745ff95954d
Reviewed-by: hjk <qthjk@ovi.com>
If register takes its content from clipboard check it it ends with new
line char ('\n' or '\r'). If it does the text can be pasted only on
a new line. This emulates Vim behaviour.
Change-Id: I70ae8b264ba41c3d84a42b1c91f3c4bdb183efd9
Reviewed-by: hjk <qthjk@ovi.com>
Paste from clipboard if register is "" and 'clipboard' contains
'unnamedplus' (otherwise from selection if available and 'clipboard'
contains 'unnamed').
Also correctly parse 'clipboard' option to string list.
Change-Id: Ic78cd2953789c0402f515973ed2eb48fc3e72154
Reviewed-by: hjk <qthjk@ovi.com>
Introduces Vim's special registers "+ and "* and partial support for
"clipboard" option - only values "unnamed" and "unnamedplus" and the
behaviour is only similar.
Task-number: QTCREATORBUG-6342
Change-Id: I1fa95b681edadacfe9690a2fd6eb2e98e7cc5dca
Reviewed-by: hjk <qthjk@ovi.com>
If searching (in "/" command mode) with regular expression "\\b" or
".{0}" the search takes infinitely long.
This fix highlights one character to the right of empty match
(behaviour is similar in Vim).
Change-Id: I5113177cf6af0ef0197e14f0165227e7538a3d1d
Reviewed-by: hjk <qthjk@ovi.com>
Selection anchor should be in front text cursor position.
Last block with nested block should be selected properly.
Change-Id: I796875ef7bce3527fb703ece5fdf944123f12315
Reviewed-by: hjk <qthjk@ovi.com>