Commit Graph

790 Commits

Author SHA1 Message Date
hluk
fa022c0ae3 FakeVim: Share state with other editors
Change-Id: I1bcd3bb08745f838db9a1f6ef251f855da9ff315
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-31 11:08:04 +02:00
hluk
55bb2e42fc FakeVim: Select/unselect line break in visual selection
Task-number: QTCREATORBUG-9289
Change-Id: Ic05b71491f8ed625df0ce514182eff916171666a
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-31 10:44:18 +02:00
hluk
2fb8590f87 FakeVim: Fix behavior of 'dw' command
Task-number: QTCREATORBUG-9289
Change-Id: I7ac1c925a13df49d60db410dce2d90b02cac7cfd
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-31 10:44:09 +02:00
hluk
4481a19905 FakeVim: Don't use scroll bar to scroll to line or get first line
Possible scroll bar values (range from minimum to maximum) cannot -- in
some cases -- be linearly mapped to line numbers.

Change-Id: I8833dae057e2be39295f3aae906bb79e16269db7
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-14 16:42:48 +02:00
hluk
ae82e1f333 FakeVim: Fix scroll to bottom
Change-Id: I90a5dd90d1adc79c01724ca650534b62b2c11f78
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-13 08:12:37 +02:00
hluk
1deaed1727 FakeVim: Skip wrapped parts of lines on up/down movement
Task-number: QTCREATORBUG-9278
Change-Id: Ic3d71b3aa39e90dea242dc25a06fde229e187564
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-13 08:10:38 +02:00
Orgad Shaneh
ec84dd058a Fix indentation
Mostly 3 leading spaces converted to 4

A few other indentation issues

Change-Id: Ib0db5925cac4d2999faf5699cd570884cbcd4863
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-06 08:38:50 +02:00
hluk
cf1b82b152 FakeVim: Emulate insert mode more precisely
Set correct position for commands I, A in visual mode.

Don't repeat insert mode [count] times if cursor moved in insert mode
(or after <C-O> command).

Don't repeat movement in insert mode ([count] is used only to repeat
the first inserted text).

Dot command for insert mode should be cleared if cursor moved and user
started inserting a text.

Change-Id: I4dbd0fa4e7ecedc6623838c9ad855f83276da2ce
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-06 08:32:42 +02:00
hluk
ceeb03e47a FakeVim: Allow upper case letters in <nop>
Change-Id: I38534f917fc641decbae06da8db27a73b18d94f6
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-06 08:31:23 +02:00
hluk
e245f2d5f9 FakeVim: Break edit block only after a change
Change-Id: Ice885d3a51d0c5516ddabe8a8bdb9b1ce5ab7a06
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-02 14:52:16 +02:00
hluk
016a926ab7 FakeVim: Window movement with <C-W> and :only
Allow movement with <C-W> and h, j, k, l, plus capital alternatives to
focus furthest split.

Command <C-W>o or :only closes all splits except the current one.

Change-Id: I14ed57cff5d639c22d3eb325560922c10d0c92bf
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-05-02 14:48:04 +02:00
hluk
ecc3c9f0a3 FakeVim: Perform undo/redo at least once
Change-Id: I289cb48cab47f4b0462f00ac490c66607a40dba2
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-24 15:07:49 +02:00
hluk
2a8a411b21 FakeVim: Fixes and more tests for visual block mode
Task-number: QTCREATORBUG-9190
Change-Id: I4cc3ef675f65edafc1d68ae9dd1521656b5bfdb7
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-24 10:16:50 +02:00
hluk
33f4adf072 FakeVim: Keep undo/redo integrity while the plugin is disabled
Change-Id: If17252ecfd7adc6bbe518ce97908f1f8fb2772f1
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-22 09:00:20 +02:00
hluk
2ed88c44fd FakeVim: Don't overuse cursor setting and scrolling in editor
Set new text cursor and scroll in editor widget only if it's only
needed. Sometimes these action can have side-effects.

Set new cursor and scroll especially after no pending input and commands
are available to process for FakeVim.

Change-Id: I47df4d0328ac990e2e5c6981955ea7d1bd608c71
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-19 14:40:30 +02:00
hluk
ea75b0d183 FakeVim: Correctly save input for macro
Change-Id: I648d1ec763c8a49b6d3e1bb5fb13fe1af5ae2368
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-18 09:16:14 +02:00
hluk
a23c3cb863 FakeVim: Use "backtick" mark as alias for "tick" mark
Allows to quickly type jump command ``.

Change-Id: Ie45bcf1bdf840a238e7eea1f97df70979d7d0784
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-18 09:11:59 +02:00
hluk
b9cc16e405 FakeVim: Use QTextDocument::revision() for undo/redo
Using QTextDocument::availableUndoSteps() to get revision of document is
very bad because it undo/redo stack starts to break when maximal number
of undo is reached.

On the other hand QTextDocument::revision() number is always increased,
even on QTextDocument::redo(), so external undo/redo can still break
undo/redo commands in FakeVim.

