Commit 7030ffb0 authored by Annabel Dunstone's avatar Annabel Dunstone

Copying and pasting doesn't grab line numbers or +/-

parent 64776ab2
...@@ -67,6 +67,14 @@ ...@@ -67,6 +67,14 @@
line-height: $code_line_height; line-height: $code_line_height;
font-size: $code_font_size; font-size: $code_font_size;
&.noteable_line.old:before {
content: '-';
}
&.noteable_line.new:before {
content: '+';
}
span { span {
white-space: pre; white-space: pre;
} }
...@@ -391,3 +399,15 @@ ...@@ -391,3 +399,15 @@
margin-bottom: 0; margin-bottom: 0;
} }
} }
.diff-line-num:not(.js-unfold-bottom) {
a {
&:before {
content: attr(data-linenumber);
}
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
}
...@@ -44,6 +44,7 @@ module DiffHelper ...@@ -44,6 +44,7 @@ module DiffHelper
if line.blank? if line.blank?
"  ".html_safe "  ".html_safe
else else
line[0] = ''
line line
end end
end end
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
- line_old = line_new - @form.offset - line_old = line_new - @form.offset
%tr.line_holder %tr.line_holder
%td.old_line.diff-line-num{data: {linenumber: line_old}} %td.old_line.diff-line-num{data: {linenumber: line_old}}
= link_to raw(line_old), "#" / = link_to raw(line_old), "#"
%td.new_line.diff-line-num %td.new_line.diff-line-num{data: {linenumber: line_old}}
= link_to raw(line_new) , "#" / = link_to raw(line_new) , "#"
%td.line_content.noteable_line==#{' ' * @form.indent}#{line} %td.line_content.noteable_line==#{' ' * @form.indent}#{line}
- if @form.unfold? && @form.bottom? && @form.to < @blob.loc - if @form.unfold? && @form.bottom? && @form.to < @blob.loc
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
%td.new_line.diff-line-num %td.new_line.diff-line-num
%td.line_content.match= line.text %td.line_content.match= line.text
- else - else
%td.old_line.diff-line-num{class: type} %td.old_line.diff-line-num{class: type, data: {linenumber: line.new_pos}}
- link_text = raw(type == "new" ? "&nbsp;" : line.old_pos) - link_text = raw(type == "new" ? "&nbsp;" : line.old_pos)
- if defined?(plain) && plain - if defined?(plain) && plain
= link_text = link_text
- else - else
= link_to link_text, "##{line_code}", id: line_code = link_to "", "##{line_code}", id: line_code, data: { linenumber: link_text }
- if @comments_allowed && can?(current_user, :create_note, @project) - if @comments_allowed && can?(current_user, :create_note, @project)
= link_to_new_diff_note(line_code) = link_to_new_diff_note(line_code)
%td.new_line.diff-line-num{class: type, data: {linenumber: line.new_pos}} %td.new_line.diff-line-num{class: type, data: {linenumber: line.new_pos}}
...@@ -22,5 +22,5 @@ ...@@ -22,5 +22,5 @@
- if defined?(plain) && plain - if defined?(plain) && plain
= link_text = link_text
- else - else
= link_to link_text, "##{line_code}", id: line_code = link_to "", "##{line_code}", id: line_code, data: { linenumber: link_text }
%td.line_content{class: "noteable_line #{type} #{line_code}", data: { line_code: line_code }}= diff_line_content(line.text) %td.line_content{class: "noteable_line #{type} #{line_code}", data: { line_code: line_code }}= diff_line_content(line.text)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment