Permalink
Browse files

Line numbers in diffs link back to the document

Only the right side line numbers will link, as this is generally representing the local version of the file, meaning the line numbers match.
  • Loading branch information...
sorbits committed Jan 13, 2013
1 parent 8acd98f commit 426b154feb738753ff24ce55457edba1aa830895
Showing with 3 additions and 1 deletion.
  1. +3 −1 Support/app/views/diff/_diff_result.html.erb
@@ -42,10 +42,12 @@
else
["", "unchanged"]
end
+ ln_right = line[:ln_right]
+ ln_right = link_to_relative_file(git, diff_result[:right][:file_path], ln_right, ln_right) unless [ :deletion, :eof, :cut ].include?(line[:type])
%>
<tr>
<td class="line-numbers <%= line_num_class %>"><%= line[:ln_left] %></td>
- <td class="line-numbers <%= line_num_class %>"><%= line[:ln_right] %></td>
+ <td class="line-numbers <%= line_num_class %>"><%= ln_right %></td>
<td class="code <%= row_class %>"><%= htmlize(line[:text]) %></td></tr>
<% end %>
</tbody>

0 comments on commit 426b154

Please sign in to comment.