File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
lua/neogit/buffers/commit_view Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -208,9 +208,16 @@ function M:open(kind)
208208
209209 -- Search for a match and jump if we find it
210210 for path , line_nr in pairs (diff_headers ) do
211+ local path_norm = path
212+ path_norm = path_norm :gsub (" ^modified " , " " )
213+ path_norm = path_norm :gsub (" ^renamed " , " " )
214+ path_norm = path_norm :gsub (" ^new file " , " " )
215+ path_norm = path_norm :gsub (" ^deleted file " , " " )
211216 -- The gsub is to work around the fact that the OverviewFiles use
212217 -- => in renames but the diff header uses ->
213- if path :gsub (" %-> " , " => " ):match (selected_path ) then
218+ path_norm = path_norm :gsub (" %-> " , " => " )
219+
220+ if path_norm == selected_path then
214221 -- Save position in jumplist
215222 vim .cmd (" normal! m'" )
216223
You can’t perform that action at this time.
0 commit comments