Commit Graph

754 Commits

Author SHA1 Message Date
Lukas Holecek
2e1f898c9d fakevim: <C-W> in insert mode stops deleting at end of previous line
Change-Id: I6733c0de42215b9cf2f662836e4e5956eab1c0e2
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-26 17:16:03 +01:00
Lukas Holecek
6547845d27 fakevim: Fix movement with '%'
Change-Id: I6c4bf3b39b334ae621e4648bbc57f50ba8d418ec
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-26 17:15:28 +01:00
Lukas Holecek
6e5018ef5d fakevim: Fix inclusive/exclusive delete
Change-Id: I1b46bda3f70a533d149cf38de02d89e2cf706f3f
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-26 17:13:42 +01:00
Lukas Holecek
a99874c0db fakevim: Correct cursor position after 'J'
Change-Id: Iff0c719c6b301dac333a55acfb073c7d1e1a27c8
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-26 17:12:53 +01:00
Lukas Holecek
477285b93c fakevim: Correct cursor position after yank
Change-Id: I845eeebe44ed859cc96d69fbd660fce56cc1418b
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-26 17:11:05 +01:00
Lukas Holecek
611be1ae19 fakevim: Command 's' has exclusive motion
Change-Id: I3d4642ebf69055722568cf0e59f5480ad5b2c418
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-26 17:10:29 +01:00
Lukas Holecek
ab7ef16030 fakevim: Correct visual selection of a text object
Change-Id: Ib4996a88d1bbbec25ab864a37f62825e5b0a2b27
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-22 18:39:11 +01:00
hjk
bfd5519caf fakevim: compile fix
Change-Id: I9b82afa882845e9a3d251619ad87fe18343b6a7a
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-22 10:29:21 +01:00
Lukas Holecek
66aa861c51 fakevim: Allow to set g flag for movement
Enabled commands are for example 'dgg', 'cge', 'y10gg' etc.

Change-Id: I084991f1d352ee8bcec97cf756f7884d64b4e502
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-22 08:27:07 +01:00
Lukas Holecek
f302f3b8c2 fakevim: <C-O> to execute single command and return to insert mode
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>
2012-11-22 08:26:11 +01:00
Lukas Holecek
9ab2d3d0a7 fakevim: Removed 'J' from movement commands
Change-Id: I5d3e39c6ea717008a3e555f4370827ed876affd1
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-22 08:24:45 +01:00
Orgad Shaneh
74387106d3 Fix build
qt-creator/src/plugins/fakevim/fakevimhandler.cpp:409:64: error: ambiguous overload for ‘operator+’ in ‘(& c)->QChar::toLower() + (& c)->QChar::toUpper()’
qt-creator/src/plugins/fakevim/fakevimhandler.cpp:409:64: note: candidates are:
/usr/include/qt4/QtCore/qstring.h:1021:22: note: const QString operator+(const QString&, const QString&)
/usr/include/qt4/QtCore/qstring.h:1023:22: note: const QString operator+(const QString&, QChar)
/usr/include/qt4/QtCore/qstring.h:1025:22: note: const QString operator+(QChar, const QString&)

Change-Id: I7f3c1b7a8fa13d01fd020eb828eb33970cf18a67
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2012-11-20 19:16:36 +01:00
Lukas Holecek
216db6320c fakevim: Fix search for [a-z]* and other character ranges
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>
2012-11-20 10:47:31 +01:00
Lukas Holecek
f31da9ac55 fakevim: Show current command in minibuffer (showcmd option)
Use showcmd Vim option to show current partial command.

Removed unneeded updateMiniBuffer() calls.

Change-Id: Iddacd364b7c92882b6169a6894c89cdb202a32bf
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-20 08:29:37 +01:00
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
29c448edb1 fakevim: Methods for handling input in sub-modes
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>
2012-11-16 17:30:50 +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
Lukas Holecek
afc8cd6932 fakevim: Fix crash when adding text to last line
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>
2012-11-02 09:24:55 +01:00
Lukas Holecek
82a55d4b9e fakevim: Global file marks
Uppercase marks for jumping to a line in a different file.

Change-Id: I2f05389956e1f3d6ae557f6545de3bec30673203
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-02 08:16:21 +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
hjk
908ae71092 fakevim: fix repetition of <count>~
Change-Id: I215959b6bb2bfb77277f4b19389d98e00d04b7d5
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-26 09:06:13 +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
hjk
ac485f3e1b fakevim: compile fix
Change-Id: Idf87513c32a6d9ab12bf1f67b7165a21b852645b
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-18 13:59:31 +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
9bf725af2c fakevim: Added basic code folding
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>
2012-10-10 11:25:06 +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
Eike Ziller
6fd252b0a5 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.cpp
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessageloghandler.h
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/madde/maemodeployconfigurationwidget.h
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentinfo.h
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	src/plugins/remotelinux/remotelinuxdeploymentdatamodel.h
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/ichecklib_global.h
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h
	tests/manual/ssh/tunnel/tunnel.h

Change-Id: I04d7761df6bd936ad00e0547974284c967d39580
2012-10-05 21:20:50 +02:00
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00
Lukas Holecek
ca48d81c28 fakevim: Searching with star and hash should escape regex
Change-Id: Ia1db4eca8841209eb960191221606d94b216e3b6
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-04 18:01:14 +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
41b963934d fakevim: Search state should be global
State variables for the last search should be same for all buffers
(opened files).

Change-Id: I238085db630aeb99ec5c99db960df03e1da88771
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-04 10:21:36 +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
3e6ac65444 fakevim: Fix search issues
Highlighting text is always case sensitive regular expression.

Fix asterisk and hash search.

Change-Id: Ia41eee9266de4ed9bf0bd221609d8e02b72ada03
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-02 09:00:41 +02:00
Lukas Holecek
dcfd97d41d fakevim: Fix search for last submitted expression
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>
2012-10-01 09:41:04 +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
da31e05af0 fakevim: Fix map handling in Ex mode
Change-Id: I23b280351de0e57df751fe5530fec8b3dd9e197d
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-01 09:37:04 +02:00
Lukas Holecek
c1755d4d69 fakevim: Highlight matches using Find::IFindSupport
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>
2012-09-28 14:51:20 +02:00