Skip to content

fix(align): react to Nightly changes regarding hit-enter prompt - #2597

Closed
abeldekat wants to merge 1 commit into
nvim-mini:mainfrom
abeldekat:fix_align
Closed

abeldekat wants to merge 1 commit into
nvim-mini:mainfrom
abeldekat:fix_align

Conversation

@abeldekat

Copy link
Copy Markdown
Member

Details:

  • See PR 42793 in neovim/neovim

Failing test: T['Align with preview']['works'], only when parametrized with 'Normal-*'. In the fifth screenshot the command line is not cleared.

I replayed the test manually step by step and everything seems to work correctly. So, perhaps this is 'rpc' related. I could not apply a fix in the test itself unfortunately. An extra H.unecho() does the trick. Perhaps there is a better solution?

@abeldekat

Copy link
Copy Markdown
Member Author

The fix might be simpler:

H.unecho = function()
  -- if H.cache.msg_shown then vim.cmd([[echo '' | redraw]]) end
  if H.cache.msg_shown then vim.cmd([[redraw | echo '']]) end
end

All tests in test_align succeed using all supported Neovim versions. I also ran the failing test by hand. After pressing <CR>, the command line is cleared as expected.

@echasnovski

Copy link
Copy Markdown
Member

The fix might be simpler:

Hmm... If that is the case, that's great. It's just slightly suspicious that this order works, since the logical order of things is "first show message, then ensure it is shown by redraw". But Vim screen drawing might have some parts that don't look logical at first. I'll need to take a closer look, since that order was chosen for (some) reason.

@abeldekat

Copy link
Copy Markdown
Member Author

Hmm... If that is the case, that's great....

Its' used in quite some places. In mini.visits I saw a reference to :h echo-redraw, where the example also reverses the calls:

:new | redraw | echo "there is a new window"

@echasnovski

Copy link
Copy Markdown
Member

This should now be resolved on the latest main. I remembered that I wanted to replace the whole :echo '' | redraw with a single :mode (which seems to do just that, but with a rather non-descriptive name). This reduces code and makes Neovim>=0.13 tests work again.

Thanks for finding the culprit. It made finding the solution much easier :)

@abeldekat

Copy link
Copy Markdown
Member Author

Thanks for finding the culprit. It made finding the solution much easier :)

My pleasure!

@abeldekat
abeldekat deleted the fix_align branch November 12, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants