Skip to content

Commit e415836

Browse files
authored
Merge pull request #469 from noborus/improve-up
Improved display when moving the first row up
2 parents 008a8d5 + d83a736 commit e415836

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

oviewer/draw.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (root *Root) drawSectionHeader(lN int) int {
121121

122122
pn := lN
123123
// prevSection searches for the section above the specified line.
124-
if pn == 0 {
124+
if m.startTopFlag && pn <= 0 {
125125
pn = 1
126126
}
127127
sectionLN, err := m.prevSection(pn)

oviewer/move.go

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ func (root *Root) moveTop() {
1010
root.resetSelect()
1111
defer root.releaseEventBuffer()
1212

13+
root.Doc.startTopFlag = true
1314
root.Doc.moveTop()
1415
}
1516

oviewer/move_vertical.go

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ func (m *Document) moveLine(lN int) int {
2525

2626
// moveTop moves to the top.
2727
func (m *Document) moveTop() {
28-
m.startTopFlag = true
2928
m.moveLine(m.BufStartNum())
3029
}
3130

0 commit comments

Comments
 (0)