[GH-ISSUE #295] <nobr> like functionality for TextView? #228

Closed
opened 2026-03-04 01:03:09 +03:00 by kerem · 2 comments
Owner

Originally created by @mikeschinkel on GitHub (Jun 5, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/295

I am finding a need for a "No Break" feature in TextView similar to the <nobr></nobr> of HTML. Specifically I am using WordWrap and I want to have quoted strings to call them out as definitions, e.g. "Provide a 'TextView' object for displaying text" but I am finding that wrapping is happening at the quote and so I get some like thing:

......................... Provide a '
TextView' object for displaying text.

Maybe an even simpler option would be to not wrap on quoted strings, except inside the string when there is no option?

Originally created by @mikeschinkel on GitHub (Jun 5, 2019). Original GitHub issue: https://github.com/rivo/tview/issues/295 I am finding a need for a "No Break" feature in TextView similar to the `<nobr></nobr>` of HTML. Specifically I am using `WordWrap` and I want to have quoted strings to call them out as definitions, e.g. _"Provide a 'TextView' object for displaying text"_ but I am finding that wrapping is happening at the quote and so I get some like thing: ``` ......................... Provide a ' TextView' object for displaying text. ``` Maybe an even simpler option would be to not wrap on quoted strings, except inside the string when there is no option?
kerem closed this issue 2026-03-04 01:03:09 +03:00
Author
Owner

@rivo commented on GitHub (Jul 5, 2019):

The problem in your case is rather that WordWrap() shouldn't have broken the string after the '. I think I used the wrong regex character class here. The latest commit fixes this.

Apart from that, it's unlikely that I will introduce a nobr-like tag in the near future. With all the tags tview already supports, the code has become very complex and I've rewritten it multiple times. It would be heading towards an "HTML widget" which is an entire project on its own. I have no plans for something like that.

<!-- gh-comment-id:508720643 --> @rivo commented on GitHub (Jul 5, 2019): The problem in your case is rather that `WordWrap()` shouldn't have broken the string after the `'`. I think I used the wrong regex character class here. The latest commit fixes this. Apart from that, it's unlikely that I will introduce a `nobr`-like tag in the near future. With all the tags `tview` already supports, the code has become very complex and I've rewritten it multiple times. It would be heading towards an "HTML widget" which is an entire project on its own. I have no plans for something like that.
Author
Owner

@mikeschinkel commented on GitHub (Jul 5, 2019):

@rivo Thanks.

<!-- gh-comment-id:508814765 --> @mikeschinkel commented on GitHub (Jul 5, 2019): @rivo Thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#228
No description provided.