Friedemann Kleint
81f14bb270
Fix some code scanning issues.
...
QString: Use QChar/char where appropriate, do not use QString::null
2010-02-02 17:09:41 +01:00
Friedemann Kleint
f672bff338
Fix some code scanning issues.
...
foreach()-Loops.
2010-02-01 14:00:07 +01:00
Friedemann Kleint
2fd8b2d7ff
Fix some code scanning issues.
...
QString: Use QChar where appropriate.
2010-02-01 12:43:56 +01:00
Thiago Macieira
8dca852b35
Fix compilation: #include your headers properly.
...
std::swap is defined in <algorithm>.
Reviewed-By: TrustMe
2010-01-25 10:45:30 +01:00
Martin Aumüller
4d14568afc
fakevim: map 'gt'/'gT' to ':tabnext'/':tabprev'
...
this way, users can override these commands with arbitrary actions,
some want to map switching between the opened files to these keys
Merge-request: 101
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-22 17:05:03 +01:00
Martin Aumüller
a4e34a804a
fakevim: make sure that FakeVimHandler has returned before being deleted
...
some actions might cause the parent editor to be deleted,
don't crash in that case
Merge-request: 101
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-22 17:05:03 +01:00
Martin Aumüller
58571da7a4
fakevim: correct cursor handling for ex commands
...
ex commands might depend on current cursor position and might modifiy
it, thus set the editor's text cursor to fakevim's before initiating the
command and use the editor's text cursor afterwards
Merge-request: 101
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 18:19:58 +01:00
Martin Aumüller
1e46b6232b
fakevim: leave shortcut-passing mode after one shortcut has been pressed
...
this behaviour seems more natural to me, but it has one draw-back: if an
action associated to a shortcut is not enabled, typing that shortcut won't
leave passing mode
2010-01-21 18:10:55 +01:00
hjk
58301f6b10
fakevim: code cosmetics
2010-01-21 17:42:46 +01:00
Martin Aumüller
60f41e9d97
fakevim: fix cursor position and status message for yanking
...
- cursor position should be the start of the yanked region
- the number of lines yanked should be displayed, even when motion was not linewise
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:31 +01:00
Martin Aumüller
6599089c7b
fakevim: don't let 'F'/'T' at the start of a document go into an endless loop
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:31 +01:00
Martin Aumüller
5e30757db6
fakevim: 'g' command prefix flag has to be cleared after it has been consumed
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:31 +01:00
Martin Aumüller
639878a38c
fakevim: '$' and 'l' in visual mode can select beyond EOL
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:31 +01:00
Martin Aumüller
9b2465e37f
fakevim: fix cursor position after 'r'
...
expected cursor position is on last character which was replaced
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:30 +01:00
Martin Aumüller
978fa5d03d
fakevim: fix 'dw' at line-end
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:30 +01:00
Martin Aumüller
9302104cbd
fakevim: make line counting more vi-like
...
- apparently one additional empty line is added to the document at its end,
if the last line ends with \n
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:29 +01:00
Martin Aumüller
07f6d29937
fakevim: ensure that cursor is never at EOL
...
- previously, if the visible vi cursor is on the last character of a line,
the corresponding QTextCursor might have been positioned before and after
the character
- code becomes simpler if the QTextCursor is always positioned before the
vi cursor
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:28 +01:00
Martin Aumüller
7a5891bd2a
fakevim: when leaving visual mode, set move type to char or line according to visual mode
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:28 +01:00
Martin Aumüller
5994044b64
fakevim: 'S' should honour indentation settings
...
fixed by using finishMovement instead of doing all the work
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:28 +01:00
Martin Aumüller
073f14bee8
fakevim: indent when changing text by line ('cj', 'Vc', ...), depending on settings
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:28 +01:00
Martin Aumüller
20f565816b
fakevim: simplifiy implementation of 'j', 'k'
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:27 +01:00
Martin Aumüller
7b28f644f2
fakevim: fix 'c' with linewise motion
...
the lines touched by the motion have to be removed completely except for one newline
(whereas 'd' removes them including all newlines)
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:27 +01:00
Martin Aumüller
f69b867533
fakevim: fix 'cw' on word-end
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:27 +01:00
Martin Aumüller
d323d7701e
fakevim: make 'w' stop on empty lines
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:26 +01:00
Martin Aumüller
fd28fe1892
fakevim: fix deleting/yanking/changing to matching parenthesis
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:26 +01:00
Martin Aumüller
2f02152dd6
fakevim: improved case conversions
...
- make '~' repeatable with '.'
- implement operators 'gu'/'gU'/'g~' for down-casing/up-casing/case-inversion
- visual char/line/block modes for the above
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:26 +01:00
Martin Aumüller
3afcdc002a
fakevim: fix repetition of 'g'/'G'
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:25 +01:00
Martin Aumüller
b0991bd22c
fakevim: fix moving to first non-blank on a line
...
if there are only blanks, first non-blank on line is the last position
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:25 +01:00
Martin Aumüller
b324a7b789
fakevim: implement 'o'/'O' in visual mode for swapping anchor and position
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:25 +01:00
Martin Aumüller
a2a99ca814
fakevim: [n]$ should move to end of (n-1)th line down
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:25 +01:00
Martin Aumüller
bd495ef63b
fakevim: mark '+', '-' and Return as moving by line
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:24 +01:00
Martin Aumüller
f5cf9e55b4
fakevim: fix repeating commands such as 'c4l'
...
before, the count of the motion was not taken into account
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:24 +01:00
Martin Aumüller
c2a79a63ba
fakevim: prevent unhandled keys producing text input from being inserted while in command mode
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:24 +01:00
Martin Aumüller
82b83abd7f
fakevim: 'c' should leave visual line mode
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:24 +01:00
Martin Aumüller
35a6d79026
fakevim: reset command mode state after pressing ESC
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:24 +01:00
Martin Aumüller
5435629250
fakevim: imediately indicate change to REPLACE mode
...
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:23 +01:00
Martin Aumüller
bb4d6a3440
fakevim: fix leaving REPLACE mode
...
previously, the first character typed in command mode would have been inserted into the document
Merge-request: 99
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:38:23 +01:00
Martin Aumüller
355df07072
fakevim: forgot to initialize a variable
...
Merge-request: 97
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:23:32 +01:00
Martin Aumüller
bf607962e5
fakevim: change Find plugin's case sensitivity with ':set (no)ignorecase'
...
- allow for handling unknown arguments to ':set' by the layer having installed the FakeVim handler
- use that to change the Find plugin's case sensitivity
Merge-request: 97
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:23:32 +01:00
Martin Aumüller
de21fef76c
fakevim: update cursor position to start of selection after incremental search
...
the find plugin places the cursor at the end of a found item, but vi at the start,
thus update cursor position when editor widget regains focus
Merge-request: 97
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:23:30 +01:00
Martin Aumüller
d67bd86fb4
fakevim: update document's cursor before triggering search
...
otherwise, incremental search would not always begin at the current cursor position
Merge-request: 97
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:23:30 +01:00
Martin Aumüller
f48ff89988
fakevim: handle forward/backward search depending on initial search ('?'/'/')
...
Merge-request: 97
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:23:30 +01:00
Martin Aumüller
825d1c7932
fakevim: make find next/previous work with incremental search
...
Merge-request: 97
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-21 17:23:29 +01:00
Martin Aumüller
fb1e56cbe0
fakevim: use FakeVim indentation settings instead of creator's
...
Merge-request: 2160
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-15 15:27:42 +01:00
hjk
67027dddb6
fakevim: comment out warning about unhandled commands
2010-01-07 16:25:18 +01:00
Martin Aumüller
f289da3d91
fakevim: implement smart indent
...
use creator's indenter for smartindent mode
- this works like automatic indent w/o fakevim
perhaps this fixes QTCREATORBUG-139
Merge-request: 98
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-06 15:21:17 +01:00
Martin Aumüller
c4fede0fd3
fakevim: use BaseTextEditor's isElectricCharacter
...
in order for automatic indenting to work, isElectricCharacter has to match the language of the document
Merge-request: 98
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-06 15:21:17 +01:00
hjk
b6cae42a62
fakevim: remove spurious executable attributes; also some style issues
2010-01-05 18:48:53 +01:00
Martin Aumüller
f08176cc49
fakevim: [num]'-'/'+' moves to first non-blank of previous/next but ([num]-1)th line
...
Merge-request: 96
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-05 18:48:53 +01:00
Martin Aumüller
29236ea356
fakevim: leave visual mode if entering insert mode
...
Merge-request: 96
Reviewed-by: hjk <qtc-committer@nokia.com >
2010-01-05 18:48:53 +01:00