Skip to content
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

[BUG] Unable to Fprintf to view #92

Closed
Rudi9719 opened this issue Jun 1, 2021 · 3 comments
Closed

[BUG] Unable to Fprintf to view #92

Rudi9719 opened this issue Jun 1, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@Rudi9719
Copy link

Rudi9719 commented Jun 1, 2021

Describe the bug
When trying to use Fprintf() on a view using the following code, nothing appears. It seems as if the view is rendering outside of the actual frame?

func printToView(viewName string, message string) {
	g.Update(func(g *gocui.Gui) error {
		updatingView, err := g.View(viewName)
		if err != nil {
			return err
		}

		if config.Basics.UnicodeEmojis {
			message = emojiUnicodeConvert(message)
		}
		fmt.Fprintf(updatingView, "%s\n", message)
		return nil
	})
}

To Reproduce
Steps to reproduce the behavior:

  1. Run https://github.com/rudi9719/kbtui (which was recently updated to catch up to gocui)
  2. Trigger printToView() which calls fmt.Fprintf on a view
  3. Profit

Expected behavior
The printed string would appear inside of the view being updated

Environment (please complete the following information):

  • OS: Linux imogene 5.11.19-1-MANJARO Add community documents #1 SMP PREEMPT Fri May 7 17:34:25 UTC 2021 x86_64 GNU/Linux
  • Version: go version go1.16.4 linux/amd64

Additional context
Not sure if this is due to recent changes or not; there were 3 code changes I had to make in order to get the code to build with the updated version of gocui. Seems like if I output enough to Fprintf() it'll EVENTUALLY show what I originally printed, but there's a hidden buffer of things I've printed waiting to actually render.

@Rudi9719 Rudi9719 added the bug Something isn't working label Jun 1, 2021
@mjarkk
Copy link
Member

mjarkk commented Jun 16, 2021

Bit late but create a PR #93 to fix your issue hopefully

@mjarkk mjarkk closed this as completed in 6d0c23c Jul 20, 2021
@dankox
Copy link

dankox commented Jul 22, 2021

@Rudi9719 sorry for the delay, but it should be fixed. Let us know if the latest master resolved your problem. Thanks.

@Rudi9719
Copy link
Author

Take all the time you need! This library saves me so much time lol I can confirm, the problem is indeed fixed in master!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants