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

4943 Commits

Author SHA1 Message Date
Matt Ellis
fc5aaa50d8 Remove unnecessary hasmapfrom function 2024-11-13 17:57:31 +02:00
Matt Ellis
c7bbfdcaf5 Remove some test only functions 2024-11-13 17:57:31 +02:00
Matt Ellis
562906fe6d Filter map output by prefix
Fixes VIM-2981
2024-11-13 17:57:31 +02:00
Matt Ellis
976771d11a Implement smap and snoremap
Support for sunmap and smapclear already exists, and vmap would introduce a Select mode map.

Fixes VIM-2260
2024-11-13 17:57:31 +02:00
Matt Ellis
5fc4462b03 Support map! to map insert and cmdline modes
Also supports `mapclear!` and `unmap!`

Moves parsing of the bang modifier to the parser so we can tell the difference between `map! foo bar` and `map ! foo bar`
2024-11-13 17:57:31 +02:00
Matt Ellis
5f263e7014 Fix output of maps with same keys in multiple modes
E.g. `map foo bar` and `vmap foo baz` would only output one map for `foo` when calling `:map`. Now it will output all maps that match the ex command's modes. This change also improves the marker characters in the first column of map output.
2024-11-13 17:57:31 +02:00
Matt Ellis
4c899fcc93 Simplify test code 2024-11-13 17:57:31 +02:00
Matt Ellis
84c7e1159b Introduce KeyStrokeTrie to find commands
Should also restore compatibility with idea-which-key
2024-11-13 17:57:31 +02:00
Matt Ellis
a745da9761 Add Shift+Enter mapping to scroll page forward
Fixes VIM-2752
2024-11-13 17:52:28 +02:00
Matt Ellis
92ee271f1e Add fallback if ve guicursor option not specified 2024-11-05 12:29:13 +02:00
Matt Ellis
babc5daf3b Use Visual-exclusive caret shape from guicursor 2024-11-05 12:29:13 +02:00
Alex Plate
5145bb4193
Mute some NeoVim tests 2024-11-05 11:50:44 +02:00
Alex Plate
a0f0f71b6a
Revert "Fix deprecated API usage"
This reverts commit b0dd75f77c.

Because of some reason, this place fails on TC. Let's deal with this later
2024-11-05 05:43:14 +02:00
Alex Plate
4ee858877d
Revert "Remove pre-242 workaround"
This reverts commit 727cfb36ba.
2024-11-05 04:16:32 +02:00
Matt Ellis
82d18cfbb9 Remove unused imports 2024-11-05 04:14:12 +02:00
Matt Ellis
b0dd75f77c Fix deprecated API usage 2024-11-05 04:14:12 +02:00
Matt Ellis
727cfb36ba Remove pre-242 workaround 2024-11-05 04:14:12 +02:00
Greg Shrago
0b1c79d961
Disable some IJ additional checks 2024-10-25 18:14:37 +03:00
Alex Plate
e1a803d310
Disable one more test that doesn't work on 242 2024-10-25 15:59:05 +03:00
Alex Plate
8b6de3f5c6
Fix split window tests for 242
The window splitting was refactored to initialize the editor async. So, we have to wait till the editor will become available.

This can't be done while holding the EDT, so we start this bunch of tests from the non-EDT thread.
2024-10-25 14:35:55 +03:00
Alex Plate
9014d99cde
Add a note that PluginStartup code should be updated and migrated to a different approach 2024-10-25 14:35:55 +03:00
Alex Plate
8dfd41a891
Refactoring: Move VimDocumentListener from multicaster to plugin.xml registration
The problem happens in tests: after the refactorings in 242, the `EditorListenerTracker` may be called before the initialization of the IdeaVim. In this case, it'll report the VimDocumentListener as a leaked listener, however, it's incorrect.
Generally, I think that this situation with the listener tracker is a bug.

