mirror of
				https://github.com/cheat/cheat.git
				synced 2025-11-04 07:45:28 +01:00 
			
		
		
		
	chore: deprecates line numbers in search
Removes line numbers from search result output as part of the refactoring effort.
This commit is contained in:
		@@ -15,7 +15,7 @@ func (s *Sheet) Search(reg *regexp.Regexp) []Match {
 | 
			
		||||
	// search through the cheatsheet's text line by line
 | 
			
		||||
	// TODO: searching line-by-line is surely the "naive" approach. Revisit this
 | 
			
		||||
	// later with an eye for performance improvements.
 | 
			
		||||
	for linenum, line := range strings.Split(s.Text, "\n") {
 | 
			
		||||
	for _, line := range strings.Split(s.Text, "\n") {
 | 
			
		||||
 | 
			
		||||
		// exit early if the line doesn't match the regex
 | 
			
		||||
		if !reg.MatchString(line) {
 | 
			
		||||
@@ -24,7 +24,6 @@ func (s *Sheet) Search(reg *regexp.Regexp) []Match {
 | 
			
		||||
 | 
			
		||||
		// init the match
 | 
			
		||||
		m := Match{
 | 
			
		||||
			Line: linenum + 1,
 | 
			
		||||
			Text: strings.TrimSpace(line),
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user