mirror of
https://github.com/walles/moar.git
synced 2024-09-11 12:15:43 +03:00
Improve docs
This commit is contained in:
parent
60d3577b59
commit
686882ffcd
14
m/search.go
14
m/search.go
@ -40,12 +40,15 @@ func (p *Pager) scrollToSearchHits() {
|
||||
}
|
||||
|
||||
// NOTE: When we search, we do that by looping over the *input lines*, not the
|
||||
// screen lines. That's why we're using a line number rather than a
|
||||
// scrollPosition for searching.
|
||||
// screen lines. That's why startPosition is a LineNumber rather than a
|
||||
// scrollPosition.
|
||||
//
|
||||
// The `beforePosition` parameter is exclusive, meaning that line will not be
|
||||
// searched.
|
||||
//
|
||||
// For the actual searching, this method will call _findFirstHit() in parallel
|
||||
// on multiple cores, to help large file search performance.
|
||||
//
|
||||
// FIXME: We should take startPosition.deltaScreenLines into account as well!
|
||||
func (p *Pager) findFirstHit(startPosition linenumbers.LineNumber, beforePosition *linenumbers.LineNumber, backwards bool) *scrollPosition {
|
||||
// If the number of lines to search matches the number of cores (or more),
|
||||
@ -116,12 +119,15 @@ func (p *Pager) findFirstHit(startPosition linenumbers.LineNumber, beforePositio
|
||||
}
|
||||
|
||||
// NOTE: When we search, we do that by looping over the *input lines*, not the
|
||||
// screen lines. That's why we're using a line number rather than a
|
||||
// scrollPosition for searching.
|
||||
// screen lines. That's why startPosition is a LineNumber rather than a
|
||||
// scrollPosition.
|
||||
//
|
||||
// The `beforePosition` parameter is exclusive, meaning that line will not be
|
||||
// searched.
|
||||
//
|
||||
// This method will run over multiple chunks of the input file in parallel to
|
||||
// help large file search performance.
|
||||
//
|
||||
// FIXME: We should take startPosition.deltaScreenLines into account as well!
|
||||
func (p *Pager) _findFirstHit(startPosition linenumbers.LineNumber, beforePosition *linenumbers.LineNumber, backwards bool) *scrollPosition {
|
||||
searchPosition := startPosition
|
||||
|
Loading…
Reference in New Issue
Block a user