You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
First of all, great performance improvements in the latest update - actually made me revist a programme I was working on. However I have come across a bug regarding textwrapping and being redrawn to the terminal.
Essentially when a string is formatted (for example with a colour) and that text is wrapped, if you scroll past it (so it isnt rendered) and then scroll back up (to re-render it) the wrapped portion of the string loses its formatting.
The loss of formatting occurs when scrolling with mouse wheel or using the arrow keys for navigation. However, when using the Page Up and Page Down keys, the formatting is preserved. The behavior with the scroll wheel is inconsistent - sometimes the formatting remains intact, while other times it gets lost. In contrast, the issue consistently arises when using the arrow keys.
In addition the formatting seems inconsistant when using the arrow keys even without reloading - occasionally the wrapped text wont have the formatting applied at all, again using PgUp/PgDown doesnt have this issue. I couldnt work out a cause for this.
To Reproduce
An example to reproduce below (ensure terminal is narrow enough to wrap the highlighted text)
use std::thread::spawn;use minus::{Pager, dynamic_paging};use crossterm::style::{StyledContent,Stylize};fnmain(){letmut pager = Pager::new();let pager2 = pager.clone();let pager_thread = spawn(move || dynamic_paging(pager2));// Create formatted stringlet string_to_print = format!("{}{}{}", "1".repeat(110), "2".repeat(50), "\n\n");let search = "1111111112222";let styled_sequence = string_to_print.replace(search,&search.dark_yellow().to_string());// It also happens using terminal escape codes (see below)//let styled_sequence = string_to_print.replace(search, &format!("\x1b[33m{}\x1b[0m", search));
pager.push_str(styled_sequence.repeat(100)).unwrap();
pager_thread.join().unwrap();}
Expected behavior
Formatting is preserved when wrapped and reloaded after scrolling past.
Screenshots
As you can see the first 4 rows have been scrolled past, and reloaded and they lose the yellow formatting:
Desktop:
WSL2 Ubuntu 22:04
zsh
5.6.1
Additional context
I have also replicated this issue on native Ubuntu 23
The text was updated successfully, but these errors were encountered:
First of all, great performance improvements in the latest update - actually made me revist a programme.
Thanks! Future releases will also have a lot of work on more performance.
Unfortunately I am not getting enough time right now to actively fix these types of bugs that require a proper debugging session because I am preparing for my exams in May. I will come back to this once my exams are over and life is a bit sorted :). I hope you will bear me.
In the meantime if you want to contribute, feel free to throw in a PR. In case you need help, ask it over on Discord. I regularly check in there.
Describe the bug
First of all, great performance improvements in the latest update - actually made me revist a programme I was working on. However I have come across a bug regarding textwrapping and being redrawn to the terminal.
Essentially when a string is formatted (for example with a colour) and that text is wrapped, if you scroll past it (so it isnt rendered) and then scroll back up (to re-render it) the wrapped portion of the string loses its formatting.
The loss of formatting occurs when scrolling with mouse wheel or using the arrow keys for navigation. However, when using the Page Up and Page Down keys, the formatting is preserved. The behavior with the scroll wheel is inconsistent - sometimes the formatting remains intact, while other times it gets lost. In contrast, the issue consistently arises when using the arrow keys.
In addition the formatting seems inconsistant when using the arrow keys even without reloading - occasionally the wrapped text wont have the formatting applied at all, again using PgUp/PgDown doesnt have this issue. I couldnt work out a cause for this.
To Reproduce
An example to reproduce below (ensure terminal is narrow enough to wrap the highlighted text)
Expected behavior
Formatting is preserved when wrapped and reloaded after scrolling past.
Screenshots
![image](https://private-user-images.githubusercontent.com/22332035/321275703-7cd63290-bb54-40d6-986b-d276f3c1e612.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg0MzI3NzYsIm5iZiI6MTcxODQzMjQ3NiwicGF0aCI6Ii8yMjMzMjAzNS8zMjEyNzU3MDMtN2NkNjMyOTAtYmI1NC00MGQ2LTk4NmItZDI3NmYzYzFlNjEyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE1VDA2MjExNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThiNDVhM2JkZDA1NzY3OGExNGJmODY5NmZkM2MzMjVmNmUxYjViZDNiMWNkOWEyNDFlNmFjYzY4NjY3MGI3NjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.unIEo0XQvteCSPumTNjnCS7v294BpWThaXR574sz5tk)
As you can see the first 4 rows have been scrolled past, and reloaded and they lose the yellow formatting:
Desktop:
Additional context
I have also replicated this issue on native Ubuntu 23
The text was updated successfully, but these errors were encountered: