Commit Graph
6355 Commits
Author SHA1 Message Date
chylex 0ccec074f2 Work around sticky lines with scrolloff=999 2026-11-23 02:10:50 +01:00
chylex 39479aadf3 Disable paragraph-motion plugin bindings for operator-pending mode 2026-11-23 02:10:50 +01:00
chylex 25d4a4e83d Make search highlights temporary 2026-11-23 02:10:49 +01:00
chylex 8c859519a0 Disable IdeaVim in popup editors 2026-11-23 02:10:49 +01:00
chylex 10beddd997 Fix AltGr not triggering Ctrl-Alt bindings on Windows 2026-11-23 02:10:48 +01:00
chylex 503348d2e5 Add functions: isinplacerenaming, isactionenabled, getfiletype 2026-11-23 02:10:48 +01:00
chylex b1cf787244 Preserve visual mode after executing IDE action 2026-11-23 02:10:48 +01:00
chylex f1eb1ce1d0 Make g0/g^/g$ work with soft wraps 2026-11-23 02:10:48 +01:00
chylex 90b361c2d6 Do not switch to normal mode after inserting a live template 2026-11-22 19:45:04 +01:00
chylex 4abfa55ecd Exit insert mode after refactoring 2026-11-22 19:45:03 +01:00
chylex 6a49a51572 Add action to run last macro in all opened files 2026-11-22 19:45:03 +01:00
chylex 1137faac14 Fix losing yanked text when number of carets changes 2026-11-22 19:45:03 +01:00
chylex 1f1c61e434 Apply scrolloff after executing native IDEA actions 2026-11-22 19:45:02 +01:00
chylex 0ae6062e54 Automatically add unambiguous imports after running a macro 2026-11-22 19:45:02 +01:00
chylex dbb09bc501 Fix(VIM-3986): Exception when pasting register contents containing new line 2026-11-22 19:45:02 +01:00
chylex ea94523cbe Fix(VIM-3179): Respect virtual space below editor (imperfectly) 2026-11-22 19:45:02 +01:00
chylex 1823be2d97 Fix vim-surround not working with multiple cursors or count 2026-11-22 19:19:27 +01:00
chylex cf077f602d Change matchit plugin to use HTML patterns in unrecognized files 2026-11-22 04:15:45 +01:00
chylex 4345a3c814 Fix ex command panel causing Undock tool window to hide 2026-11-22 04:15:45 +01:00
chylex be1c0e4c9f Restore normal or visual mode when switching active editor 2026-11-22 04:15:42 +01:00
chylex c837129903 Remove notifications about configuration options 2026-11-22 04:15:08 +01:00
chylex d5688d4270 Set custom plugin version 2026-11-22 04:15:08 +01:00
IdeaVim Bot 48a99705bd Preparation to 2.49.1 release 2026-11-20 11:53:00 +00:00
1grzyb1 7719081d2d VIM-2742 Trim inner spaces when deleting surround with an opening bracket
ds(, ds[, ds{ and ds< left the whitespace between the bracket and its
content in place, so a call like `someFnc(\n  {...}\n)` became
`someFnc  {...}`. vim-surround strips spaces and tabs from both ends of
the inner text whenever the original surrounding is given by its opening
bracket, and keeps them for the closing one. The trim no longer removes
newlines, so multiline content keeps its line structure.
2026-11-20 12:42:27 +01:00
1grzyb1 0bb539e538 VIM-2609 Measure line indent with the code style tab size when shifting
Shifting lines took the current indent width from the editor's logical
column, which expands tabs with the editor's tab size, but built the new
indent with the code style tab size. When those differ (e.g. language
injections, indent detection), each shift added stray spaces after the tabs.
2026-11-20 12:23:20 +01:00
1grzyb1 3b42f660a1 VIM-4259 Put the clipboard back after the backend paste in split mode
With ideaput, the register is put into the clipboard for the IDE paste and the
clipboard is put back afterwards (VIM-4371). In split mode the backend executes
the paste again with its own clipboard, which is synced from the frontend.
Since 2026.3 (IJPL-254899) the backend runs the action after a hop to the EDT,
so the clipboard that was put back reaches it first, and the backend pastes the
old system clipboard over the register text.

The frontend editor action handler completes a continuation from the data
context once the backend has executed the action. A new frontend split module
puts it there, and the clipboard is put back only after it completes, with a
timeout. Before 2026.3, or with the document synced by Rhizome, the clipboard
is still put back right away.

Several puts in a row are all sent before the first one is pasted on the
backend, so the clipboard is put back once, after the last of them. Until then
each put and each read of the clipboard register take the content from before
the first put, and a write of the clipboard by IdeaVim drops the pending
restore.
2026-11-20 11:14:03 +01:00
1grzyb1 6ce279f352 VIM-2593 Compile the terminal navigation test on 2026.2
The test reached the internal key handling of the terminal through
TerminalEventsHandler and setupKeyEventHandling. In 2026.2 they are
TerminalKeyEventsHandler and setupKeyEventsHandling, and newer platforms
pass a plain KeyEvent instead of TimedKeyEvent, so the tests didn't
compile on 2026.2.

The test now looks up the function by either name and builds the handler
as a proxy of its parameter type, so it doesn't refer to the terminal
types at all.
2026-11-20 09:17:47 +01:00
1grzyb1 9fc1b4bc45 VIM-2608 Place block insert replay at buffer columns
The repeat column of a block insert/change is a buffer (logical) column,
but the replay on the following lines moved the caret to that number as a
visual column. The two differ whenever the line has collapsed folds or
when tab widths in pixels make a tab count as more visual columns than its
logical width, so after a few leading tabs the text went in one character
too early. Move to the buffer position instead and check line length in
buffer columns.
2026-11-19 12:24:20 +01:00
1grzyb1 2744cad962 VIM-2593 Navigate out of the terminal with <C-W>
With "Override IDE shortcuts" on, the terminal sends every key to the
shell from its own IdeEventQueue dispatcher, unless the key is the keymap
shortcut of an action on its allowlist. The <C-W> shortcuts of
ToolWindowNavDispatcher are registered on the component, not in the
keymap, so in the terminal <C-W> deleted a word in the shell and the
direction key was typed there too.

A queue dispatcher of our own now runs before the terminal's one and,
while the focus is in the Terminal tool window, gives the keys of a <C-W>
sequence to ToolWindowNavDispatcher directly. Going through the action
system doesn't work there: for the keys on the terminal's allowlist, such
as the arrows or Enter, the terminal's own action wins, and plain letters
aren't shortcuts in an editable editor. The terminal adds its dispatcher
whenever it gets the focus, so ours is added when VimEverywhere starts.

The test runs the terminal's real key dispatcher, so it fails if the
terminal starts to take the keys before the dispatchers added earlier.
2026-11-19 12:18:54 +01:00
1grzyb1 47094464e2 VIM-2726 Educate quotes in textobj-quote
Adds the educate feature of vim-textobj-quote: after :Educate, " and '
typed in Insert mode become typographic quotes, an opening one at the
start of a line, after a space or after one of [({& and a closing one
elsewhere, so don't is typed as don’t. :NoEducate and :ToggleEducate
turn it off or switch it.

The state is kept per buffer in b:textobj_quote_educate_mapped, and
g:textobj#quote#educate turns it on for all buffers. It is off by
default, unlike in Vim where it only applies to the buffers the plugin
is initialized in, because here it would replace the quotes typed in
code too. When it is off, the quotes are typed as usual, so the IDE
still inserts the closing pair.
2026-11-19 10:39:45 +01:00
1grzyb1 9e80c279fd VIM-2726 Do not map keys inserted with CTRL-V or CTRL-K
A character typed after CTRL-V, or the one made from a CTRL-K digraph,
was fed through the key handler again with mappings allowed, so with
inoremap a b, <C-V>a inserted b. It also made it impossible to type a
straight quote while textobj-quote educates quotes, since <C-V>" ended
up in the " mapping. Vim reads these keys without mappings and inserts
the result as it is.
2026-11-19 10:39:45 +01:00
1grzyb1 915c322bb4 VIM-2726 Add textobj-quote extension
Port of preservim/vim-textobj-quote, requested in VIM-2726. Adds the iq/aq
text objects for text inside typographic double quotes and iQ/aQ for
single ones, so prose with curly quotes can be changed, deleted or
selected the same way as text in straight quotes.

A closing ’ followed by a letter or a digit is taken for an apostrophe,
nested quotes of the same kind are skipped, and the keys and the quote
characters can be changed with the g:textobj#quote#doubleMotion,
g:textobj#quote#singleMotion, g:textobj#quote#doubleDefault and
g:textobj#quote#singleDefault variables. Educating quotes while typing
is left for a separate change.
2026-11-19 10:39:45 +01:00
1grzyb1 38c5318528 VIM-2726 Allow autoload names in variables
Plugins configured through autoload-style variables, such as
g:textobj#quote#doubleMotion, could not be set from .ideavimrc: the
grammar accepted the # namespace separator only in function names, so
the assignment silently did nothing. Variable names now take the same
foo#bar# prefix as function calls and keep it as part of the name.
2026-11-19 10:39:45 +01:00
1grzyb1 e5f7b210ed VIM-4332 Take command line background from the editor colour scheme
The command line and the output panel took the text colour from the editor
colour scheme, but the background from the IDE theme. With a light colour
scheme in a dark theme this drew dark text on a dark background. Take the
background from the same colour scheme as the text.
2026-11-18 11:16:47 +01:00
IdeaVim Bot 08b853787b Preparation to 2.49.0 release 2026-11-18 09:24:54 +00:00
1grzyb1 fa7deb62c0 Move changes released in 2.48.0 out of To Be Released
The langmap replay fix and PRs 2141, 2142, 2143, 2147, 2154 and 2158
were already part of 2.48.0, so they must not be announced again on the
What's New page of the upcoming release.
2026-11-18 09:33:36 +01:00
claude[bot]andClaude Opus 5.5 4115552f28 Prepare What's New for the upcoming release
Add the missing user-facing entries to the changelog and create the
What's New page for the upcoming release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 09:33:36 +01:00
1grzyb1 fc80f75f21 VIM-4380 Look up document language for 'colorcolumn' and 'textwidth' in a read action
The diff viewer creates its editors on the EDT without a read lock, and
editorCreated initialises the new window's local options. Resetting
'colorcolumn' and 'textwidth' to their global values looks up the
document's language for code style settings. Since 2026.3 this goes
through the editor's code insight context, which asserts read access
when shared source support is enabled.
2026-11-18 09:28:41 +01:00
1grzyb1 9cf19ae343 VIM-2363 Add lion extension
Port of tommcdo/vim-lion, requested in VIM-2363. Adds the gl and gL
operators that align the text covered by a motion or a Visual selection
to a character, so lists of assignments, maps or tables don't have to be
aligned by hand.

Supports a count, a number before the character to start at a later
occurrence, <Space> to align words, / to align to a pattern, the
g:lion_create_maps, g:lion_map_right, g:lion_map_left, g:lion_prompt and
b:/g:lion_squeeze_spaces variables, characterwise and blockwise
selections limited to their columns, and dot-repeat.
2026-11-18 08:45:04 +01:00
1grzyb1 d52f347af3 VIM-3113 Do not look up PRIMARY in a headless IDE
AWT throws HeadlessException on the system selection lookup on a headless
Linux instead of returning null, which broke every test setting 'clipboard'
without autoselect on CI.
2026-11-17 11:41:54 +01:00
1grzyb1 2909ddec4d VIM-3113 Do not leave the PRIMARY registry override in the saved settings
Without autoselect in 'clipboard' IdeaVim turned off the platform's PRIMARY
update through the registry and put the previous value back on dispose. The
registry has no runtime-only values: the override was saved with the IDE
settings (on exit the settings are saved before plugins are disposed), and the
next start took the saved false as the previous value. One session with
clipboard=unnamed disabled PRIMARY for editor selections and the terminal's
copy on selection for good, also after removing IdeaVim.

Now restore resets a programmatically set false to the default (a false set in
the Registry dialog is kept), runs before the settings are saved on exit, and
cleans up a false saved by an earlier session or EAP build. The override is
applied only where PRIMARY exists: elsewhere it only broke the terminal.
2026-11-17 11:41:54 +01:00
1grzyb1 305f7ad400 VIM-4370 Don't wait for the backend before the first command in a document
In Rider split mode the first Insert-mode edit in a session could get lost,
e.g. after `13GA<CR>// abc<Esc>` the text never appeared.

The undo step was closed when the document had never been seen before, so
the first command, even a motion like `G`, made a blocking call to the
backend. The call runs a modal progress, and until its dialog is shown the
platform consumes every input event. The keys typed meanwhile, here `A`,
were dropped.

The document's stamp is now remembered when IdeaVim initialises the editor,
so the first command closes the step only if something changed since then.
Changes made before it, e.g. by a test's setText, still stay a separate undo
step.

Keys typed during the call after a changing command can still be dropped.
Not waiting for the backend at all doesn't work: the call's modal progress
is what sends the previous command's document patches to the backend
before the request, and without it the undo steps of mappings and macros
merge.
2026-11-17 10:58:31 +01:00
1grzyb1 a4dc442b25 VIM-4379 Do not scan all keys on every keystroke
Key.findKeyByName copies and walks every Key in the application while holding
a global lock. IdeaVim called it several times on every keystroke: from
isIdeaVimDisabledHere (commit window and Kotlin decompiled file checks) and
from the smart step into workaround in VimShortcutKeyAction. On a big project
with many keys this froze the UI. A missing key, e.g. the Kotlin one in an IDE
without Kotlin, was the worst case, because the scan always ran to the end.

NamedKey remembers the key once it is found. While the key is missing, it only
checks keys created since the previous lookup. Key indices only grow, and the
owner may create its key later, when its class is loaded, so this never misses
a new key. The key is held weakly, so it doesn't keep an unloaded plugin alive.

isAllowedFileEditor now runs the cheap and most common checks first, and
isEnabledConsole checks the option before inspecting the editor.
2026-11-17 09:09:30 +01:00
claude[bot]andClaude Opus 5.5 521719c89c Compose jumpListId through VimWindowIdService.getWindowScopeId
IjVimEditor.jumpListId built the window scope id by hand as
"$projectId/$windowId", duplicating the encoding that
VimWindowIdService.getWindowScopeId documents as having a single home
(and that projectIdOf takes apart). The other callers already use the
helper; route this one through it too so the separator cannot drift.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:42:51 +01:00
1grzyb1 077733c566 Wait for edits to reach the change list in g; tests
Edits reach ChangeListService through a remote topic, and broadcast only
queues the event, so it arrives asynchronously even in the monolith. When g;
ran before the last edit was recorded it walked a stale list and the test
landed on the wrong change. The tests now wait for every edit to be recorded
before typing the next keys.
2026-11-16 11:02:27 +01:00
1grzyb1 bed5ee90bd Give visual mode more time to start after an IDE selection
DeleteVisualActionTest.test delete after extend selection kept failing on the
Nvim job with "Condition not met within timeout". IdeaVim enters visual mode
'ideavisualdelay' ms after the selection changes, and the tests waited only
200 ms on top of that, which is not enough on a loaded agent.
2026-11-16 11:02:27 +01:00
1grzyb1 399f810862 VIM-4378 Do not normalize the caret in an editor disposed by the action
IdeaVim normalizes the caret after every IDE action. When the action disposes
its editor, e.g. closes the tab, the caret normalization asks the disposed
editor for positions and the platform throws "Editor is already disposed".
The vimInitialised guard does not help: the platform disposes the editor
synchronously, while IdeaVim deinitializes it in a later event.

The throw also skipped clearing the listener's editor field. Every later
action without an editor in its context, e.g. from a tool window, normalized
the disposed editor again and threw again, and the editor leaked.

afterActionPerformed now takes and clears its per-action state first and drops
a disposed editor, and both normalization paths skip a disposed editor.
2026-11-16 10:38:24 +01:00
1grzyb1 a32fa20e86 VIM-4377 Dispose enabled extensions when IdeaVim is turned off
Extensions like NERDTree register key handlers outside the editor, in the project tree. Turning IdeaVim off only unsubscribed the editor listeners, so those handlers kept intercepting keys while IdeaVim was off. Turning IdeaVim off now disposes the enabled extensions, and turning it back on initialises them again. ideavimrc runs only once, so without this the extensions would stay dead until restart.

TableEverywhere and NerdTreeEverywhere keep a reference to the currently focused component and unregister it on dispose. Their focus listener is removed at that point and can no longer clean up after the focused table or tree.
2026-11-16 10:30:12 +01:00
IdeaVim Bot ddffbfcf80 Update help file 2026-11-16 08:52:03 +00:00
1grzyb1 e3139dc049 VIM-4374 Push ReSharper navigation to a declaration onto the tag stack in Rider
In Rider, Ctrl+Click and the hotkeys run backend actions through one composite action without an ID, and ReSharper
picks which of them to run, so the action listener never saw Go to Declaration and nothing went onto the tag stack.
When Go to Declaration did show up, e.g. for <C-]>, the backend ran it a second time for the same jump, which pushed
the position twice.

For actions that navigate on the backend, the listener now only marks a tag jump as expected. A composite action
counts as one when the keymap binds its shortcut to a tag action. The position goes onto the stack when ReSharper's
navigation command (NavigationHost.SendNavigation) starts, while the caret is still where the jump starts from. That
pushes once per navigation, and only when one happens. In split mode the JetBrains Client has no Rider modules and
sees Go to Declaration itself, so it keeps pushing before the action.
2026-11-16 09:49:40 +01:00