mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-04 22:20:20 +09:00
Fix redrawing for splits
This commit is contained in:
@@ -174,11 +174,11 @@ func InitScreen() {
|
||||
// RedrawAll redraws everything -- all the views and the messenger
|
||||
func RedrawAll() {
|
||||
messenger.Clear()
|
||||
DisplayTabs()
|
||||
messenger.Display()
|
||||
for _, v := range tabs[curTab].views {
|
||||
v.Display()
|
||||
}
|
||||
DisplayTabs()
|
||||
messenger.Display()
|
||||
screen.Show()
|
||||
}
|
||||
|
||||
|
||||
@@ -48,13 +48,14 @@ func (sline *Statusline) Display() {
|
||||
|
||||
// Maybe there is a unicode filename?
|
||||
fileRunes := []rune(file)
|
||||
viewX := sline.view.x
|
||||
for x := 0; x < sline.view.width; x++ {
|
||||
if x < len(fileRunes) {
|
||||
screen.SetContent(x, y, fileRunes[x], nil, statusLineStyle)
|
||||
screen.SetContent(viewX+x, y, fileRunes[x], nil, statusLineStyle)
|
||||
} else if x >= sline.view.width-len(rightText) && x < len(rightText)+sline.view.width-len(rightText) {
|
||||
screen.SetContent(x, y, []rune(rightText)[x-sline.view.width+len(rightText)], nil, statusLineStyle)
|
||||
screen.SetContent(viewX+x, y, []rune(rightText)[x-sline.view.width+len(rightText)], nil, statusLineStyle)
|
||||
} else {
|
||||
screen.SetContent(x, y, ' ', nil, statusLineStyle)
|
||||
screen.SetContent(viewX+x, y, ' ', nil, statusLineStyle)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,7 +502,7 @@ func (v *View) DisplayView() {
|
||||
// If the buffer is smaller than the view height
|
||||
if lineN+v.Topline >= v.Buf.NumLines {
|
||||
// We have to clear all this space
|
||||
for i := 0; i < v.width; i++ {
|
||||
for i := v.x; i < v.width; i++ {
|
||||
screen.SetContent(i, lineN+v.y, ' ', nil, defStyle)
|
||||
}
|
||||
|
||||
@@ -677,7 +677,7 @@ func (v *View) DisplayView() {
|
||||
|
||||
charNum = charNum.Move(1, v.Buf)
|
||||
|
||||
for i := 0; i < v.width-(x-v.leftCol); i++ {
|
||||
for i := 0; i < v.width-((x-v.x)-v.leftCol); i++ {
|
||||
lineStyle := defStyle
|
||||
if settings["cursorline"].(bool) && !v.Cursor.HasSelection() && v.Cursor.Y == lineN+v.Topline {
|
||||
if style, ok := colorscheme["cursor-line"]; ok {
|
||||
|
||||
Reference in New Issue
Block a user