From edd25c68eebe27dd2e2e3b4a6dba378d218a5428 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Wed, 12 Oct 2016 16:30:32 -0400 Subject: [PATCH] Fix glitch with bottomline when softwrap is disabled --- cmd/micro/view.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 8474a623..59cb3dac 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -615,6 +615,7 @@ func (v *View) DisplayView() { screenX, screenY := v.x, v.y-1 highlightStyle := defStyle + curLineN := 0 // ViewLine is the current line from the top of the viewport for viewLine := 0; viewLine < v.height; viewLine++ { @@ -622,10 +623,9 @@ func (v *View) DisplayView() { screenX = v.x // This is the current line number of the buffer that we are drawing - curLineN := viewLine + v.Topline + curLineN = viewLine + v.Topline if screenY >= v.height { - v.Bottomline = curLineN break } @@ -872,6 +872,10 @@ func (v *View) DisplayView() { } } } + v.Bottomline = curLineN + if !v.Buf.Settings["softwrap"].(bool) { + v.Bottomline++ + } } // DisplayCursor draws the current buffer's cursor to the screen