Commit Graph

790 Commits

Author SHA1 Message Date
Lukas Holecek
9b79adc4ba FakeVim: Handle unicode mappings and properly fail on bad mapping
Task-number: QTCREATORBUG-8774
Change-Id: Ic57a01fc13a073f2b13d16daecba9e070e186779
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-19 18:41:32 +01:00
Oswald Buddenhagen
1ffe15a471 Merge remote-tracking branch 'origin/2.7'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I84145b02bf4f80848c0c1d762de34738f08bb78f
2013-02-18 14:16:53 +01:00
Lukas Holecek
e46a63b93e FakeVim: Fixes for visual delete with end of line selected
Change-Id: I486aff7cf6a81b125a9b3b179505656efe997789
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-18 13:05:23 +01:00
Lukas Holecek
0db85db378 FakeVim: Check if input is [count] for a command properly
Change-Id: I831b87733ca96a31cd9da10375d10998a1722c12
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-18 12:34:30 +01:00
Robert Loehning
80a4fdf329 String fix
Change-Id: Ida86e0e2968d223130d6c081364965eb6a116bcb
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-11 12:42:20 +01:00
Leena Miettinen
d3eddd329b UI text: fixed FakeVim messages
Fixed capitalization and punctualization.

Change-Id: Ib99f8a8cef9f1b92789531aa46e964e0828eaea1
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2013-02-08 16:17:28 +01:00
Kai Koehne
da3b57b83a Fix clang compiler warning
Fix warning 'suggest a space before ";" or explicit braces around
empty body in "for" statement'

Change-Id: Ib4bff046cbdb6756fbcf66000a9197863d4f3b41
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-07 13:51:10 +01:00
Lukas Holecek
e5b304c808 FakeVim: Change current window with count
Implemented commands like <c-w>2<left> (and 2<c-w><left>).

Change-Id: Ic11f3b306fc3f794093a3ee5cad4b8a3563315d2
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-02-06 14:48:05 +01:00
Oswald Buddenhagen
1fda2111d4 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp
	src/plugins/qmldesigner/designercore/include/widgetqueryview.h
	src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp
	src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp
	src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h
	src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp
	src/plugins/qnx/bardescriptormagicmatcher.h
	src/plugins/qt4projectmanager/profilekeywords.cpp
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h

Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
2013-01-31 16:25:33 +01:00
Robert Loehning
298531e370 Incremented year in copyright info
Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-29 16:27:03 +01:00
Friedemann Kleint
e7aded4052 Fix tr()-usage in fakevim.
Change-Id: I21b2fcbe6b638b0b07341c23aac6028607de4fdf
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-01-23 10:49:14 +01:00
Lukas Holecek
2622eb2415 FakeVim: Remember that cursor is at the end of line
Change-Id: I62098a409028593664b813931d5974de5e787993
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-17 11:03:33 +01:00
Lukas Holecek
402affa9c2 FakeVim: First <Delete> is part of dot command in insert mode
Change-Id: I9324c65333c0f893541043e953456e83a9986bf7
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-17 11:02:45 +01:00
hjk
26275fb175 FakeVim: initialize variables
Compiler complains about potential use of uninitialized value.

Change-Id: I120329351983ab795f0dae0ebcc87cd53762f0bd
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-16 19:22:34 +01:00
Orgad Shaneh
29a93998df Remove braces for single lines of conditions
#!/usr/bin/env ruby

Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}

Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 10:48:18 +01:00
Lukas Holecek
2af8015941 FakeVim: Allow to delete selected text in command buffer
Change-Id: Ia3074053da465b5ce999955f428c970f1b01a265
Reviewed-by: hjk <qthjk@ovi.com>
2012-12-30 16:08:36 +01:00
hjk
a570e7327f FakeVim: handle keyboard selection in command buffer
Change-Id: I6a1f605fc77b9af596ee60c5f98e1b3252333284
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: hjk <qthjk@ovi.com>
2012-12-30 11:18:39 +01:00
Lukas Holecek
b74ae13491 fakevim: Set correct cursor column after a command
Set cursor column after some commands and position the cursor on same
column after vertical movement. If line is too short set cursor to the
end of line but don't remember the new cursor column.

Change-Id: I4f5592925b9b360e7393f6ac966025f1466f483d
Reviewed-by: hjk <qthjk@ovi.com>
2012-12-26 15:58:44 +01:00
Lukas Holecek
9a774254bf fakevim: Escape insert command and correct undo position for "I"
Escape inserted string for repeatition, e.g. command "2i<up>" will
insert text "<up><up>".

Undo position for "I" is start of selection or line.

Change-Id: Ic7e6d8dbf712197b36be20b17ef6d1c0814b1a51
Reviewed-by: hjk <qthjk@ovi.com>
2012-12-21 01:10:22 +01:00
Lukas Holecek
3eedd06ce5 fakevim: Restore FakeVim state before any text processing
Restore selection and cursor position (may have been changed externally)
before any text processing.