There should be no changes in IdeaVim behaviour as the multicaster does the same thing: subscribes every editor on this listener. However, the multicaster does this in the "registerEditor" stage. However, I don't think this is a problem.
2024-10-25 14:35:55 +03:00
Alex Plate
7e62e816a5
Refactoring: Move FocusChangeListener from multicaster to per-editor subscription
The problem happens in tests: after the refactorings in 242, the `EditorListenerTracker` may be called before the initialization of the IdeaVim. In this case, it'll report the FocusChangeListener as a leaked listener, however, it's incorrect.
Generally, I think that this situation with the listener tracker is a bug.

There should be no changes in IdeaVim behaviour as the multicaster does the same thing: subscribes every editor on this listener. However, the multicaster does this in the "registerEditor" stage. However, I don't think this is a problem.
2024-10-25 14:35:55 +03:00
Alex Plate
1f6e124f9d
Fix(VIM-3676): Allow to set the handle for shortcuts with arrows
With the AI functionality, the shortcut ctrl-right got more important. However, previously it was defined as VIM_ONLY shortcut. However, taking the fact that IJ defines several actions for such shortcuts, it's not clear why we prohibit the users from using these shortcuts with the IDE actions.

Taking the fact, that we default shortcuts to VIM, I expect no changes in the behaviour.

However, just arrows are still hidden from setting the IDE handler. I think, it reduces the cognitive load for the user, especially taking the fact that arrows work almost equally in vim and IJ.
2024-10-21 17:56:44 +03:00
Kirill Karnaukhov
5198864f34 [ai-completion] LLM-11886: make AI completion invoke on Enter when IdeaVim is turned on 2024-10-21 17:02:36 +03:00
Matt Ellis
879d191800 Scroll caret into view after undo/redo
This is to ensure that 'scrolloff' is applied. Relates to VIM-3671
2024-10-21 15:50:58 +03:00
Matt Ellis
9d9e38843d Invoke undo/redo on correct editor
Fixes VIM-3671
2024-10-21 15:50:58 +03:00
Matt Ellis
f7aded99e8 Only perform incsearch in current project
Fixes VIM-3682
2024-10-21 15:50:58 +03:00
Matt Ellis
34fe09c8f9 Use full width of output panel for text 2024-09-05 19:22:04 +03:00
Matt Ellis
10283ce2f8 Add support for custom digraphs 2024-09-05 19:22:04 +03:00
Matt Ellis
cc53b59658 Add digraph headers 2024-09-05 19:22:04 +03:00
Matt Ellis
9c403d2862 Simplify creating string digraph key 2024-09-05 19:22:04 +03:00
Matt Ellis
ebbd733bba Update default digraphs to match current Vim
List is based on Vim's documentation, although not all digraphs are documented. Additional digraphs are added based on the output of `:digraphs`. These additional digraphs include some digraphs that produce the same character, so the code is updated to handle duplicates, with the same ordering/priority as Vim.

Extra digraphs include the Euro symbol (`=e` and `Eu`), quadruple prime (`4'`) and bullet (`oo`), amongst others.

