mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #914] Bypassing text view and printing directly on screen using fmt.Print #665
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#665
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ArthurD3nt on GitHub (Nov 7, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/914
I have a simple Flex view with two panes, a sort of file explorer on the left and a markdown renderer view on the right
I want to use a custom renderer called glamour and (ideally) simply
fmt.Print()the output of the render like it's indicated on the library's wiki.So I basically want to avoid translating the output from ANSI to
TextViewusing theTranslateANSI()function that defeats the purpose of using this render, is there any way I can do that?Thanks
@rivo commented on GitHub (Nov 7, 2023):
This part I don't understand. It seems to me that
glamouroutputs ANSI escape codes. To display them in aTextView, you'll have to useTranslateANSI(). Or theANSIWriterif you're dealing with a continuous stream of text.@ArthurD3nt commented on GitHub (Nov 7, 2023):
That's what I thought at first but it seems that I lose some formatting by doing so.
By using the
TranslateAnsi()function like this:I get this output:

While I want to get this:

I read the docs of the function
TranslateANSI()and as the name rightly suggests it translates the string while I want to preserve the original formatting.Is there any way I can avoid to use textView to display the rendered result?