Skip to content

Commit

Permalink
Small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
noborus committed Oct 19, 2020
1 parent d68c24c commit 290b282
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions oviewer/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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++ {
Expand All @@ -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]])
Expand Down
9 changes: 1 addition & 8 deletions oviewer/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 290b282

Please sign in to comment.