Skip to content

Commit

Permalink
updating screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicDuck committed Dec 14, 2024
1 parent 791b8c2 commit 7fe95fa
Show file tree
Hide file tree
Showing 71 changed files with 278 additions and 265 deletions.
27 changes: 20 additions & 7 deletions lua/grug-far/render/resultsList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ function M.appendResultsChunk(buf, context, data)
local resultLocationByExtmarkId = state.resultLocationByExtmarkId
---@type ResultLocation?
local lastLocation = nil
---@type ResultLocation?
local prevLastLocation = nil

for i = 1, #data.highlights do
local highlight = data.highlights[i]
Expand All @@ -132,21 +134,32 @@ function M.appendResultsChunk(buf, context, data)
local markId = addLocationMark(buf, context, lastline + highlight.start_line, #line, options)
resultLocationByExtmarkId[markId] = { filename = state.resultsLastFilename }
elseif hl_type == ResultHighlightType.LineNumber then
-- omit ending ':'
state.resultMatchLineCount = state.resultMatchLineCount + 1
lastLocation = { filename = state.resultsLastFilename, count = state.resultMatchLineCount }
prevLastLocation = lastLocation
lastLocation = { filename = state.resultsLastFilename }
lastLocation.sign = highlight.sign
lastLocation.lnum = tonumber(string.sub(line, highlight.start_col + 1, highlight.end_col))
lastLocation.text = line

if
not (
prevLastLocation
and lastLocation.filename == prevLastLocation.filename
and lastLocation.lnum == prevLastLocation.lnum
)
then
state.resultMatchLineCount = state.resultMatchLineCount + 1
lastLocation.count = state.resultMatchLineCount
end

local markId = addLocationMark(
buf,
context,
lastline + highlight.start_line,
#line,
{ sign = highlight.sign, matchLineCount = state.resultMatchLineCount }
{ sign = highlight.sign, matchLineCount = lastLocation.count }
)
resultLocationByExtmarkId[markId] = lastLocation

lastLocation.sign = highlight.sign
lastLocation.lnum = tonumber(string.sub(line, highlight.start_col + 1, highlight.end_col))
lastLocation.text = line
if context.options.resultsHighlight and lastLocation.text then
addHighlightResult(
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
16|
17| file2.ts
18|▒ 3:7: grug.walks(talks) [1]
19|▒ 3:7: walks(talks) [2]
19|▒ 3:7: walks(talks)
20|
21|~
22|~
Expand All @@ -43,7 +43,7 @@
16|00222222222222222222222222222222222222222222222222222222222222222222222222222222
17|00777777772222222222222222222222222222222222222222222222222222222222222222222222
18|88525222222222288888888882222222222222222222222222222222222222222222222222223333
19|11525222222222211111222222222222222222222222222222222222222222222222222222223333
19|11525222222222211111222222222222222222222222222222222222222222222222222222222222
20|00222222222222222222222222222222222222222222222222222222222222222222222222222222
21|00000000000000000000000000000000000000000000000000000000000000000000000000000000
22|00000000000000000000000000000000000000000000000000000000000000000000000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
16|
17| file2.ts
18|▒ 3:7: grug.walks(talks) [1]
19|▒ 3:7: grug.walks_walks(talks) [2]
19|▒ 3:7: grug.walks_walks(talks)
20|
21|~
22|~
Expand All @@ -43,7 +43,7 @@
16|00222222222222222222222222222222222222222222222222222222222222222222222222222222
17|00777777772222222222222222222222222222222222222222222222222222222222222222222222
18|88525222222222288888888882222222222222222222222222222222222222222222222222223333
19|11525222222222211111111111111112222222222222222222222222222222222222222222223333
19|11525222222222211111111111111112222222222222222222222222222222222222222222222222
20|00222222222222222222222222222222222222222222222222222222222222222222222222222222
21|00000000000000000000000000000000000000000000000000000000000000000000000000000000
22|00000000000000000000000000000000000000000000000000000000000000000000000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
16|
17| file2.ts
18|▒ 3:7: grug.walks(talks) [1]
19|▒ 3:7: grug.walks_walks(talks) [2]
19|▒ 3:7: grug.walks_walks(talks)
20|
21|~
22|~
Expand All @@ -43,7 +43,7 @@
16|00222222222222222222222222222222222222222222222222222222222222222222222222222222
17|00777777772222222222222222222222222222222222222222222222222222222222222222222222
18|88525222222222288888888882222222222222222222222222222222222222222222222222223333
19|11525222222222211111111111111112222222222222222222222222222222222222222222223333
19|11525222222222211111111111111112222222222222222222222222222222222222222222222222
20|00222222222222222222222222222222222222222222222222222222222222222222222222222222
21|00000000000000000000000000000000000000000000000000000000000000000000000000000000
22|00000000000000000000000000000000000000000000000000000000000000000000000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
16|
17| file2.ts
18|▒ 3:7: grug.walks(talks) [1]
19|▒ 3:7: grug.walks_walks(talks) [2]
19|▒ 3:7: grug.walks_walks(talks)
20|
21|~
22|~
Expand All @@ -43,7 +43,7 @@
16|00222222222222222222222222222222222222222222222222222222222222222222222222222222
17|00777777772222222222222222222222222222222222222222222222222222222222222222222222
18|88525222222222288888888882222222222222222222222222222222222222222222222222223333
19|11525222222222211111111111111112222222222222222222222222222222222222222222223333
19|11525222222222211111111111111112222222222222222222222222222222222222222222222222
20|00222222222222222222222222222222222222222222222222222222222222222222222222222222
21|00000000000000000000000000000000000000000000000000000000000000000000000000000000
22|00000000000000000000000000000000000000000000000000000000000000000000000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
16|
17| file2.ts
18|▒ 3:7: grug.walks(talks) [1]
19|▒ 3:7: grug.walks_walks(talks) [2]
19|▒ 3:7: grug.walks_walks(talks)
20|
21|~
22|~
Expand All @@ -43,7 +43,7 @@
16|00222222222222222222222222222222222222222222222222222222222222222222222222222222
17|00777777772222222222222222222222222222222222222222222222222222222222222222222222
18|88525222222222288888888882222222222222222222222222222222222222222222222222223333
19|11525222222222211111111111111112222222222222222222222222222222222222222222223333
19|11525222222222211111111111111112222222222222222222222222222222222222222222222222
20|00222222222222222222222222222222222222222222222222222222222222222222222222222222
21|00000000000000000000000000000000000000000000000000000000000000000000000000000000
22|00000000000000000000000000000000000000000000000000000000000000000000000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
16|
17| file2.ts
18|▒ 2:9: if (grug || talks) { [1]
19|▒ 2:9: if ( || talks) { [2]
19|▒ 2:9: if ( || talks) {
20|┊
21|▒ 3:7: grug.walks(talks) [3]
22|▒ 3:7: .walks(talks) [4]
21|▒ 3:7: grug.walks(talks) [2]
22|▒ 3:7: .walks(talks)
23|Grug FAR - 1: grug 2,4 Top
24|grug-far: replace completed!

Expand All @@ -43,9 +43,9 @@
16|00222222222222222222222222222222222222222222222222222222222222222222222222222222
17|00555555552222222222222222222222222222222222222222222222222222222222222222222222
18|66727222222222222666622222222222222222222222222222222222222222222222222222223333
19|11727222222222222222222222222222222222222222222222222222222222222222222222223333
19|11727222222222222222222222222222222222222222222222222222222222222222222222222222
20|88222222222222222222222222222222222222222222222222222222222222222222222222222222
21|66727222222222266662222222222222222222222222222222222222222222222222222222223333
22|11727222222222222222222222222222222222222222222222222222222222222222222222223333
22|11727222222222222222222222222222222222222222222222222222222222222222222222222222
23|99999999999999999999999999999999999999999999999999999999999999999999999999999999
24|::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
16|
17| file2.ts
18|▒ 2:13: if ( || talks) { [1]
19|▒ 2:13: if ( || ) { [2]
19|▒ 2:13: if ( || ) {
20|┊
21|▒ 3:14: .walks(talks) [3]
22|▒ 3:14: .walks() [4]
21|▒ 3:14: .walks(talks) [2]
22|▒ 3:14: .walks()
23|Grug FAR - 1: talks 2,6 Top
24|-- INSERT --

Expand All @@ -43,9 +43,9 @@
16|00222222222222222222222222222222222222222222222222222222222222222222222222222222
17|00555555552222222222222222222222222222222222222222222222222222222222222222222222
18|66727722222222222222266666222222222222222222222222222222222222222222222222223333
19|11727722222222222222222222222222222222222222222222222222222222222222222222223333
19|11727722222222222222222222222222222222222222222222222222222222222222222222222222
20|88222222222222222222222222222222222222222222222222222222222222222222222222222222
21|66727722222222222222226666622222222222222222222222222222222222222222222222223333
22|11727722222222222222222222222222222222222222222222222222222222222222222222223333
22|11727722222222222222222222222222222222222222222222222222222222222222222222222222
23|99999999999999999999999999999999999999999999999999999999999999999999999999999999
24|111111111111::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
16|
17| file2.ts
18|▒ 2:9: if (grug || talks) { [1]
19|▒ 2:9: if (curly || talks) { [2]
19|▒ 2:9: if (curly || talks) {
20|┊
21|▒ 3:7: grug.walks(talks) [3]
22|▒ 3:7: curly.walks(talks) [4]
21|▒ 3:7: grug.walks(talks) [2]
22|▒ 3:7: curly.walks(talks)
23|Grug FAR - 1: grug 2,4 Top
24|grug-far: replace completed!

Expand All @@ -43,9 +43,9 @@
16|00222222222222222222222222222222222222222222222222222222222222222222222222222222
17|00555555552222222222222222222222222222222222222222222222222222222222222222222222
18|66727222222222222666622222222222222222222222222222222222222222222222222222223333
19|11727222222222222111112222222222222222222222222222222222222222222222222222223333
19|11727222222222222111112222222222222222222222222222222222222222222222222222222222
20|88222222222222222222222222222222222222222222222222222222222222222222222222222222
21|66727222222222266662222222222222222222222222222222222222222222222222222222223333
22|11727222222222211111222222222222222222222222222222222222222222222222222222223333
22|11727222222222211111222222222222222222222222222222222222222222222222222222222222
23|99999999999999999999999999999999999999999999999999999999999999999999999999999999
24|::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
16|
17| file2.ts
18|▒ 2:9: if (curly || talks) { [1]
19|▒ 2:9: if (curly || talks) { [2]
19|▒ 2:9: if (curly || talks) {
20|┊
21|▒ 3:7: curly.walks(talks) [3]
22|▒ 3:7: curly.walks(talks) [4]
21|▒ 3:7: curly.walks(talks) [2]
22|▒ 3:7: curly.walks(talks)
23|Grug FAR - 1: curly 2,6 Top
24|-- INSERT --

Expand All @@ -43,9 +43,9 @@
16|00222222222222222222222222222222222222222222222222222222222222222222222222222222
17|00555555552222222222222222222222222222222222222222222222222222222222222222222222
18|66727222222222222666662222222222222222222222222222222222222222222222222222223333
19|11727222222222222111112222222222222222222222222222222222222222222222222222223333
19|11727222222222222111112222222222222222222222222222222222222222222222222222222222
20|88222222222222222222222222222222222222222222222222222222222222222222222222222222
21|66727222222222266666222222222222222222222222222222222222222222222222222222223333
22|11727222222222211111222222222222222222222222222222222222222222222222222222223333
22|11727222222222211111222222222222222222222222222222222222222222222222222222222222
23|99999999999999999999999999999999999999999999999999999999999999999999999999999999
24|111111111111::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
16|
17| file2.ts
18|▒ 2:9: if (grug || talks) { [1]
19|▒ 2:9: if (curly || talks) { [2]
19|▒ 2:9: if (curly || talks) {
20|┊
21|▒ 3:7: grug.walks(talks) [3]
22|▒ 3:7: curly.walks(talks) [4]
21|▒ 3:7: grug.walks(talks) [2]
22|▒ 3:7: curly.walks(talks)
23|Grug FAR - 1: grug 2,4 Top
24|grug-far: replace completed!

Expand All @@ -43,9 +43,9 @@
16|00222222222222222222222222222222222222222222222222222222222222222222222222222222
17|00555555552222222222222222222222222222222222222222222222222222222222222222222222
18|66727222222222222666622222222222222222222222222222222222222222222222222222223333
19|11727222222222222111112222222222222222222222222222222222222222222222222222223333
19|11727222222222222111112222222222222222222222222222222222222222222222222222222222
20|88222222222222222222222222222222222222222222222222222222222222222222222222222222
21|66727222222222266662222222222222222222222222222222222222222222222222222222223333
22|11727222222222211111222222222222222222222222222222222222222222222222222222223333
22|11727222222222211111222222222222222222222222222222222222222222222222222222222222
23|99999999999999999999999999999999999999999999999999999999999999999999999999999999
24|::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Loading

0 comments on commit 7fe95fa

Please sign in to comment.