1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2024-12-21 10:42:48 +01:00
Commit Graph

4943 Commits

Author SHA1 Message Date
35445cb730
Exit insert mode after refactoring 2024-12-17 13:04:35 +01:00
9cba953bf7
Add action to run last macro in all opened files 2024-12-17 13:04:35 +01:00
8d4a1cd7d5
Revert per-caret registers 2024-12-17 13:04:35 +01:00
fd33e4254b
Fix(VIM-3364): Exception with mapped Generate action 2024-12-17 12:44:01 +01:00
f242cf18d7
Apply scrolloff after executing native IDEA actions 2024-12-17 12:44:01 +01:00
ac46a45f26
Stay on same line after reindenting 2024-12-17 12:44:01 +01:00
8c30f802ca
Automatically add unambiguous imports after running a macro 2024-12-17 12:44:01 +01:00
766f3f498d
Fix(VIM-3179): Respect virtual space below editor (imperfectly) 2024-12-17 12:44:00 +01:00
60d9c59a3e
Fix(VIM-3178): Workaround to support "Jump to Source" action mapping 2024-12-17 12:44:00 +01:00
025bfe5aba
Add support for count for visual and line motion surround 2024-12-17 12:43:59 +01:00
2edb650830
Fix vim-surround not working with multiple cursors
Fixes multiple cursors with vim-surround commands `cs, ds, S` (but not `ys`).
2024-12-17 12:43:48 +01:00
3d75e14dc4
Fix(VIM-696) Restore visual mode after undo/redo, and disable incompatible actions 2024-12-17 12:06:53 +01:00
36716fe849
Change matchit plugin to use HTML patterns in unrecognized files 2024-12-17 12:06:53 +01:00
7cfe42688b
Reset insert mode when switching active editor 2024-12-17 12:06:53 +01:00
1d9fb7f6a7
Disable switching to insert mode for some editors 2024-12-17 12:06:53 +01:00
8c4828a6fd
Remove update checker 2024-12-17 12:06:53 +01:00
86f11a9554
Set custom plugin version 2024-12-17 12:06:53 +01:00
Alex Plate
4614e2ad54
[VIM-3617] Remove the forgotten recursion call 2024-12-17 10:06:48 +02:00
Alex Plate
077de91e01
[VIM-3617] Set a recursion guard for obtaining the editor
Function `selectedTextEditor` in some cases may create a new editor, what causes the recursion and IDE freeze. The guard should protect from it.
2024-12-17 10:02:34 +02:00
Alex Plate
1ce7a97f2a
Fix(VIM-3747): There is no need to remove the visual mode if there is still a selection 2024-12-16 13:38:29 +02:00
Julien Phalip
4962baabad Add support for hlsearch variable 2024-12-06 17:21:33 +02:00
Julien Phalip
2e550a0960 Add support for escape() vim function 2024-12-06 17:09:59 +02:00
Matt Ellis
a005eb0612 Fix repeating change action with count
Fixes VIM-3729
2024-12-04 18:23:16 +02:00
Justas Trimailovas
63297e685c Correctly change surround if it's empty or only spaces
This commit fixes 2 bugs at once:

1. Correctly trim surround with closing brackets motion, e.g.: `cs()`.

   It should trim all surrounding white space or leave things unchanged if
   there's no space.

   For example cases like these:

	"( ${c}foo )"  // single spaces
	"(   ${c}foo   )"  // multiple spaces
	"( ${c}foo)"  // assymetric spaces
	"(${c} )"  // single space without text
	"(${c}   )"  // multiple spaces without text

   Should trim white spaces into these results accordingly:

	"${c}(foo)"
	"${c}(foo)"
	"${c}(foo)"
	"${c}()"
	"${c}()"

In case of no spaces - they should be left unchanged, e.g.:

	"(${c}foo)"  // no spaces around the word
	"(${c})"  // empty parenthesis

2. Leave empty parenthesis unchanged. IdeaVim now deleted them instead.
2024-12-04 18:07:02 +02:00
Justas Trimailovas
6c9a5e1f2d [VIM-1824] surround - remove whitespace with closing bracket
**Context**:

In vim surround extendsion closing brackets (`}, ], )`) should remove
whitespace when using `cs` movement.

Example:
- Before: `{ example }`
- Movement: `cs{}`
- After: `{example}`

This was because  were replaced with a string from `SURROUND_PAIRS` map,
which does not have any context about removing characters.

**Solution**:

Inspired from VSCode's VIM plugin[^1], I have introduced new class
`SurroundPair` that will carry this context about need to trim
characters.

**Disclaimer**:

I have never written in `Kotlin` so solution may be not use best
practices, though at least this PR seems to fix the problem and tests
are passing.

**Ticket**:
- https://youtrack.jetbrains.com/issue/VIM-1824/Vim-Surround-Does-not-remove-whitespace-with-the-closing-bracket

[^1]: 04fe42aa81/src/actions/plugins/surround.ts (L455)
2024-12-04 18:07:02 +02:00
Julien Phalip
ec3db81c6d Move register variable to its own separate class 2024-11-26 10:32:11 +02:00
Julien Phalip
7062dc4860 Add support for the v:register variable 2024-11-26 10:32:11 +02:00
Alex Plate
0f1a4d523f
Move the docs to the init method of VimExtension 2024-11-25 14:01:23 +02:00
Alex Plate
5f5a97a7e1
Lazily load the logger to avoid injector initialization problems 2024-11-25 13:39:24 +02:00
filipp
0dd63c7b57 Fix nullable editor in tests 2024-11-22 17:15:07 +02:00
filipp
94d7902ef2 Remove more deprecated methods 2024-11-22 17:15:07 +02:00
Filipp Vakhitov
eae3fb3ebe Introduce VimKeyBasedUndoService and VimTimestampBasedUndoService
Undo is managed differently in Fleet and IJ Platform, so now we have two different interfaces that are aware of that
2024-11-22 17:15:07 +02:00
Filipp Vakhitov
25e3988dcf Introduce VimCopiedText class
I don't really like that we have `transferableData: List<Any>`
2024-11-22 17:15:07 +02:00
Filipp Vakhitov
36589c5250 Add context argument in clipboard methods
Alas, adding in just to clipboard was not possible, as there are a lot of depending on methods
2024-11-22 17:15:07 +02:00
Filipp Vakhitov
f1f86b5cd2 Simplify Register class
1. `rawText` vs `text` is confusing and `rawText` was misused, we do not need this field in IdeaVim at all
2. `rawText` and `keys` are the same thing, just parsed. And for some reason, rawText was a nullable field
3. Register is an immutable class now
4. Working with Register class is easier and more compact now
2024-11-22 17:15:07 +02:00
Filipp Vakhitov
628b3ca89f Fix <CR> parsing
It's ^M, not ^J
2024-11-22 17:15:07 +02:00
Filipp Vakhitov
d2b929ddd0 Fix parsing for clipboard option
When I added the selection clipboard, it was confusing to explain to people how this option works and why they should prepend, because the parsing was broken
I've also removed "exclude" part, because it doesn't work in IdeaVim and can confuse people
2024-11-22 17:15:07 +02:00
filipp
43d770ff5a Simplify getTransferableData method signature 2024-11-22 17:15:07 +02:00
Filipp Vakhitov
66aec26091 Move ColLineFunctionHandler.kt to vim-engine 2024-11-22 17:15:07 +02:00
Filipp Vakhitov
1d59c49b95 Move more logic to vim-engine 2024-11-22 17:15:07 +02:00
Matt Ellis
8da15b8c08 Manually track last selected editor
This is important for initialising options. We can't rely on FileEditorManager.selectedTextEditor, as 2024.2 changed behaviour to reset to null during creation of a new editor. This fixes tests (and option initialisation) for 242.
2024-11-22 17:01:38 +02:00
Matt Ellis
e22c2b6473 Improve updating fallback window option values
The assumption for selection change events is no longer valid in 242, so switch approach to checking when editors are released
2024-11-22 17:01:38 +02:00
Matt Ellis
e293c1b786 Add tests for updating the fallback window 2024-11-22 17:01:38 +02:00
Matt Ellis
468ca840ed Update options tests
Expanded to assert changes on all open windows, and formatted to make it a little easier to read/comprehend what's being tested
2024-11-22 17:01:38 +02:00
Julien Phalip
c75e6756c0 Add some tests for the getcmdtype() function 2024-11-22 16:49:04 +02:00
Julien Phalip
5db2984fdd Add ability to set the highlightedyank foreground color 2024-11-22 15:48:22 +02:00
Alex Plate
ed2fe3dcf0
Fix(VIM-3696): Get the state of the selection in read action 2024-11-15 20:34:41 +02:00
Matt Ellis
4f9d76ef66 Fix memory leak with non-disposed listeners
Fixes VIM-3319
2024-11-13 18:00:47 +02:00
Matt Ellis
4b7381901d Fix bug removing map that is also a prefix 2024-11-13 17:57:31 +02:00
Matt Ellis
91cd4ab01f Add sequences to iterate keystroke trie
Allows iterating the trie entries without having to create a list or create a list for each entry's keystrokes.
2024-11-13 17:57:31 +02:00