Change-Id: If1698df8f43a878295eebddd59aebe304cdf3081
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-12 10:29:19 +02:00
hluk
42c6f7cffd FakeVim: Break edit block by editing cursor line
Break edit block at current line so that other line is not marked as
changed.

Change-Id: Iea1c3615899fdd3558861e7f3a319f796c5f247b
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-12 10:26:23 +02:00
Eike Ziller
65654e4a50 Merge remote-tracking branch 'origin/2.7'
Conflicts:
	src/plugins/android/androidrunner.cpp
	src/plugins/clearcase/clearcasesync.cpp
	src/plugins/fakevim/fakevimhandler.cpp
	tests/auto/ioutils/ioutils.pro

Change-Id: I31587b8a4dd6aacc1e76803159da51a972878370
2013-04-08 13:26:37 +02:00
hluk
5041378c6c FakeVim: Enable text transforms to work with 'passkeys' option
Commands like 'ciw', 'gUl' work with renaming and code completion if
'passkeys' option is enabled.

Change-Id: I0cd69e13a0e7773d7cba82e571cc855aa90af7ba
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-08 08:45:25 +02:00
hluk
12deff2fdd FakeVim: Reworked undo/redo
Don't use QTextCursor::beginEditBlock() and others since it can change
the behavior of underlying editor widget. Use these methods only for
interrupting current edit block.

Change-Id: I848d6287faeeaad9c04a76758bd0b2cc673ad2ef
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-08 08:41:32 +02:00
hluk
bea40d99b9 FakeVim: More precise scrolling
Emulate Vim scrolling behavior. Consider only fully visible lines in
editor widget.

Don't ignore last empty line in document.

Change-Id: Id2c4fd744fb3c4c69324ea6456db424186563bc9
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-08 08:37:47 +02:00
hluk
1bea9b98fb FakeVim: Option 'passcharacters' (not in Vim)
Option to pass some key presses in insert mode to editor widget
(replaces 'passnewline'). This allows to rename symbols in insert mode,
complete parenthesis blocks, expand comments etc.

Macro expansion and code-completion works with dot command.

Task-number:QTCREATORBUG-4828
Change-Id: I5ff43818d4f7f183cd6f4ed8cc3a4586469ab65d
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-04 13:50:08 +02:00
hluk
4fc706d7e0 FakeVim: Don't handle user mapping in some commands
Don't handle user mappings in commands that cannot be followed by
movement command. For example, key "<SPACE>" in after "t" command cannot
be handled as user mapping.

Change-Id: I97582d23ae637b30b1058b9d2b381a869bbebb79
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-03 12:33:21 +02:00
hluk
7b885b583d FakeVim: Don't check for "UseFakeVim" in standalone mode
Change-Id: Iad82bcdce429764f3ceef07d9894ab817b844336
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-04-03 12:32:41 +02:00
hluk
2c1b369687 FakeVim: Don't handle key code -1 as ASCII character
Task-number: QTCREATORBUG-9010
Change-Id: I690afd4d5ca4ae95ae910eeb8d1c936cef9d70b2
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-04-02 14:37:47 +02:00
Eike Ziller
599be01a67 Merge remote-tracking branch 'origin/2.7'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	share/qtcreator/qml/qmlpuppet/interfaces/interfaces.pri
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstancesignalspy.cpp
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.h
	share/qtcreator/qml/qmlpuppet/qmlpuppet/instances/objectnodeinstance.h
	src/plugins/debugger/debuggerplugin.cpp
	src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp
	src/plugins/qmldesigner/components/debugview/debugview.cpp
	src/plugins/qmldesigner/components/formeditor/abstractcustomtool.cpp
	src/plugins/qmldesigner/components/formeditor/abstractcustomtool.h
	src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
	src/plugins/qmldesigner/components/integration/stackedutilitypanelcontroller.h
	src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp
	src/plugins/qmldesigner/components/navigator/navigatorview.cpp
	src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
	src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
	src/plugins/qmldesigner/designercore/include/abstractview.h
	src/plugins/qmldesigner/designercore/include/qmldesignercorelib_global.h
	src/plugins/qmldesigner/designercore/include/rewriterview.h
	src/plugins/qmldesigner/designercore/metainfo/metainforeader.cpp
	src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp
	src/plugins/qmldesigner/designercore/model/abstractview.cpp
	src/plugins/qmldesigner/designmodewidget.cpp

Change-Id: I9d8126e88397c02a87b5e4ab4da44e2bc7089134
2013-03-26 13:09:43 +01:00
hluk
70aa000217 FakeVim: Macros with <S-left> and other key combinations
Change-Id: Ie1cc1b290cae271098dd4e82d3ae285ac7013562
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-22 08:22:44 +01:00
Frederik Gladhorn
0d850d7d15 Fix crash when closing editors via vim command.
With a split view open (:sp) closing the split
editor (:on) would crash.

Change-Id: I85defb6b9d3e1d63a524eab5ebf2be368d8ccc33
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-20 14:19:11 +01:00
hluk
0f25f0c89b FakeVim: Initial support for Vim macro recording and replaying
Record macro with 'q{0-9a-zA-Z"}' command and replay it with
'@{0-9a-z".*+}'. Replaying with prompt ('=' instead of register) not
supported.

