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>
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>
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>
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>
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>
Mostly 3 leading spaces converted to 4
A few other indentation issues
Change-Id: Ib0db5925cac4d2999faf5699cd570884cbcd4863
Reviewed-by: hjk <hjk121@nokiamail.com>
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>
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>
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>
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>
Break edit block at current line so that other line is not marked as
changed.
Change-Id: Iea1c3615899fdd3558861e7f3a319f796c5f247b
Reviewed-by: hjk <hjk121@nokiamail.com>
Commands like 'ciw', 'gUl' work with renaming and code completion if
'passkeys' option is enabled.
Change-Id: I0cd69e13a0e7773d7cba82e571cc855aa90af7ba
Reviewed-by: hjk <hjk121@nokiamail.com>
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>
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>
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>
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>
With a split view open (:sp) closing the split
editor (:on) would crash.
Change-Id: I85defb6b9d3e1d63a524eab5ebf2be368d8ccc33
Reviewed-by: hjk <hjk121@nokiamail.com>
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>