Also removes a number of non-standard digraphs. The symbols generated don't match the descriptions. The code appears to be private use, so are not reliable. Once custom digraphs are implemented, they can be easily added back in `~/.ideavimrc`
2024-09-05 19:22:04 +03:00
Matt Ellis
9a7ff442f3 Correctly format RTL and combining digraph chars 2024-09-05 19:22:04 +03:00
Matt Ellis
3752a97d74 Output digraph character codes in decimal, like Vim
Not sure why IdeaVim has used hex. Vim appears to have used decimal for at least 20 years.
2024-09-05 19:22:04 +03:00
Matt Ellis
5572dfc80d Update digraph formatting to match Vim
Vim only use the `~` prefix if the encoding is "latin1". We can just treat it as though the encoding is Unicode, and match the other places we format printable characters. Note that for Vim, if `'display'` contains "uhex", then all unprintable characters are shown in hex, including control characters (`^C`, etc.). IdeaVim does not support the `'display'` option.
2024-09-05 19:22:04 +03:00
Matt Ellis
100f420d46 Strip trailing spaces 2024-09-05 19:22:04 +03:00
Matt Ellis
3fcc4746d8 Migrate digraph output to engine 2024-09-05 19:22:04 +03:00
Matt Ellis
5c5ac192da Add tests for digraph output 2024-09-05 19:22:04 +03:00
Alex Plate
a0a2163ba0
Disable some action tests because they're broken in 242
Related: VIM-3376
2024-09-05 18:58:20 +03:00
Alex Plate
02724cadce
Fix the leaking timer in tests 2024-09-05 18:57:43 +03:00
Alex Plate
b205f87902
Disable tests for options for split window
The behaviour of FileEditorManagerEx.split has been changed, causing the tests to fail. This should be fixed in a separate commit
2024-09-05 18:57:12 +03:00
Alex Plate
785688b1ca
Fix compatibility in tests with 2024.2 2024-09-05 16:42:16 +03:00
Alex Plate
ee447bce07
Add a note to replace the raw string after the changes will be available
https://github.com/JetBrains/intellij-community/pull/2825
2024-08-30 18:57:00 +03:00
Alex Plate
ed2fcb08b0
[VIM-3620] Add a link to the usage survey 2024-08-30 18:34:10 +03:00
dedd90ce13 Fix(VIM-3615): Escape closes dialog while waiting for more keys 2024-08-30 16:46:53 +03:00
Alex Plate
a2bc34d6ec
[VIM-3620] Show the uninstall survey only when uninstalling IdeaVim 2024-08-30 16:41:36 +03:00
Matt Ellis
def9ca479b Ensure builder resets to a root command trie node
Also refactors command nodes a bit for better debug/trace output
2024-08-30 16:36:24 +03:00
Matt Ellis
09a335bcfe Start to encapsulate setting command builder state
Also rename `pushCommandPart` and `completeCommandPart`
2024-08-30 16:36:24 +03:00
Matt Ellis
13308050a8 Remove unnecessary OperatorArguments parameters 2024-08-30 16:36:24 +03:00
Matt Ellis
5bb0c4f7cb Use editor.mode instead of OperatorArguments.mode
`OperatorArguments.mode` is the mode *before* the command was completed, rather than the current mode, which is non-obvious. E.g. for a command in Insert mode, it will still be Insert, and for a (simple) command in Normal, it will still be Normal. The only difference is that a command such as `dw` would be in Operator-pending before the command is completed. That logic is not required for this method, so it's safe to use the current mode.

