diff --git a/oviewer/draw.go b/oviewer/draw.go index ab9ea875..5af69736 100644 --- a/oviewer/draw.go +++ b/oviewer/draw.go @@ -52,7 +52,7 @@ func (root *Root) draw() { root.headerStyle(lc) // column highlight - if root.Doc.ColumnMode && root.input.mode == Normal { + if root.input.mode == Normal && root.Doc.ColumnMode { str, byteMap := contentsToStr(lc) start, end := rangePosition(str, root.Doc.ColumnDelimiter, root.Doc.columnNum) reverseContents(lc, byteMap[start], byteMap[end]) @@ -78,6 +78,7 @@ func (root *Root) draw() { lX, lY = root.noWrapContents(hy, root.Doc.x, lY, lc) } } + // Body lX = root.Doc.branch * root.vWidth for y := root.headerLen(); y < root.vHight; y++ { @@ -103,7 +104,6 @@ func (root *Root) draw() { // search highlight if root.input.reg != nil { - lineStr, byteMap := contentsToStr(lc) poss := searchPosition(lineStr, root.input.reg) for _, r := range poss { reverseContents(lc, byteMap[r[0]], byteMap[r[1]]) diff --git a/oviewer/event.go b/oviewer/event.go index 5a51019d..51bd331e 100644 --- a/oviewer/event.go +++ b/oviewer/event.go @@ -97,15 +97,8 @@ func (root *Root) Cancel() { // WriteQuit sets the write flag and executes a quit event. func (root *Root) WriteQuit() { - if !root.checkScreen() { - return - } root.AfterWrite = true - ev := &eventAppQuit{} - ev.SetEventNow() - go func() { - root.Screen.PostEventWait(ev) - }() + root.Quit() } // eventTimer represents a timer event.