Change-Id: I49965a99d10910e8df09e62020ed496542e3b249
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-18 17:18:35 +01:00
hluk
92bd228e95 FakeVim: Correct range mode for registers
Change-Id: Ib58ced12ab8cff5917e17b8fc5022147d6f99f38
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-18 17:16:39 +01:00
hluk
474459f45f FakeVim: Refactored user mappings code
Change-Id: Ib32a97814ce5dc36a5d5ae3cba59bf4968525bad
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-18 17:15:08 +01:00
hluk
4f20799af2 FakeVim: Clear count after insert mode
Change-Id: If02aaecbbbb5e25001d5bafafd0d4228bba5d63e
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-18 17:13:45 +01:00
hluk
dab57db8f4 FakeVim: Properly clear bad mapping
Change-Id: Ia2a1b04962976b119d2190a02aba0ec01b451e43
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-18 17:13:02 +01:00
hluk
70adf53fbd FakeVim: Option 'passnewline' (not in Vim)
Option 'passnewline' ('pnl') passes new line in insert mode and on 'o'
and 'O' commands to editor widget. This way the editor widget can handle
the indentation or insert characters (e.g. asterisk if in C block
comment).

Change-Id: I06afab6b20b49e1b4d31447826c847d36d32806f
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-18 17:11:53 +01:00
hluk
f2f0bf5376 FakeVim: Emulate Vim option "tildeop" ("top")
Change-Id: I61a07f5edc0e2a062ca10cb17f489ac3ce113d9f
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-14 16:22:17 +01:00
hluk
0a86efb8a0 FakeVim: Tilde command moves text cursor to the right
Change-Id: Ieff36ffa06b39dd7ff55551dd0fec627b8561939
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-14 16:21:31 +01:00
Lukas Holecek
ca5b956ab5 FakeVim: Emulate Vim option ignorecase
Change-Id: I0dc87f8a34fa458a9eab14440f7ad2ac2cfe0a98
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-13 12:35:44 +01:00
Lukas Holecek
4394b798bb FakeVim: Correct position after :read
Change-Id: Ibffc3c271c6690653a47fcbe47c29acf6d93a113
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-13 12:14:35 +01:00
Lukas Holecek
db8722fdd8 FakeVim: Emulate Vim option "scrolloff" ("so")
Change-Id: Ied0a85ec834232a040b447d70f113daca9e4c035
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-12 08:35:26 +01:00
Lukas Holecek
96ad87376c FakeVim: Fix commands z., zz, zb, z- (swapped center and bottom)
Change-Id: I0b2064c2d8006435038deafed35fb0169b45e47e
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-12 08:18:03 +01:00
hjk
d44bac6f43 FakeVim: Make plugin standalone if necessary
It's possible to use FakeVim as standalone plugin for a QTextEdit or
QPlainTextEdit widget, so there should be minimum dependencies on
Qt Creator code.

Change-Id: I415ed87f5e4d97ea78d9d25a8f0c82701ef1f70d
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-08 17:53:14 +01:00
Friedemann Kleint
d1fde7ab2c Fix Krazy-warning about non-const ref iterator in fakevim.
Change-Id: I9b9ec78d75d3ea4e00f94b715995d65a7c75e674
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-03-08 10:26:44 +01:00
Lukas Holecek
128fa2d64d FakeVim: Correctly parse delete key as user input
Change-Id: I8e0b5cb1c360bd02a48becf87e27398631c414e2
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-28 16:04:53 +01:00
Lukas Holecek
5b4066aff2 FakeVim: <S-Insert> to insert text from clipboard
Mapping <S-Insert> is alias of 'p' in command mode and inserts clipboard
content in insert mode.

Change-Id: Id53890ee4e7df0140fe1e0791d620bda315f3924
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-28 15:39:17 +01:00
Lukas Holecek
a2be7db81c FakeVim: Fix usage of copy/paste registers with tests
Change-Id: I9b860a40a9b18286a25e1d919dab1c21ea5def10
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-28 15:13:20 +01:00
Debao Zhang
f5dcd55117 Qt5: Don't use the deprecated {QString,QChar}::fromAscii()
Change-Id: Ic1d302c2186b11ffec5139f4f491d477d334ec8f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-02-26 15:24:26 +01:00
Lukas Holecek
8d295948e0 FakeVim: Correct key mappings with Qt 5
Task-number: QTCREATORBUG-8774
Change-Id: I4b7e90a99e9ff2f56f14f28636fe32fe39b4d4b8
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-23 22:47:21 +01:00
Lukas Holecek
d58415ed3e FakeVim: Fix search in Qt 5
In Qt 5, QTextCursor::movePosition() with QTextCursor::Right as move
operation will not move the cursor if it's at the end of line/block.

Change-Id: I5fce9674f2031d54c69d89f93ffaa9d2e89b4fc4
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-23 12:52:15 +01:00