Commit Graph

711 Commits

Author SHA1 Message Date
hluk
2e0508ca26 FakeVim: Handle deleted editor widget in insert mode
Change-Id: I7e6585872552a9b4a5bd126e7d01a8f9ea18339a
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-19 12:18:58 +02:00
hluk
a636a933d0 FakeVim: Fix searching in visual mode and with commands
Search in visual mode should select text up to matched position.

Using commands should work with search movement; e.g. 'd2/needle<CR>'.
Commands should be also properly canceled if search movement fails.

Change-Id: Ic695dccaf3f36ccae2f2b1a93f888d5ba9805a78
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-19 12:17:37 +02:00
Nikolai Kosjar
69fc3cf03f Kill ";;" at end of statement
Change-Id: I177094f19978e07f85e42b34701d8f03cd26665e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-04 09:19:10 +02:00
hluk
41785890d6 FakeVim: Escape '>' character in mappings
On some keyboards, '>' character can be produced using Shift key. But
recorded macro shouldn't contain '<S->>', which cannot be properly
parsed, instead it will be '<S-<GT>>' (as '<LT>' for '<').

Change-Id: Iac3759029b6ff8c9e690c4728e35048c0b6046f9
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-29 11:10:36 +02:00
hluk
6c3972680e FakeVim: Operator-pending mappings
Implements :omap (and :onoremap) for defining user mappings for movement
while in operator-pending mode (after commands 'c', 'd', '>' and
others).

Change-Id: I07a1e90bf5c649ef5bb53d1de873817dc7348e19
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-13 15:45:16 +02:00
hluk
9c5ae766a2 FakeVim: Fix scrolling on small movement
Fixes scrolling to center text cursor on screen on j/k and h/l on last
visible line.

Change-Id: I65a1144a99f44a3df4217bc8eb6ee5ae6ef89ad4
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-13 09:51:22 +02:00
hluk
d15fb5a75c FakeVim: Emulate search more precisely
Submitting search highlights (if 'hlsearch' enabled) in visible editors.

Update highlights after 'nohlsearch' command, 'set hlsearch' and
changing document.

Change-Id: I66ed8c6e9c6e99f3c64f91cdec5ac5feb636d2cb
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-12 13:43:36 +02:00
hluk
2890242df5 FakeVim: Fix checking if text was re-inserted
Change-Id: I213ad5c9d6f8d313f07daaceb253a7d03b9035a3
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-12 13:10:15 +02:00
hluk
d935b4cfc6 FakeVim: Use QTextDocument::availableUndoSteps() for undo/redo
Partially reverts commit b9cc16e405.

Using QTextDocument::revision() to keep track which undo/redo command
should be used next doesn't help much and it's more difficult to use
than QTextDocument::availableUndoSteps().

Task-number: QTCREATORBUG-9784
Change-Id: I656e1e964477de0f387c80b9384a32e0d8dab39f
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-12 13:06:58 +02:00
hluk
1843d5ab67 FakeVim: Check first character on line with 'F' and 'T' commands
Change-Id: Icd5c3ca62da0fbff35e2281e04b1fa37a304f64c
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-12 12:50:50 +02:00
hluk
5a02089e3c FakeVim: Record jumps on paragraph and bracket movement
Change-Id: I7e1bfad127a11118606efbf603bbf8a393ec00b0
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-07 10:43:38 +02:00
hluk
76d4084234 FakeVim: Bracket movement commands
Added commands ]], [[, [], ][ for movement.

Task-number: QTCREATORBUG-9527
Change-Id: I0c363427505c9ef6274ed1cf735c9fbc43cb4bd9
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-06 10:56:59 +02:00
hluk
1b13122cd1 FakeVim: Fix Vk command
Fixes visual representation (selection exported to editor widget) of
"Vk" command on empty line.

Change-Id: Iac5fabe53a65d7b94d0a1ed02aff3a7b3804a37b
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-05 18:24:35 +02:00
hluk
e5c323e83a FakeVim: Monitor inserted text using signals from QTextDocument
Use QTextDocument::onContentsChanged() to monitor text inserted and
removed in insert mode for dot command (or just repeat with 2i, 3o etc.)
to re-insert same text.

Works even if auto-completion is replacing '.' with '->' for pointers.

Change-Id: Ie39edcdc9ec60bcf6c7d10f021248c3a0aee76b6
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-05 16:09:54 +02:00
Eike Ziller
e8469a2bab Merge remote-tracking branch 'origin/2.8'
Conflicts:
	src/plugins/fakevim/fakevimhandler.cpp

Change-Id: I8101f18b87859924644471817d4f1408790d5628
2013-06-25 10:14:14 +02:00
hluk
ab41da6a14 FakeVim: Fix how block selection is represented in editor widget
Change-Id: I717276610b6d403d6304bc15dba07d170da0d549
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-06-17 08:33:26 +02:00
Eike Ziller
afe1d5ee65 Merge remote-tracking branch 'origin/2.8'
Conflicts:
	src/plugins/coreplugin/documentmanager.cpp

Change-Id: I6dc025bc0f31eb694c8d9e2dd4ea5cc888ee8a94
2013-06-14 16:21:04 +02:00
hluk
8c944eda89 FakeVim: Fix cursor position and anchor after search
Change-Id: I1e093d042033d87f0382560e00f71d24c7f55b03
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-06-10 18:02:36 +02:00
hluk
79ae5a0f05 FakeVim: Scroll only if it's really necessary
Task-number:QTCREATORBUG-9483
Change-Id: I5836b38fd663aa5471bedd389aa786002791aa6e
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-06-07 09:37:08 +02:00
Eike Ziller
0e3a904b69 FakeVim: Fix build after merge
Change-Id: Ic682320e926de0fbe44846989e45164e6db8986d
2013-06-05 14:32:48 +02:00
Eike Ziller
a503f8bee0 Merge remote-tracking branch 'origin/2.8'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/libs/extensionsystem/pluginmanager.cpp
	src/plugins/coreplugin/documentmanager.cpp
	src/plugins/fakevim/fakevimhandler.cpp

Change-Id: Ibc2adc40bad6f10df94c50d66e78dc3f4bcb84c0
2013-06-05 14:19:43 +02:00
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