Skip to content

Conversation

rozhelluk
Copy link
Contributor

Fixed two E5108 errors:

  • Buffer bounds checking in range_translate()
  • Coordinate validation in _coords2marks()

Works with startup: nvim +Pantran opens translation window immediately.

Added direct text input support:

  • :Pantran Hello, World! - translate text directly
  • nvim +"Pantran text" - start nvim with translation
  • Backward compatible with ranges and visual selection

rozhelluk and others added 4 commits July 18, 2025 03:00
Fixes E5108 error when erow exceeds buffer line count by adding bounds
checking before accessing line content.
…ange error

Clamp row/col values to buffer bounds in _coords2marks before calling
nvim_buf_set_extmark to fix E5108 invalid line errors.
Enable passing text directly to Pantran command instead of only
translating buffer content. Args without key=value are treated as text.
Document new features: passing text directly to :Pantran command
and using it with nvim startup for quick translations.
@rozhelluk
Copy link
Contributor Author

rozhelluk commented Jul 30, 2025

Now you can use some pretty cool things, such as:

nvim +"Pantran $(printf '%q' "$(wl-paste --primary 2>/dev/null || wl-paste)")"

This is how I use it in my Hyprland:

bind=$mod, I, exec,[float] alacritty -e nvim " " +"Pantran $(printf '%q' "$(wl-paste --primary 2>/dev/null || wl-paste)")"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant