Skip to content

feat: add wrapped-default as render #286

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

Merged
merged 2 commits into from
Sep 22, 2024

Conversation

RenatoValentim
Copy link
Contributor

No description provided.

@RenatoValentim
Copy link
Contributor Author

RenatoValentim commented Jul 23, 2024

The wrap-default render ensures that long notification messages are displayed more user-friendly within the notification window. This prevents the message from exceeding the visible area or covering parts of the working file.
notify

@RenatoValentim
Copy link
Contributor Author

Code sample.

local notify = require('notify')
notify.notify(
  'Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis.',
  'info',
  { title = 'Lorem ipsum' }
)

@ernieIzde8ski
Copy link

Getting this error spam while trying to use wrapped-default:

image

- Added unit tests to validate `max_width` and ensure it does not exceed the terminal width.
- Ensured `prefix_length` is within the valid range to prevent 'col out of range' errors.
- Improved test coverage for rendering and notification layout in `nvim-notify`.

These changes address issues related to invalid column rendering and out-of-bounds errors.
@RenatoValentim
Copy link
Contributor Author

Thank you for bringing this to my attention! I have now added tests to cover the scenario you provided.

@rcarriga
Copy link
Owner

Thanks for the PR!

@rcarriga rcarriga merged commit fbef5d3 into rcarriga:master Sep 22, 2024
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.

3 participants