matze / vim-move

Plugin to move lines and selections up and down
http://www.vim.org/scripts/script.php?script_id=4687
MIT License
1.21k stars 56 forks source link

Use silent to avoid 'Hit ENTER to continue' prompts #54

Closed hugomg closed 4 years ago

hugomg commented 4 years ago

Some commands such as :move and >> can output messages and when there are 2 or more lines of these messages it can cause a 'Hit ENTER to continue' prompt, which interrupts the flow of moving things up and down.

Instead of trying to identify exactly which chatty commands need to be silenced, we simply use silent in the root function call, which ensures that absolutely everything gets silenced.

I think this bug was already present in older versions of the plugin but I might have made it worse by getting rid of some calls to :silent and by adding the calls to >> and <<, which where the last drop in the bucket necessary to trigger this round of "Hit ENTER to continue" prompts. That said, maybe the new approach of silencing the root function calls might be more robust than the old approach of silencing the leaf commands.

matze commented 4 years ago

Works fine, thanks :+1: