From 7af0ad0781a92bb5c6b126cc169f661be323eacb Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 21 Nov 2012 17:05:28 +0100 Subject: [PATCH] SONAR-3896 The last empty line of source file is not displayed in the source code viewer --- sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb index 8aaf05ea3c9..a38b6ba367b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb @@ -60,10 +60,9 @@ class Api::Utils # For history reference: # - http://jira.codehaus.org/browse/SONAR-2282 first modified the behaviour to keep the trailing lines # - then http://jira.codehaus.org/browse/SONAR-3003 reverted this modification to remove potential last empty line + # - then http://jira.codehaus.org/browse/SONAR-3896 reactivate this modification to display last empty line def self.split_newlines(input) - result = input.split(/\r?\n|\r/, -1) - result.pop if result.last=='' - result + input.split(/\r?\n|\r/, -1) end def self.convert_string_to_unix_newlines(input) -- 2.39.5