Commit Graph

30 Commits

Author SHA1 Message Date
Lukas Holecek
cd7c91d440 fakevim: Match same text with same regular expression
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>
2012-11-19 08:54:10 +01:00
Lukas Holecek
88814c64b5 fakevim: Stop dot command or mapping after an unhandled input
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>
2012-11-07 18:11:17 +01:00
Lukas Holecek
709c142717 fakevim: Fix commands ci* and di*
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>
2012-11-06 17:34:16 +01:00
Lukas Holecek
67bf8aa863 fakevim: Fix crash when setting cursor position in edit block
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>
2012-11-06 16:27:14 +01:00
Lukas Holecek
f4626e6850 fakevim: Fix exclusive movement type for some commands
Change-Id: Ia9dc3a7063b921bd90bddd52e1df1e6b8b8b3796
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-02 17:41:32 +01:00
hjk
376ddd5d74 fakevim: start consolidation of both test suites
This moves the stand-alone tests into the plugin.

Change-Id: Ic6da45236b080b6c905849898729b19df54a1527
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-01 17:16:15 +01:00
Lukas Holecek
94d36078aa fakevim: Better input key comparison
Change-Id: I47ca07f8ef54f8f7f38d467ea0aa2c087ee95a37
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-31 19:03:53 +01:00
Lukas Holecek
c55620000c fakevim: Undo/redo last selection and cleanup
Change-Id: I09b825349c01e2cbcebc446fdf8843aaf8793e6f
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-31 15:04:17 +01:00
Lukas Holecek
f7fa450a1c fakevim: Improved range modifying Ex commands.
Added change and join Ex commands.

Ex command range and address with /.../, ?...?, \/, \? and \&.

Change-Id: I23f16d3e454f28bcfcf87aeab500830136546345
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-29 10:04:57 +01:00
Lukas Holecek
8994bb2d4a fakevim: Added move and yank Ex commands
Change-Id: I4138a2035e338b665d91704b7c53117c4d924472
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-26 09:31:10 +02:00
Lukas Holecek
49a337f235 fakevim: Fix last position and selection (marks)
Change-Id: If75164be930dac3c4f3b9c26179ee54aa643ab4e
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-25 00:29:20 +02:00
Lukas Holecek
80b737252b fakevim: Fix substitute command
Command separator (bar character) shouldn't break substitute command.

Escape substitution text.

Change-Id: I9a793ab2df167d5d8a2b4de22329d061fc169785
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-23 08:16:11 +02:00
Lukas Holecek
5a809353d9 fakevim: Fix insert modes
Change-Id: I8efb89e6931be2c37cfaf82f0aa053317c6b8d93
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-21 13:11:00 +02:00
Lukas Holecek
ba86ddcc44 fakevim: Ignore user mappings with 'r' and other commands
Task-number: QTCREATORBUG-7913
Change-Id: Ic9efd579556acc78736d7562c46adee83e971074
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-21 13:09:43 +02:00
Lukas Holecek
1586737596 fakevim: Single command integrity (undo, redo, repeat)
Change-Id: I7e12092fd8928f34306a40b76a8ec7e6afe4a050
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-20 14:57:12 +02:00
Lukas Holecek
8e8c8e49ce fakevim: Various fixes
Automatic indentation, change letter case, correct position after
command.

Change-Id: I3e9659fca82fbc3fa443d593f915931bf7f17e93
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-18 09:51:34 +02:00
Lukas Holecek
49e7ec748e fakevim: Use internal editor widget in tests
Use internal editor with highlighting and folding support for tests to
be able to check folding commands.

Change-Id: Iaab3bc9edb65c8e2a5a7efc4456e021c8a178d7f
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-17 20:30:20 +02:00
Lukas Holecek
8bed5c33f9 fakevim: Fix cursor position after pasting text at end of line
Change-Id: I5017d5f6987cea12b1eb26212fbe5fe813bf73cb
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-09 13:15:39 +02:00
Tobias Hunger
3b80507af3 License changes
Change-Id: Ie8d2adaa2b20473d2e3e16d1f44ad951ff2744be
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-09 12:23:22 +02:00
Lukas Holecek
1e6cd8af47 fakevim: Improved number transformations in Vim
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>
2012-10-04 18:00:09 +02:00
Lukas Holecek
d2bf853ca1 fakevim: Star and hash search with g
Added g* and g# commands to search without \<, \>.

Change-Id: I74f010f2415e4d493be9925ab047a1c06f35d7a9
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-04 09:43:36 +02:00
Lukas Holecek
f357502984 fakevim: Improved repeat command
Repeat commands in visual mode correctly.

Task-number: QTCREATORBUG-7248
Change-Id: I937688f669f9bb9e1ad5f64b42dc0ee56dc3ca38
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-04 09:43:01 +02:00
Lukas Holecek
ceaedb0883 fakevim: Correct Undo/Redo position for large editing operations
Change-Id: Ie5d354a0e7f59c61646d14da79bf7059821c12e5
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-02 12:09:53 +02:00
Lukas Holecek
37c3dbc57d fakevim: Fix text indentation commands
Fixed indentation commands with movement and correct behavior in tests.

Change-Id: Idb77427c556f54c75658f806bb6c94402cab52ea
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-02 09:03:09 +02:00
Lukas Holecek
6268f943d0 fakevim: Improve Ex command handling
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>
2012-10-01 09:40:33 +02:00
Lukas Holecek
e767fb28fa fakevim: Improved mappings handling
Implemented special key names (e.g. <left>, <space>, <leader>,
<backspace>).

Disallow mapping with <nop>.

Change-Id: I8f4cdc84cb469db0b5cddd9059484cce7aa1b17f
Reviewed-by: hjk <qthjk@ovi.com>
2012-09-12 14:23:05 +02:00
Lukas Holecek
3841b85418 fakevim: Fix searching
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>
2012-09-10 12:05:07 +02:00
Lukas Holecek
4503ce663a fakevim: Improved searching
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>
2012-09-04 09:41:28 +02:00
hjk
aa118de9ec fakevim: make test compile
This is a workaround. The real problem is a source incompatibility
from Qt4 -> Qt5 (beta). QSKIP wants 2 arguments in the first, and
1 in the latter case.

Change-Id: I11e914f378baf492cce62333a8284ba2a11bf61d
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
2012-09-03 17:08:34 +02:00
Lukas Holecek
a897a3b00a fakevim: Added tests
Change-Id: I6b6e54817bf41402f5575142b1adb9362c717439
Reviewed-by: hjk <qthjk@ovi.com>
2012-08-31 08:41:39 +02:00