Skip to content

Commit

Permalink
Merge pull request #540 from noborus/add-comment-previousSection
Browse files Browse the repository at this point in the history
Add a comment about timeout
  • Loading branch information
noborus authored Apr 26, 2024
2 parents 64bd638 + ca8b105 commit 3cefe59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions oviewer/input_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
filter
)

// setSearchMode sets the inputMode to Search.
func (root *Root) setCommonSearchMode() {
input := root.input
input.reset()
Expand Down
3 changes: 3 additions & 0 deletions oviewer/move_vertical.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ func (m *Document) movePrevSection() error {

// prevSection returns the line number of the previous section.
func (m *Document) prevSection(n int) (int, error) {
// TODO: Timeout should be specified in the caller instead of here.
// If it takes a long time to find the section header,
// it will freeze during that time, so a timeout is set.
ctx := context.Background()
ctx, cancel := context.WithTimeout(ctx, sectionTimeOut*time.Millisecond)
defer cancel()
Expand Down

0 comments on commit 3cefe59

Please sign in to comment.