Change-Id: I424523512f8f83c276e7d29760aad29bf7921dab
Reviewed-by: hjk <qthjk@ovi.com>
2012-12-18 19:41:12 +01:00
Orgad Shaneh
1f74468a56 FakeVim: Compile with QT_NO_CAST_FROM_ASCII
Change-Id: I5ed7bb6f39689d5657709e2ab4a2fa90594abb0e
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Lukas Holecek <hluk@email.cz>
2012-12-09 22:08:51 +01:00
Lukas Holecek
c50c4269ad fakevim: Display visual block selection correctly
Change-Id: Id33544265c0266e0a43a811b5a00aa94dfcc4f37
Reviewed-by: hjk <qthjk@ovi.com>
2012-12-05 19:35:47 +01:00
Lukas Holecek
f50dc8e06f fakevim: Restore last selection with proper position
Command 'gv' restores proper position in selection -- except in visual
line mode ('V') only positions at beginning and end are supported.

Change-Id: I0810808606c340b5c18fe7551a2d5fda29abfeca
Reviewed-by: hjk <qthjk@ovi.com>
2012-12-05 19:35:09 +01:00
Lukas Holecek
05261e4d0b fakevim: Fix word selection in visual mode
Change-Id: I11a9831f2178f818639e04d7aad0eeb6c3f627fc
Reviewed-by: hjk <qthjk@ovi.com>
2012-12-04 23:40:06 +01:00
Lukas Holecek
234a04f814 fakevim: Correct movement mode for yanking lines
Change-Id: I936574d9220d11031e1f68600bec6e33c88808a5
Reviewed-by: hjk <qthjk@ovi.com>
2012-12-04 22:23:48 +01:00
Lukas Holecek
baa4db2499 fakevim: Fix insert mode after visual block selection
Commands in visual block mode '[count]A', '[count]I' and 's' (ignores
[count]) are repeated on every selected line (before or after the block
selection).

Task-number: QTCREATORBUG-8366
Change-Id: I9832656248a8706d1bd4066bd8cf49beded1d8aa
Reviewed-by: hjk <qthjk@ovi.com>
2012-12-04 22:23:14 +01:00
Lukas Holecek
61c3de01a8 fakevim: Commands '[z' and ']z' to move to top or bottom of fold
Commands '[z' and ']z' to move [count] times to top or bottom of current
folds.

Change-Id: Ia087e47bd5f9d63a2b9a4b2ffd3fc57559dfba6b
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-30 14:34:43 +01:00
Lukas Holecek
9d2f1f6769 fakevim: Commands 'zj' and 'zk' to move [count] folds down and up
It's possible to do '2dzj' to delete everything up to beginning of
second unfolded block or whole folded block.

Change-Id: I080c9ec4d12471faf09cabea3c96b448b5fc7f4d
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-30 14:33:44 +01:00
Lukas Holecek
00a10fcfa8 fakevim: Correct undo/redo position for changing numbers
Restore position on undo and redo after <C-A> and <C-X> commands.

Do not set dot command if no number was found.

Change-Id: Ia4e6d53ecfbd7f56e874d6a39c0939557f6cdc3d
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-29 22:44:43 +01:00
Lukas Holecek
5919416eab fakevim: Increase/decrease octal and hexadecimal numbers
Hexadecimal (prefix '0x' or '0X') and octal (prefix '0') numbers are
unsigned. Decimal number can be signed (with leading '-').

Preserve width of hexadecimal and octal numbers (i.e. append leading
zeroes if result is shorter or remove leading zeroes if any and result
is longer).

Change-Id: I93769546ff40a586458986909fcee1e4e9143bc2
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-29 16:53:44 +01:00
Lukas Holecek
ec3f4d3801 fakevim: Handle completion in insert and replace modes
Text inserted without FakeVim's intervention (code completion) is
handled in insert and replace mode so that '.' command also inserts any
externally inserted text.

After movement in insert mode last command (initiated by '.') is not
cleared until new text is inserted.

Deletion in insert mode is part of dot command.

Change-Id: Ic55b3cdecaf4323e88cd321b218fae661de7a63e
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-29 10:40:04 +01:00
Lukas Holecek
0e6041ed45 fakevim: Paragraph movement using '{' and '}'
Change-Id: Ie156438b6633b7e9680e028fca7eca1b8788a63d
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-27 08:19:35 +01:00
Lukas Holecek
6868fedf4d fakevim: Yank with up/down movement ends in same column
Yank followed by vertical movement ends in same column as at the
beginning of the command (or at the end of line if line ha less
columns).

Change-Id: I573a8435ba9b76430fa3778e536726882f4c6ce1
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-27 08:18:27 +01:00
Lukas Holecek
ece5a4a33b fakevim: Merge marks on undo so new marks are not lost
Overwriting a mark with new position and undoing restores the previous
state of the mark.

Creating new mark (not overwriting old value) on a position and undoing
won't remove the mark.

Change-Id: I673874ef9df0aae16f86efe8599a43a77aae19ee
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-26 17:17:37 +01:00
Lukas Holecek
9ed83d4e2b fakevim: Correct visual selection of a quoted object
Change-Id: I76eb6d39efb384cb706847b07bb282a8b2f1a6d3
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-26 17:16:52 +01:00
Lukas Holecek
fc47af3ab7 fakevim: In insert mode <C-J> and <C-M> are aliases for return key
Change-Id: I825d82c8577d2e9163248f4e968e177741683145
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-26 17:16:25 +01:00
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