This allows us to start to deprecate `OperatorArguments.mode`.
2024-08-30 16:36:24 +03:00
Matt Ellis
00fd4cd491 Handle op-pending for space and backspace 2024-08-30 16:36:24 +03:00
Matt Ellis
55fef03a4a Add 'whichwrap' to dictionary 2024-08-30 16:36:24 +03:00
Matt Ellis
69b3e4f782 Start to refactor OperatorArguments 2024-08-30 16:36:24 +03:00
Matt Ellis
6be29b0378 Remove KeyHandler.isOperatorPending
It's easier to just look at mode. We don't need the additional check on command builder, because we can't be in OP_PENDING without pushing an operator action to the command builder
2024-08-30 16:36:24 +03:00
Matt Ellis
1c842eb3d8 Avoid exposing misleading count on command builder 2024-08-30 16:36:24 +03:00
Matt Ellis
d7e68488c8 Make Command.rawCount immutable 2024-08-30 16:36:24 +03:00
Matt Ellis
0a18c388e0 Simplify CommandBuilder
Fixes selecting last register if multiple registers are used in a command
2024-08-30 16:36:24 +03:00
Matt Ellis
1a3409e7df Remove count from motion argument
Only Command has a count. The motion argument is now a sealed class hierarchy, and consists only of the motion action and optional argument. This is to reduce confusion over which count to use, and potential incorrect calculation of the count
2024-08-30 16:36:24 +03:00
Matt Ellis
e93db961a0 Wrap offsets argument as an external action 2024-08-30 16:36:24 +03:00
Matt Ellis
8fd76bd08f Refactor properties for sealed Argument classes 2024-08-30 16:36:24 +03:00
Matt Ellis
0eea4a5b2c Introduce sealed classes to represent an argument 2024-08-30 16:36:24 +03:00
Alex Plate
64a89c8863
[VIM-3620] Add the uninstall survey
We're actively working on understanding the users and what we can improve in the plugin
2024-08-28 18:57:29 +03:00
Filipp Vakhitov
5b17d7740e Update generated files after merging PRs 2024-08-25 21:51:14 +03:00
filipp
9bbeab8062 VIM-2074 Backspace behaviour is incorrect in Replace mode 2024-08-23 14:22:48 +03:00
filipp
373bfc4eab Add endOffset to LiveRange 2024-08-23 14:22:48 +03:00
Filipp Vakhitov
b005328b4a Exclude generated files from .gitignore
I've also added sorting to be more confident that the generated file will be persistent across different machines
2024-08-23 14:18:03 +03:00
Filipp Vakhitov
ad20021cee Remove currentAction and some unused code 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
126de5c218 Remove package-info.java 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
0f7aef3f15 Fix tests 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
f352b84922 Move some Executor logic to its base class 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
8205c74571 Remove some old bindings 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
def40eb409 Save last entry on every command line text update 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
010e8a7541 Support <C-U> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
46c6778b3a Support <Down>, <S-Down>, <C-N>, <PageDown> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
0977bd4400 Support <Up>, <S-Up>, <C-P>, <PageUp> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
db092e9b0a Support history in VimCommandLine 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
5cfb98e188 Remove some old bindings 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
3a95b62885 Support <Insert> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
93e6adf5a9 Support <C-W> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
37204398ff Support <C-Right>, <S-Right> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
b2f450d14d Support <C-Left>, <S-Left> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
1dc7ea6363 Register all shortcuts without references on ExKeyBindings
All the shortcuts will be removed from ExKeyBindings, but they still need to be registered
2024-08-23 14:18:03 +03:00
Filipp Vakhitov
bb507db884 Remove swing bindings that are already implemented 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
1c79b0d59a Support <Right> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
ff4eb31418 Support <Left> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
cb1078cf70 Support <C-H> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
da3e40eaf6 Support <C-E>, <End> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
17f77a9639 Support <C-B>, <Home> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
3d03494354 Support <DEL> in command mode 2024-08-23 14:18:03 +03:00
Filipp Vakhitov
642caddda7 Support <BS> in command mode 2024-08-23 14:18:03 +03:00
The1xDeveloper
3ba14d05b4 VIM-566: Add za motion support for toggling folds 2024-08-16 12:28:18 +03:00
Filipp Vakhitov
2189b70b87 Fix(VIM-3601): The escape characters in IdeaVim's configuration file are invalid 2024-08-14 18:18:55 +03:00
Filipp Vakhitov
7d68d41888 Fix(VIM-3580): New terminal switches editor to insert mode 2024-08-12 13:44:24 +03:00
Filipp Vakhitov
1a2322ddec OutputPanel no longer ignores key events 2024-08-10 23:55:57 +03:00
Alex Plate
8d5df11372
Add a warning when the action is executed from the write action
Related: VIM-3376
2024-08-06 11:11:40 +03:00
Matt Ellis
dfebe542d8 Fix incsearch highlight in multiple Rider instances
Unlike other IDEs, Rider has multiple client sessions. The IDE itself is the "local" session, while the external ReSharper process is treated as a "frontend" process. The code to get local editors was erroneously getting `ALL` sessions, rather than just `LOCAL` sessions, and assuming that the first was the local session. In Rider, opening three instances would add three additional clients, and that would change the order.

I don't know why I changed `LOCAL` to `ALL` when previously changing this bit of code. AIUI, using `LOCAL` should work fine. If it turns out that CWM or remote dev require `ALL`, please document why.

Fixes VIM-3549
2024-08-05 18:58:45 +03:00
Alex Plate
d02f0e17ca
Revert "Fix(VIM-3376): Refactor the way IdeaVim executes actions"
This reverts commit 24514039
2024-07-31 13:14:25 +03:00
Filipp Vakhitov
5dc860f61e Fix(VIM-3569): Pipe-symbol can no longer be used in remaps 2024-07-30 18:02:12 +03:00
Alex Plate
956e726c31
Add test 2024-07-29 17:48:07 +02:00