Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: smear to command line #71

Merged
merged 4 commits into from
Dec 26, 2024
Merged

feat: smear to command line #71

merged 4 commits into from
Dec 26, 2024

Conversation

sphamba
Copy link
Owner

@sphamba sphamba commented Dec 26, 2024

Use vim.uv timer intervals instead of timeouts for animation, which doesn't freeze when opening the command line.

Changes

  • replace vim.defer_fn(animate, config.time_interval) with timer:start(0, config.time_interval, vim.schedule_wrap(animate))
  • remove drawing of previous smear on fast cursor move to avoid random jumps
  • add smear to command line and command window

Related GitHub issues and pull requests

@sphamba
Copy link
Owner Author

sphamba commented Dec 26, 2024

The smear appears when hitting a keybinding that does : ... <cr>, which is not desirable. Events CmdlineEnter, CmdlineChanged, and CmdlineLeave are triggered

This was referenced Dec 26, 2024
@ColinKennedy
Copy link

ColinKennedy commented Dec 26, 2024

@sphamba see :help <cmd>

- Because <Cmd> avoids mode-changes (unlike ":") it does not trigger
  |CmdlineEnter| and |CmdlineLeave| events. This helps performance.

AFAIK any keymap starting with : and ending with <cr> can be replaced with <cmd>. The purpose of <cmd> is to run a command without changing modes after all.

@sphamba
Copy link
Owner Author

sphamba commented Dec 26, 2024

AFAIK any keymap starting with : and ending with <cr> can be replaced with <cmd>. The purpose of <cmd> is to run a command without changing modes after all.

@ColinKennedy I didn't know that, well that solves it :) Thanks!

@sphamba sphamba merged commit e6de22f into main Dec 26, 2024
1 check passed
@sphamba sphamba deleted the feat-smear-to-cmd branch December 26, 2024 22:12
@ColinKennedy
Copy link

It's my pleasure! This plugin has just been too much fun not to use!

@sphamba sphamba added the enhancement New feature or enhancement label Dec 30, 2024
@sphamba sphamba changed the title Feat: smear to command line feat: smear to command line Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Smear when jumping to command
2 participants