Commit 86a8409e authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'file-content-highlight-line' into 'master'

Highlight empty lines

## What does this MR do?

Rather than just highlight the text, file line highlighting now highlights the full line including empty lines

## What are the relevant issue numbers?

Closes #19484 

## Screenshots (if relevant)

![Screen_Shot_2016-07-05_at_13.52.31](/uploads/d3bddc918d731681465381e96c0aa2b0/Screen_Shot_2016-07-05_at_13.52.31.png)

See merge request !5092
parents f7e08ad0 cf33acb3
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
table-layout: fixed; table-layout: fixed;
pre { pre {
padding: 10px; padding: 10px 0;
border: none; border: none;
border-radius: 0; border-radius: 0;
font-family: $monospace_font; font-family: $monospace_font;
font-size: $code_font_size !important; font-size: $code_font_size;
line-height: $code_line_height !important; line-height: $code_line_height !important;
margin: 0; margin: 0;
overflow: auto; overflow: auto;
...@@ -20,13 +20,20 @@ ...@@ -20,13 +20,20 @@
border-left: 1px solid; border-left: 1px solid;
code { code {
display: inline-block;
min-width: 100%;
font-family: $monospace_font; font-family: $monospace_font;
white-space: pre; white-space: normal;
word-wrap: normal; word-wrap: normal;
padding: 0; padding: 0;
.line { .line {
display: inline-block; display: block;
width: 100%;
min-height: 19px;
padding-left: 10px;
padding-right: 10px;
white-space: pre;
} }
} }
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
.encoding-selector .encoding-selector
= select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'select2' = select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'select2'
.file-content.code .file-editor.code
%pre.js-edit-mode-pane#editor #{params[:content] || local_assigns[:blob_data]} %pre.js-edit-mode-pane#editor #{params[:content] || local_assigns[:blob_data]}
- if local_assigns[:path] - if local_assigns[:path]
.js-edit-mode-pane#preview.hide .js-edit-mode-pane#preview.hide
......
...@@ -23,7 +23,7 @@ feature 'project owner creates a license file', feature: true, js: true do ...@@ -23,7 +23,7 @@ feature 'project owner creates a license file', feature: true, js: true do
select_template('MIT License') select_template('MIT License')
file_content = find('.file-content') file_content = first('.file-editor')
expect(file_content).to have_content('The MIT License (MIT)') expect(file_content).to have_content('The MIT License (MIT)')
expect(file_content).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") expect(file_content).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}")
...@@ -47,7 +47,7 @@ feature 'project owner creates a license file', feature: true, js: true do ...@@ -47,7 +47,7 @@ feature 'project owner creates a license file', feature: true, js: true do
select_template('MIT License') select_template('MIT License')
file_content = find('.file-content') file_content = first('.file-editor')
expect(file_content).to have_content('The MIT License (MIT)') expect(file_content).to have_content('The MIT License (MIT)')
expect(file_content).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") expect(file_content).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}")
......
...@@ -23,7 +23,7 @@ feature 'project owner sees a link to create a license file in empty project', f ...@@ -23,7 +23,7 @@ feature 'project owner sees a link to create a license file in empty project', f
select_template('MIT License') select_template('MIT License')
file_content = find('.file-content') file_content = first('.file-editor')
expect(file_content).to have_content('The MIT License (MIT)') expect(file_content).to have_content('The MIT License (MIT)')
expect(file_content).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}") expect(file_content).to have_content("Copyright (c) #{Time.now.year} #{project.namespace.human_name}")
......
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