Commit a0bdc14

Richard Luby <richluby@gmail.com>
2016-11-18 10:25:49
fixed display not updating if user scrolled
display updates at beginning of command loop so that user always has most up to date view. pressing enter now returns to the bottom of the view
1 parent f147f10
Changed files (1)
clientVisualization.go
@@ -270,6 +270,7 @@ func clearScreen(command Command) error {
 // pressing 'Enter'
 func handleEnterKeyPress(g *gocui.Gui, v *gocui.View) error {
 	view, err := ApplicationView.MainGui.View(ApplicationView.MAIN_WINDOW_NAME)
+	view.Autoscroll = true
 	if readUserInputSemaphore.Queued() > 0 {
 		readUserInputSemaphore.V() //taken whenever user input is required
 		return nil
@@ -307,7 +308,6 @@ func handleEnterKeyPress(g *gocui.Gui, v *gocui.View) error {
 			log.Printf("Error while executing command: %+v", err)
 			setStatusBar(fmt.Sprintf(COLOR_RED+"Error while executing command: %+v"+COLOR_RESET, err))
 		}
-		view.Autoscroll = true
 		updateMainView()
 	}()
 	return nil