Alex Plate
d0a39ef32f
[VIM-1425] Fix % command
...
Command % worked wrong when
- There was '\\' character on the way
- Inside strings
2019-04-11 16:09:57 +03:00
Daniele Megna
0f5ca758b8
Implement TabOnlyHandler
2019-04-07 11:42:50 +02:00
Alex Plate
4b49bb6d18
Merge pull request #180 from gecko655/VIM-1067
...
Fix issue VIM-1067: Repeat commands deletes End Of Line character when repeating "append to end of line" ('A') command.
2019-04-01 19:56:15 +03:00
Alex Plate
465ed569a1
Merge pull request #178 from sumoooru2/master
...
Fix findBlockRange
2019-04-01 19:48:59 +03:00
jonatantierno
c717bed4fb
Command gn
2019-03-16 14:47:09 +01:00
gecko655
170bff5a3f
Added tests for VIM1067
2019-03-11 00:43:25 +09:00
sumoooru2
b55615fffa
Add a unit test
2019-02-28 18:36:05 +09:00
Simon Rainer
990caaa75d
VIM-1090 VIM-1100 fix tag motion with duplicate tags.
2019-02-24 11:32:35 +01:00
Daniel Leong
00dc6fe775
Preserve caret position (only) for linewise comments
2019-02-22 20:31:25 -05:00
Daniel Leong
3fa9f258d7
Add an HTML filetype test
2019-02-22 20:01:03 -05:00
dhleong
6a6632e363
Fix visual-mode gc
action
2019-02-22 10:11:31 -05:00
dhleong
245c48d78f
Only pass extra keys for prevMappingInfo if necessary
...
That is, if the mapping info we're using *is* the prevMappingInfo.
If it's not, that means the prevMappingInfo was part of a prefix that
the currentMappingInfo completed
2019-02-22 10:11:31 -05:00
dhleong
e5d880b516
Update base ambiguous mapping tests
2019-02-22 10:11:31 -05:00
dhleong
ff02161062
Improve tests for more depth, cover gc(motion)/gcc issue
...
The failing gc(motion) tests seem more like implementation bugs
than anything else, but the the issues `gcc` with are unexpected
2019-02-22 10:11:31 -05:00
dhleong
0475610f59
Another attempt at comment motion extension
2019-02-22 10:11:31 -05:00
Alex Plate
6565ad8e96
Update copyright on test files
2019-02-21 12:56:20 +03:00
Alex Plate
c0819a83f0
Create ignored tests for VIM-714 issue
2019-02-21 12:45:15 +03:00
Alex Plate
cdff9e28a1
Support some increment and decrement commands
2019-02-20 16:10:44 +03:00
Alex Plate
687a601772
Add Tony Arra to contributor list
2019-02-19 19:56:18 +03:00
Alex Plate
a38231fb1b
Merge pull request #172 from TonyArra/VIM-1569
...
VIM-1569: Strip tag attributes from closing tag for Vim-Surround
2019-02-19 19:45:54 +03:00
Alex Plate
740abc1e70
Use enum for storing command flags
2019-02-19 16:43:23 +03:00
Alex Plate
7e23fca598
New style of command definition
2019-02-18 21:32:23 +03:00
Alex Plate
1a91f0cbcb
Convert SubstituteHandler to kotlin
2019-02-15 19:17:37 +03:00
Alex Plate
21b9b1d7f1
Convert ShiftRightHandler to kotlin, write tests for handler
2019-02-15 17:54:32 +03:00
Alex Plate
bd36a6d528
Convert ShiftLeftHandler to kotlin, write tests for handler
2019-02-15 17:48:26 +03:00
Alex Plate
b114f4ee96
Flaky test remove
2019-02-15 14:58:49 +03:00
Alex Plate
1b61598149
Convert NextFileHandler to kotlin
2019-02-14 17:41:55 +03:00
Alex Plate
2cfc180df7
Convert MarkHandler to kotlin. Write tests for :mark command
2019-02-14 16:29:06 +03:00
Alex Plate
6dc9843aa9
Extract "%" tests into separate file
2019-02-14 13:53:49 +03:00
Alex Plate
7bccc2fbdb
Merge pull request #127 from vedran/master
...
Support end-of-line multi line percent match in visual mode
2019-02-14 13:14:56 +03:00
Alex Plate
278a2dfc07
Convert SearchGroupTest to kotlin. Add offset tests (e, b, s, +-1)
2019-02-13 15:02:56 +03:00
Alex Plate
99c6b4552a
Merge pull request #126 from durandom/offset_in_slash
...
Make offset work in normal search
2019-02-12 19:50:48 +03:00
Alex Plate
dc88cbd902
Change implementation of ExitHandler
...
Use file manager for file closing
Add tests for :qa commands
2019-02-12 17:33:18 +03:00
Alex Plate
fb277e9e49
Create package for handler tests
2019-02-12 17:15:53 +03:00
Alex Plate
582393a462
Fix :only command
2019-02-12 16:42:54 +03:00
Alex Plate
c118bacffd
Create VimFileEditorTestCase for editor tests
2019-02-12 16:42:06 +03:00
Tony Arra
63be2c28e9
Strip tag attributes from closing tag for Vim-Surround
2019-01-21 09:17:10 -05:00
Andrey Vlasovskikh
6c9e697892
VIM-620 Fixed handling nested <C-O> & <Esc> in Insert and Replace modes
2018-12-31 18:01:15 +03:00
Alex Plate
7663eb531e
Write test to reproduce VIM-620 issue
...
Enter insert mode after single command produces incorrect behaviour.
Insert mode is not escaped after Esc
2018-12-29 00:36:51 +03:00
John Lin
b6be26231f
VIM-1274 Fix StringHelper.containsUpperCase behavior
...
StringHelper.containsUpperCase should return true when one of
the character of the input string satisfies the following two
conditions:
1. The character is upper case.
2. The character is not prefixed with a backslash.
Before this fix, the second condition was incorrectly written.
2018-09-17 11:53:23 +08:00
Vitalii Karavaev
57741cd5ce
Fixed bug with selecting occurrences when ignorecase is set
2018-08-27 21:23:25 +03:00
Vitalii Karavaev
58fc34d9f7
Implement <A-x>
2018-08-10 17:01:36 +03:00
Vitalii Karavaev
6fdd769d0f
Implement <A-p>
2018-08-10 16:43:46 +03:00
Vitalii Karavaev
b54384bb33
Implement <Plug>All<Whole>Occurrences
2018-08-10 16:31:48 +03:00
Vitalii Karavaev
c57f98591a
Revert MultipleCursorsExtension and implement <A-n>
2018-08-10 14:08:25 +03:00
Vitalii Karavaev
2225033b7c
Reset state and additional checks
2018-08-09 17:32:32 +03:00
Vitalii Karavaev
cded76d1a2
Test
2018-08-09 14:52:47 +03:00
Vitalii Karavaev
361284fe06
Fixed <A-n> in visual mode
2018-08-09 14:25:29 +03:00
Vitalii Karavaev
73987eaf23
Safer work in case of multiple carets
2018-08-09 12:47:40 +03:00
Vitalii Karavaev
06058a45c0
Fixed review issues and README.md updated
2018-08-09 12:35:08 +03:00
Vitalii Karavaev
d46cab6fc8
Fixed review issues
2018-08-09 11:18:39 +03:00
Vitalii Karavaev
9c5e5e117a
Cleanup
2018-08-08 15:47:35 +03:00
Vitalii Karavaev
cd288ec125
Support for selection all occurrences
2018-08-08 15:16:13 +03:00
Vitalii Karavaev
bde2eb786d
g<A-n> support
2018-08-08 14:38:33 +03:00
Vitalii Karavaev
b6896e28c8
Better support for vim-multiple-cursors extension
2018-08-08 13:57:16 +03:00
Vitalii Karavaev
bbd314b6df
Test :s///
2018-08-07 15:05:46 +03:00
Vitalii Karavaev
11174b8581
Tests :sor
2018-08-07 10:17:47 +03:00
Vitalii Karavaev
d29ae6a64d
:> fix bug and multiple carets support
2018-08-06 16:01:39 +03:00
Vitalii Karavaev
5b69b9beae
:< fix bug and multiple carets support
2018-08-06 15:55:47 +03:00
Vitalii Karavaev
a9440f41a7
Support skip and remove for vim-multiple-cursors emulation
2018-08-06 15:18:05 +03:00
Vitalii Karavaev
8fc4306d76
:d support
2018-08-06 13:42:21 +03:00
Vitalii Karavaev
371d7385ed
Vim Multiple Cursors extension prototype
2018-08-06 12:14:50 +03:00
Vitalii Karavaev
436e96f734
Test :y
2018-08-03 18:15:24 +03:00
Vitalii Karavaev
67a9e1f8c5
Remove support for ex commands with visual selection and multiple carets support for :y
2018-08-03 17:30:44 +03:00
Vitalii Karavaev
3b290fe356
Add tests and fix bug for CopyGroup
2018-08-01 13:59:05 +03:00
Vitalii Karavaev
f3c66d131e
Test :m
2018-07-31 16:38:00 +03:00
Vitalii Karavaev
7f8db50017
Test :pu
2018-07-31 10:44:56 +03:00
Vitalii Karavaev
f256da8a16
Tests :co
2018-07-30 15:42:31 +03:00
Vitalii Karavaev
b80205200c
Tests for :j
2018-07-30 15:17:28 +03:00
Vitalii Karavaev
2efb0dfb17
Multicaret support for go to line
2018-07-26 14:52:40 +03:00
Vitalii Karavaev
f38bf65656
Tests for ex commands
2018-07-26 13:56:08 +03:00
Vitalii Karavaev
d965eb0d7e
Tests for fix overlapping carets
2018-07-26 11:34:05 +03:00
Vitalii Karavaev
994ad0b06c
Tests
2018-07-25 16:47:14 +03:00
Vitalii Karavaev
fcc2355037
Add caret offsets to tests
2018-07-25 12:00:04 +03:00
Vitalii Karavaev
bb32e7adb4
Multiple carets support for put visual text
2018-07-23 16:33:04 +03:00
Vitalii Karavaev
2326489658
Multiple carets support for yank visual
2018-07-23 12:39:31 +03:00
Vitalii Karavaev
0773c886ee
Fixed bug with put blockwise text. Properly this time
2018-07-19 18:00:14 +03:00
Vitalii Karavaev
fcbf228d35
Proper indent after yank commands
2018-07-19 16:53:22 +03:00
Vitalii Karavaev
34feb27bef
Yank commands and tests
2018-07-19 16:11:28 +03:00
Vitalii Karavaev
86f707bc51
More tests
2018-07-19 15:57:13 +03:00
Vitalii Karavaev
07f74f82b5
Better tests for put text commands
2018-07-19 12:44:48 +03:00
Vitalii Karavaev
0148860b2d
Test for put text
2018-07-18 15:39:21 +03:00
Vitalii Karavaev
8d919d6ec8
Added some tests
2018-07-17 15:59:27 +03:00
Vitalii Karavaev
7f34b826b2
Fix test
2018-07-12 14:29:37 +03:00
Vitalii Karavaev
dad0d8e559
Tests for pasting
2018-07-12 12:18:44 +03:00
Vitalii Karavaev
3f82020100
Multiple carets support for going to line
2018-07-06 11:39:57 +03:00
Vitalii Karavaev
c3935aafc9
Tests for finding next item in line
2018-07-05 09:44:25 +03:00
Vitalii Karavaev
b464d99bd5
Tests for searching whole word
2018-07-04 16:23:59 +03:00
Vitalii Karavaev
bb8fa94668
Tests for moving cursor after last char in the file
2018-07-04 15:11:10 +03:00
Vitalii Karavaev
24994fa387
Test for moving carets to the first char in the file
2018-07-04 14:44:12 +03:00
Vitalii Karavaev
3f45200cb9
Fixed bug in test
2018-07-04 12:28:08 +03:00
Vitalii Karavaev
4703e75003
Test for inserting previously inserted text and stop inserting added
2018-07-04 10:20:43 +03:00
Vitalii Karavaev
ded21efe5f
Test for inserting previously inserted text
2018-07-03 15:49:46 +03:00
Andrey Vlasovskikh
f0be6581b2
Merge branch 'master' into multiple-carets
...
# Conflicts:
# src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockTagAction.java
# src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockTagAction.java
# src/com/maddyhome/idea/vim/group/MotionGroup.java
# src/com/maddyhome/idea/vim/helper/SearchHelper.java
2018-06-29 12:39:39 +03:00
Andrey Vlasovskikh
ef470bd890
Merge branch 'FIX-VIM-1287'
2018-06-28 16:09:47 +03:00
Andrey Vlasovskikh
428d75968c
VIM-1287 More tests for badly nested blocks and strings
2018-06-28 16:09:21 +03:00
Andrey Vlasovskikh
7f897440b7
Merge remote-tracking branch 'jpalus/master'
2018-06-04 16:05:10 +03:00
Jan Palus
b0714075eb
add test for VIM-1427 (tag motion with count)
2018-06-02 15:26:02 +02:00
Jan Palus
956b56a772
add test for VIM-1431 (put in empty file)
2018-06-02 15:10:26 +02:00
Vasily Alferov
2d3da163a8
Attempt to fix Visual Block down movements
2018-05-26 21:52:57 +03:00
Vasily Alferov
49c59764ac
Merge in change.insert actions
2018-05-26 20:17:12 +03:00
Vasily Alferov
7754080323
Various fixes
2018-05-25 11:45:11 +03:00
Vasily Alferov
ebf081e273
Multicaret shift
2018-05-22 22:51:49 +03:00
Vasily Alferov
258467467b
Multicaret insert
2018-05-22 22:02:26 +03:00
Vasily Alferov
4f468cace7
Multicaret change.change
2018-05-22 00:16:58 +03:00
Vasily Alferov
9ddedbe752
Multicaret delete visual operator actions
2018-05-21 19:08:40 +03:00
Vasily Alferov
29c789dcf3
Implementations of all of the delete actions whose handlers doesn't override VisualOperatorActionHandler.
2018-05-20 13:55:33 +03:00
Vasily Alferov
59e2ae552e
ChangeEditorActionHandler multicaret version and multicaret delete tests
2018-05-12 21:24:28 +03:00
Vasily Alferov
0919e9d560
Multicaret merging selections & text objects
2018-05-12 17:08:19 +03:00
Vasily Alferov
13c475d73c
Fix multiple carets movement in case i<ESC>i<ESC>
2018-05-05 12:01:00 +03:00
Vasily Alferov
be5532b35d
Comment out text object multiple carets tests.
2018-05-05 10:59:58 +03:00
Vasily Alferov
3b46e44e4f
action.motion.text.* multicaret tests and implementation
2018-04-27 20:24:26 +03:00
Vasily Alferov
537ec30936
object.MotionInner* tests
2018-04-24 23:43:21 +03:00
Vasily Alferov
a75db02d05
Fix failed tests on Visual Block Mode.
2018-04-24 22:17:10 +03:00
Vasily Alferov
1db103e352
Basic multicaret up-down motions.
...
+ Create a class for caret-specific data and move LAST_COLUMN getter/setter there.
2018-04-16 16:05:52 +03:00
Vasily Alferov
4d46000ec6
Write most of multicaret leftright actions.
...
MotionColumnAction, MotionFirstColumnAction, MotionFirstNonSpaceAction, MotionLastColumnAction, MostionLastMatchCharAction, MotionLastMatchCharReverseAction, MotionLastNonSpaceAction, MotionLeftAction, MotionLeftMatchCharAction, MotionLeftTillMatchCharAction, MotionRightAction, MotionRightMatchCharAction, MotionRightTillMatchCharAction now have their own native multi-caret implementations.
2018-03-29 10:18:35 +05:30
Vasily Alferov
56ad6b4c0d
Multi-caret basic leftright motions.
...
Add basic multi-caret interfaces (i.e. deprecated and new functions to EditorActionHandlerBase) and overloaded them in MotionLeftAction and MotionRightAction.
2018-03-21 17:13:57 +03:00
Andrey Vlasovskikh
dbdc15f21f
Merge branch 'cypok/vim-1380'
2017-12-29 10:29:34 +03:00
Andrey Vlasovskikh
1a8c72d721
Merge branch 'cypok/vim-1379'
2017-12-29 10:19:08 +03:00
Andrey Vlasovskikh
fea2f0ba1e
VIM-1110 Added test
2017-12-28 15:54:49 +03:00
Andrey Vlasovskikh
1393e60ca8
VIM-862 Properly apply and reset visual mode for running visual :action commands
...
Also fixed minor formatting and Java 8 issues.
2017-12-18 00:53:56 +03:00
Andrey Vlasovskikh
2e67c704f7
VIM-862 Fixed off-by-1 in restoring visual character selection after 'gv'
2017-12-18 00:52:29 +03:00
Andrey Vlasovskikh
c0410131bf
Merge remote-tracking branch 'ikenox/feature/action-in-visual-mode'
2017-12-15 01:37:40 +03:00
Andrey Vlasovskikh
942b64052d
Inherit from VimTestCase to setup IntelliJ extension points properly
...
Otherwise these tests depend on the run order of other tests for
proper initialization.
2017-12-12 20:17:49 +03:00
Vladimir Parfinenko
52d26f9fb6
VIM-1380 Fixed 'cNw' at the last character of a word
...
Bug was introduced while fixing VIM-200
2017-11-20 11:37:42 +07:00
Naoto Ikeno
b7d124ce8d
Make :action
commands work in visual mode
2017-11-19 20:06:02 +09:00
Vladimir Parfinenko
6a5c70ee6a
VIM-1379 Fix usage TextRange.size() as lines count
...
TextRange.size() should be used only for iterating over starts/ends
2017-11-19 13:49:12 +07:00
nickgieschen
ef05491991
VIM-1367 Implement iskeyword
...
(cherry picked from commit d91d38c)
2017-11-03 03:22:39 +03:00
tieTYT
57b5b319a7
VIM-523 Fixed global mark remembering only the line number
...
Bear with me as this is the first thing I've ever done with
Intellij-IDEA plugin development.
I tested this and I believe I fixed the problem. The cause of the
problem was that the code was checking if the mark was in a different
file but if it was, it was using the editor of the current file to go
to the line of the mark. I changed the code so that it opens the file
of the mark first, then jumps to its line number.
I need a VirtualFile so that I can get the Editor to open. The Mark
stores the path of the file it's in, but the path is not enough
information to get a VirtualFile. I also need the "protocol" of the
file. So, I had to change the structure of the Mark and add a
"protocol" field to it.
I had to update the save/load logic to use this new field, too. This
way, when you restart Intellij-IDEA, the marks can still be used. For
old marks, I defaulted the "protocol" to the value of "file".
One thing I couldn't figure out how to do is add a test case to check
that this is working correctly. This is not due to a lack of effort.
In fact, I tried to write the test case first. But I have been unable
to find any examples anywhere of testing multiple Editors, and that's
what's involved to fix this issue. Because of this, this issue may be
best used as a reference to fix the problem instead of worthy of being
used in production. Either way, I'd love to know how to write such a
test.
2017-11-01 02:35:23 +03:00
Konstantin Petrov
0335b344a1
Add test to reproduce the bug
2017-05-31 10:27:00 +02:00
Vedran Budimcic
44b9946bb0
Support end-of-line multi line percent match in visual mode
2017-03-24 07:12:28 -07:00
Marcel Hild
6efd4023fd
make offset work in normal search
2017-03-23 11:33:08 +01:00
Giorgos Gaganis
c4d8cef44d
Fixed . reseting the last find movement where repeating change that also uses movement.
...
On the original vim when we repeat a change with . that also contain an find movement the last find that was typed before the repeat is the one used by the motion repeat ;. Before the commit the plugin would have reset the last movement to use the movement contained in the command that was repeated.
To solve this I took a simple approach where I save the last find motion before starting the repeat and then restoring it to its original value after the repeat is over. In order to access the find motion fields from RepeatChangeAction I created getters in MotionGroup for the movement type and character.
modified: src/com/maddyhome/idea/vim/action/change/RepeatChangeAction.java
modified: src/com/maddyhome/idea/vim/group/MotionGroup.java
modified: test/org/jetbrains/plugins/ideavim/action/ChangeActionTest.java
2016-11-28 19:05:11 +02:00
Andrey Vlasovskikh
e09f6c7886
Failing tests for VIM-287
2016-04-28 19:38:19 +03:00
Andrey Vlasovskikh
c471ddd12f
Merge remote-tracking branch 'ayzenquwe/ayzen/VIM-259'
2016-04-18 02:47:38 +03:00
Andrey Vlasovskikh
b0ac8f89c5
Merge remote-tracking branch 'ayzenquwe/ayzen/VIM-964'
2016-04-18 02:41:35 +03:00
Andrey Vlasovskikh
a47338d8b7
Merge remote-tracking branch 'ayzenquwe/ayzen/VIM-564'
2016-04-18 02:36:58 +03:00
Andrey Vlasovskikh
76d00ab47f
Merge remote-tracking branch 'ayzenquwe/ayzen/gomethod'
2016-04-18 02:31:11 +03:00
Andrey Vlasovskikh
52148f69c1
Merge remote-tracking branch 'ayzenquwe/ayzen/registers'
2016-04-18 02:24:00 +03:00
Andrey Vlasovskikh
f280f8138d
Support <Plug> in mapping commands
2016-04-18 01:46:46 +03:00
Andrey Vlasovskikh
530846bc7a
Added 'timeout' option for toggling timeout for mapping commands
2016-04-18 01:46:46 +03:00
Andrey Vlasovskikh
c33d4d989e
Clearer offsets comparison + multi-line deletion test
2016-02-09 00:20:58 +03:00
dhleong
3cd1134973
Fix calculation of how to paste surrounded value
...
Fixes VIM-1085; includes test
2016-02-06 10:23:05 -05:00
dhleong
1c7e6af1fc
Fix <esc> not sent after VSurround; support change with tags
2016-02-02 20:57:54 -05:00
dhleong
84f7e25c5e
Cleanup overly verbose code; remove unused import
2016-02-02 20:32:09 -05:00
dhleong
458fe97b75
Add visual surround (S
) command
2016-01-30 09:31:25 -05:00
dhleong
31364607f5
Add ds
command; jump to start when executed to match vim-surround
2016-01-30 09:14:34 -05:00
dhleong
56ec2c7ebc
Add cs
action
...
Note that, unfortunately, we can't do `cst`, as IdeaVim doesn't
support the tag textobject. Once that's supported, however, we
just need to disable the safety check to enable that.
2016-01-30 09:02:06 -05:00
Andrey Vlasovskikh
91546700d4
Added simple ys{motion}t tag surround and input()
function
2016-01-26 22:25:36 +03:00
Andrey Vlasovskikh
6328575639
'ys{motion}<' requires further user input to wrap text into HTML tags
2016-01-26 21:15:29 +03:00
Andrey Vlasovskikh
af534c9209
Repeat is not supported for 'ys' yet
2016-01-26 21:14:43 +03:00
Andrey Vlasovskikh
d46d292865
Added surround tests for 'ys' by dhleong
2016-01-26 18:15:00 +03:00
Andrey Vlasovskikh
1a96533a3c
Added unit test-friendly version of VimExtensionFacade.getKeyStroke()
2016-01-26 18:14:14 +03:00
Andrey Vlasovskikh
480b32b5af
Fixed AIOOBE in tag selection for files starting with '/' and containing '>'
2016-01-21 18:28:14 +03:00
lubba
a22afdd0f6
VIM-364 Added support for tag block selection
2015-12-03 15:19:54 +03:00
Andrey Vlasovskikh
e805852721
Platform prefix initialization is no longer needed
2015-10-30 15:20:36 +03:00
ayzen
5fc66b5896
={motion} implementation, == with count and fix for VIM-259
2015-07-11 21:44:36 +03:00
ayzen
80dec29832
Fix for VIM-965 with a test
2015-07-01 23:31:25 +03:00
ayzen
30a16e9496
Corrected typo that prevented correct calculation for marks vertical shifting; added a test
2015-06-14 10:54:15 +03:00
ayzen
0d6526ea31
Mark should not be deleted due to change commands that start from the beginning of the mark line
2015-06-14 10:41:52 +03:00
ayzen
4428340fd9
Fix for VIM-964 (marks get removed if one-char line is replaced by r) with a test
2015-06-14 10:38:36 +03:00
ayzen
900ce21445
Fix for VIM-564 (g_ didn't work correctly) with tests
2015-06-12 22:43:19 +03:00
ayzen
afb411dd35
Added tests for special registers
2015-06-05 21:09:16 +03:00
Andrey Vlasovskikh
85231b314f
More readable test data
2015-04-24 16:29:56 +03:00
Andrey Vlasovskikh
ae5b1385ea
Merge branch 'matching-comments'
2015-04-24 16:08:54 +03:00
Andrey Vlasovskikh
011ce28251
More readable tests for '%'
2015-04-24 16:08:32 +03:00
Andrey Vlasovskikh
7d033787eb
Better place for cleaning global variables
2015-04-24 14:31:06 +03:00
Andrey Vlasovskikh
3a47583cf9
Clean global variables
2015-04-24 14:27:38 +03:00
Andrey Vlasovskikh
b886073c11
VIM-650 Added support for 'mapleader'
2015-04-24 13:32:04 +03:00
Andrey Vlasovskikh
3ff9bfcc13
Initial support for 'let' and 'echo' commands
...
These commands evaluate Vim script expressions. Right now they are
limited to a highly limited subset of Vim script expressions that is
however enough for settings the 'mapleader' variable for VIM-650.
2015-04-05 22:54:40 +03:00
Andrey Vlasovskikh
373e1527c1
Extracted Vim script parts into 'vimscript' package
2015-03-28 14:16:38 +03:00
Andrey Vlasovskikh
74bf5ff044
Formatting and typos
2015-03-27 21:43:36 +03:00
Andrey Vlasovskikh
0f7e9d11b6
Added test for VIM-845
2015-03-27 21:43:19 +03:00
Andrey Vlasovskikh
5fadc2fb9f
Removed unused imports
2015-03-27 21:30:05 +03:00
Andrey Vlasovskikh
3fee4a803b
Merge remote-tracking branch 'dezgeg/fixes/visual-block-mode-overhaul'
2015-03-27 20:56:58 +03:00
Tuomas Tynkkynen
0c9bdf5168
Visual block mode overhaul
...
The current visual block mode implementation has several bugs:
- The GUI never displays the rightmost characters as selected (blue)
- Due to some off-by-one, commands can't act on each line's last character
- It's possible for newlines to get deleted/changed into something else
- If the '$' mode is entered, the GUI doesn't always indicate this
- It's impossible to move to an empty line (VIM-781)
This commit fixes all of those problems. The only remaining problem are
the visible secondary carets, which makes seeing the real cursor a bit
difficult. This could be fixed later if support for per-caret visibility
would be added to IntelliJ core.
2015-02-21 17:17:36 +02:00
Tuomas Tynkkynen
82a9587b4f
Support comments in brace matching
...
In Vim, '%' can be used to jump between the '/*' and '*/' of block
comments. Support this functionality in a language-independent manner.
2015-02-21 15:14:38 +02:00
Tuomas Tynkkynen
8d1dcc4568
VIM-700 Remapping '0' should still allow zero to be entered in count
...
Previously, remapping '0' in command mode would prevent a number zero
from being entered in a command count.
2015-02-21 15:09:13 +02:00
Tuomas Tynkkynen
5090c81632
VIM-856 Fix regex lookbehind bugs
...
The regex code has the following bugs, mostly related to lookbehind:
- Comparison of CharPointers with == is wrong, .equals should be
used instead.
- In the original C code, the behind_pos variable is declared as
'static regsave_T behind_pos;', i.e. not a pointer, and the same
for other variables of type regsave_T. So assignments to these
types of variables need to make deep copies.
2015-01-20 17:52:08 +02:00
Andrey Vlasovskikh
72537c6ffb
Merge remote-tracking branch 'jdpopkin/relative_range'
...
Conflicts:
test/org/jetbrains/plugins/ideavim/ex/SubstituteCommandTest.java
2015-01-20 17:17:27 +03:00
Andrey Vlasovskikh
30f9888f51
Merge remote-tracking branch 'selesse/sort-fix'
2015-01-20 16:06:36 +03:00
Andrey Vlasovskikh
fd3eee6870
Merge remote-tracking branch 'dezgeg/fixes/vim-864-visual-substitute-incorrect-visual-marks'
2015-01-20 15:50:17 +03:00
Andrey Vlasovskikh
499c590f5a
Merge remote-tracking branch 'dezgeg/unit-tests'
2015-01-20 15:36:18 +03:00
Andrey Vlasovskikh
e0a1291de0
Merge remote-tracking branch 'dezgeg/fixes/vim-210-ex-focus'
2015-01-20 15:27:55 +03:00
Tuomas Tynkkynen
4802b6f460
VIM-864 Fix visual marks getting changed during visual substitute
...
Previously, running a substitute command in visual mode would
incorrectly set the visual mode end mark (>) to the location of the last
search match.
2014-12-24 18:19:53 +02:00
Jackson Popkin
8c0e116a1c
Fix incorrect behavior in substitution with offset ranges
...
Substitution commands with offset ranges like .,+2s/a/b/g previously
did not work the way they do in Vim (replace a with b on the current
line and the next two lines). This change fixes that bug.
2014-12-23 21:14:42 -05:00
Alex Selesse
8862878011
Fix broken sorting when sorting with leading whitespace
2014-12-14 12:17:51 -05:00
Tuomas Tynkkynen
6b5216077b
Add few simple mark tests.
2014-12-12 23:05:28 +02:00
Tuomas Tynkkynen
7e119f7963
Add tests for change number operations (<C-A>, <C-X>)
2014-12-12 23:05:28 +02:00
Tuomas Tynkkynen
933cbc7e51
Add unit tests for some replace commands
...
Adds tests for: |r|, |s|, |R|, and <Ins> in insert mode.
2014-12-12 23:05:28 +02:00
Tuomas Tynkkynen
65f30d4480
Add testcase for '>' in visual block mode
2014-12-12 23:05:28 +02:00
Tuomas Tynkkynen
1f8d3f119e
Add unit tests for Ex ranges
...
Adds tests for ranges in Ex commands. Almost every kind of range has
basic tests, except the following are still totally untested:
- \/, \?, \&
- register ranges
- syntax errors in ranges
2014-12-12 23:05:28 +02:00
Tuomas Tynkkynen
45fe858503
Add tests for case changing operations
...
Add tests for the following commands:
- gu, gU, g~ in normal mode
- u, U, ~ in visual mode
2014-12-12 23:05:28 +02:00
Tuomas Tynkkynen
0cc06ad186
Move ChangeActionTest.doTest() to VimTestCase.
...
This method is convenient in other tests as well.
2014-12-12 23:05:28 +02:00
Tuomas Tynkkynen
18cd7547ad
VIM-210 Fix focus issues with the Ex panel
...
Previously, if the editor window had been splitted, under certain
conditions some actions related to the Ex panel would cause the editor
focus to change to a different split.
The required conditions for this bug to occur:
- no docked windows (like the Project sidebar) are open
- 'View -> Navigation bar' is disabled
At least these actions triggered the bug:
- search with /
- successfully executing an Ex command
- dismissing the Ex window with Esc
- Ex commands that opened the output panel (e.g. :!)
All the deleted lines of the form
FileEditorManager.getInstance(project).openFile(vf, true);
seem to be very old, non-functional workarounds for the focus issue.
2014-12-09 13:36:03 +02:00
Tuomas Tynkkynen
7746a26062
VIM-855 Fix regexp character class bugs
...
Previously strchr and istrchr didn't consider NUL chars as end-of-string
terminators. This caused problems in regexps using character classes:
a regexp like "[^a]bc" would be effectively treated as "[^abc]bc" - i.e.
some literal characters from the rest of the pattern would accidentally be
included in the character class.
2014-12-09 01:01:53 +02:00
Andrey Vlasovskikh
27bd7ec836
Merge remote-tracking branch 'dezgeg/fixes/misc-issues'
2014-12-07 16:28:15 +03:00
Tuomas Tynkkynen
47edfcac5e
VIM-702 Fix infinite loop on s/$/\r/g
...
If the replacement contains newlines, the line number of the current
search position needs to be adjusted. Without this, e.g. s/$/\r/g would
get into an infinite loop.
2014-12-03 14:00:31 +02:00
Andrey Vlasovskikh
26a247c0bf
Revert "Unified tests initialization for IntelliJ 13+ Community and Ultimate"
...
This reverts commit 296ef1bdf9
.
2014-11-28 22:29:15 +03:00
Andrey Vlasovskikh
296ef1bdf9
Unified tests initialization for IntelliJ 13+ Community and Ultimate
2014-11-28 20:22:43 +03:00
Andrey Vlasovskikh
f0e8d065b7
Merge remote-tracking branch 'dezgeg/fixes/vim-723-paste-wrong-line'
2014-11-26 18:18:54 +03:00
Andrey Vlasovskikh
520d852c04
Merge remote-tracking branch 'dezgeg/fixes/vim-771-repeated-semicolon'
2014-11-26 18:12:14 +03:00
Tuomas Tynkkynen
3bdfaa02e1
'J' shouldn't add whitespace if there is trailing whitespace
2014-11-22 13:15:11 +02:00
Tuomas Tynkkynen
e8de9f915c
Make '>' not add trailing whitespace to empty lines.
2014-11-22 13:14:23 +02:00
Tuomas Tynkkynen
31f598d1e1
VIM-723 Fix pasting to an empty line
...
When pasting on an empty line, the pasted text would go to the start of
next line instead.
2014-11-17 03:47:50 +02:00
Tuomas Tynkkynen
46e6fd0847
VIM-771 Fix semicolon repeat for 'till char' motion
...
Based on empirical testing with Vim, ';' should work like this:
assuming "<caret>1:a 2:b 3:c" with ':' as the last f/t character:
- "t:" does nothing
- ";" cursor goes to '2'
- "2;" cursor goes to '2', same as the previous
- "3;" cursor goes to '3'
2014-11-16 18:58:56 +02:00
Tuomas Tynkkynen
1441a60f4b
Fix AIOOBE when '(' motion goes past start of file
...
If first character of the file is a newline, then findSentenceEnd()
could return -2 when the 'previous sentence' motion is performed,
leading to an eventual crash. Found by fuzzing.
2014-11-16 17:08:47 +02:00
Tuomas Tynkkynen
ebdf107946
Fix AIOOBE crash when using 'b' on first line
...
If 'b' were used on the first word of the file, and the word was
preceded by whitespace, ArrayIndexOutOfBoundsException would occur.
Found by fuzzing.
2014-11-16 17:08:47 +02:00
Tuomas Tynkkynen
38d672c9f9
Fix KeyHandler crash when using '<' or '>'
...
The '<' and '>' commands weren't marked with FLAG_OP_PEND even though
they should, which sometimes caused EmptyStackException in KeyHandler
(when typing <I<><I<> for example). Found by fuzzing.
2014-11-16 17:08:46 +02:00
Tuomas Tynkkynen
75d34abd45
Fix IOOBE when 'i)' motion doesn't find other delimiter
...
Found by fuzzing.
2014-11-16 17:08:43 +02:00
Andrey Vlasovskikh
3cfa0e1844
Merge remote-tracking branch 'dezgeg/fixes/vim-515-cW-command'
2014-11-15 00:09:00 +03:00
Andrey Vlasovskikh
49d0c51d97
Merge branch 'vim-536-cc-second-to-last-line'
2014-11-15 00:00:43 +03:00
Tuomas Tynkkynen
58d964063c
VIM-515 Fix cW command detecting end-of-word incorrectly
...
A cW command on text like 'x$$$$' or '$xxxx' would incorrectly delete
just the first character, and not the rest.
2014-11-14 22:51:46 +02:00
Andrey Vlasovskikh
52b7b9bcd8
Merge branch 'vim-705-multi-line-indent-broken'
2014-11-14 23:05:03 +03:00
Tuomas Tynkkynen
da22b8297b
VIM-536 Fix 'cc' on second-to-last line in file
...
Previously, 'cc' on the second-to-last line of a file would instead open
a new line after the last line of the file.
2014-11-14 16:56:05 +02:00
Tuomas Tynkkynen
ac8ac302ca
VIM-705 Fix repeated multiline indent
...
When a visual mode command is repeated, code calls into
MotionGroup#toggleVisual() to setup a 'fake' visual mode selection. But
when MotionGroup.moveCaret() is called, it notices that the indent
command has the FLAG_EXIT_VISUAL flag, and leaves visual mode right
away.
2014-11-10 23:32:09 +02:00
Tuomas Tynkkynen
22c3a73102
VIM-613 Fix repeat after 'd$'
...
Previously, repeating a 'd$' command would incorrectly delete the
newline from the line.
2014-11-10 16:36:40 +02:00
Andrey Vlasovskikh
9804cd83a6
VIM-652 Added a test for :action
2014-10-24 16:13:40 +04:00
Andrey Vlasovskikh
20e831b56a
Updated tests after fixing VIM-501
2014-10-23 16:58:43 +04:00
Andrey Vlasovskikh
72b74e075c
Merge branch 'visual_block_delete'
2014-10-23 16:55:17 +04:00
Andrey Vlasovskikh
5434edbd54
VIM-792 Fixed line-wise and block-wise paste commands for * and + registers
2014-10-23 16:09:56 +04:00
Andrey Vlasovskikh
6a8c7e4b17
VIM-511 Record caret adjustment changes to the document during <Enter> processing
...
We have to handle Enter by our VimShortcutKeyAction in order to be
able to record it as an action for repeating it via '.'. Since original
Enter handlers are not run in this case we invoke them manually by
collecting a list of actions that can be run for the editor component
on Enter and then running the first action ready to run.
Caret adjustments are detected on changes to the document caused by
Enter. This allows to position the caret properly (e.g. between {})
before recording Enter.
2014-10-23 15:26:22 +04:00
Alexey Shmalko
0ac659f2d1
Fix visual block deleting
...
Currently deleting visual block leaves last char in line untouched. This
patch fixes that as well as tests.
2014-10-21 21:40:43 +03:00
Tony Kay
7eae40ca9a
added a failing test
2014-10-21 11:05:43 -07:00
Andrey Vlasovskikh
3f92dba1b7
VIM-511 Updated test data
2014-10-21 21:16:11 +04:00
Andrey Vlasovskikh
0aedc08cfa
More tests for VIM-511
2014-10-21 20:42:04 +04:00
Andrey Vlasovskikh
8312f5cffd
VIM-511 Added a test for repeating a change that includes auto-inserted parens and quotes
2014-10-21 19:41:11 +04:00
Andrey Vlasovskikh
e3fce51ea1
VIM-511 Fixed editing offset after <BS> for '.' command
2014-10-21 16:56:54 +04:00
Andrey Vlasovskikh
13b4e93bf4
Run the test only if the system clipboard is available
2014-10-20 16:53:25 +04:00
Andrey Vlasovskikh
cc2ed452f0
Merge branch 'clipboard-unnamed'
...
Conflicts:
src/com/maddyhome/idea/vim/option/Options.java
test/org/jetbrains/plugins/ideavim/action/CopyActionTest.java
2014-10-20 15:59:15 +04:00
Andrey Vlasovskikh
d4d3843725
VIM-476 Added default register reset on 'clipboard' change
...
Added a test for :set clipboard=unnamed.
2014-10-20 15:53:33 +04:00
Andrey Vlasovskikh
c873524cb1
VIM-784 Fixed visual line selection where start > end of the selection range
...
It was a regression introduced by the fix of VIM-632.
2014-10-15 15:10:22 +04:00
Andrey Vlasovskikh
d3afd83e8e
Merge branch 'VIM-407'
2014-10-14 15:25:43 +04:00
Andrey Vlasovskikh
3e0e08c5e1
VIM-632 Restored visual block mode that was broken due to multiple carets support
...
Vim actions with multiple carets in modes other than visual block are
not supported yet. It will be a separate feature. The idea behind this
commit is to fix the regression in visual block mode.
Bounds of visual selection are no longer reversed if they are
overlapped, this fixes expanding the block selection in all directions.
IdeaVim no longer uses SelectionModel.hasBlockSelection() since it
always returns 'true' now.
There are a couple of places where we remove secondary carets when
moving the primary caret or re-setting visual mode. It may be
incompatible with the forthcoming support for multi-caret Vim actions.
2014-10-09 18:01:47 +04:00
Andrey Vlasovskikh
a717e4785d
VIM-569 Fixed <C-W> when the caret is at the end of a line
2014-09-09 00:36:39 +04:00
Dathan Bennett
16ce16c632
Add test for VIM-569 fix
2014-09-06 02:59:49 -07:00
Andrew Brookins
19365effa9
VIM-407 Add tests. Only skip the ending line if it is empty.
...
Conflicts:
src/com/maddyhome/idea/vim/group/ChangeGroup.java
test/org/jetbrains/plugins/ideavim/action/ShiftRightLinesActionTest.java
2014-05-22 22:04:14 -07:00
Andrey Vlasovskikh
e564eb5878
VIM-213 Use '< and '> marks for saving and restoring last visual selection
2014-05-15 02:49:50 +04:00
Andrey Vlasovskikh
9cd620af58
VIM-646 Don't update visual selection if command moves caret and exits visual mode
2014-05-12 21:50:50 +04:00
Andrey Vlasovskikh
0887c72486
Updated index docs for all the visual mode commands
2014-05-12 20:00:17 +04:00
Andrey Vlasovskikh
a516fd880e
Made visual-only mode actions VimCommandActions
2014-05-12 19:28:24 +04:00
Andrey Vlasovskikh
2d1b40f00c
Added tests for 'gv' and 'o' in visual mode
2014-05-08 16:59:11 +04:00
Andrey Vlasovskikh
b200c842b4
VIM-679 Allow \u000D\u000C as <CR> in mappings
2014-05-05 21:26:35 +04:00
Andrey Vlasovskikh
c8df52a86c
VIM-679 Allow \u0016 as an escape character for '|' in mappings
2014-05-05 20:51:39 +04:00
Andrey Vlasovskikh
b17a592c95
VIM-679 Parse characters less than \u0020 as <C-$CHAR>
2014-05-05 20:40:14 +04:00
Andrey Vlasovskikh
f71d6c7fab
VIM-679 Don't trim whitespace-like characters from command arguments
...
Characters like '\u0018' may appear in mapping commands.
2014-04-30 21:08:16 +04:00
Andrey Vlasovskikh
b593d90dff
VIM-676 Handle control characters in .vimrc as pressed, not typed keystrokes
2014-04-30 18:46:45 +04:00
Andrey Vlasovskikh
6ee0b821cc
VIM-672 Ignore mappings that contain <Plug> and <SID>
...
These mappings don't make sense to Vim emulation in IdeaVim.
2014-04-29 19:39:58 +04:00
Andrey Vlasovskikh
72dc121fcd
VIM-670 First character of a recursive mapping shouldn't be mapped again
...
The mapping's "from" keys should be a prefix of "to" keys.
2014-04-29 17:22:25 +04:00
Andrey Vlasovskikh
786c4dc817
VIM-666 Support <Bar> in Vim key notation
2014-04-29 16:47:47 +04:00