Option to display line endings

Displays Windows EOL/Cr-Lf on patch diff screen. This is
optional and is controlled by a checkbox. A new column
show_line_endings is added in account_diff_preferences.

Display is similar to gitweb i.e. '\r' in dotted-line box

Bug: issue 626

Change-Id: I6128575bd2f0869a3c59e3d2fd409d5ee431ecc5
This commit is contained in:
Pravin Sethia
2012-07-04 16:17:05 +05:30
committed by Sasa Zivkov
parent e6ec46892f
commit 632653c2d0
9 changed files with 120 additions and 25 deletions

View File

@@ -62,6 +62,7 @@ public class AccountDiffPreference {
p.setLineLength(100);
p.setSyntaxHighlighting(true);
p.setShowWhitespaceErrors(true);
p.setShowLineEndings(true);
p.setIntralineDifference(true);
p.setShowTabs(true);
p.setContext(DEFAULT_CONTEXT);
@@ -88,28 +89,31 @@ public class AccountDiffPreference {
protected boolean showWhitespaceErrors;
@Column(id = 7)
protected boolean intralineDifference;
protected boolean showLineEndings;
@Column(id = 8)
protected boolean intralineDifference;
@Column(id = 9)
protected boolean showTabs;
/** Number of lines of context when viewing a patch. */
@Column(id = 9)
@Column(id = 10)
protected short context;
@Column(id = 10)
@Column(id = 11)
protected boolean skipDeleted;
@Column(id = 11)
@Column(id = 12)
protected boolean skipUncommented;
@Column(id = 12)
@Column(id = 13)
protected boolean expandAllComments;
@Column(id = 13)
@Column(id = 14)
protected boolean retainHeader;
@Column(id = 14)
@Column(id = 15)
protected boolean manualReview;
protected AccountDiffPreference() {
@@ -126,6 +130,7 @@ public class AccountDiffPreference {
this.lineLength = p.lineLength;
this.syntaxHighlighting = p.syntaxHighlighting;
this.showWhitespaceErrors = p.showWhitespaceErrors;
this.showLineEndings = p.showLineEndings;
this.intralineDifference = p.intralineDifference;
this.showTabs = p.showTabs;
this.skipDeleted = p.skipDeleted;
@@ -180,6 +185,14 @@ public class AccountDiffPreference {
this.showWhitespaceErrors = showWhitespaceErrors;
}
public boolean isShowLineEndings() {
return showLineEndings;
}
public void setShowLineEndings(boolean showLineEndings) {
this.showLineEndings = showLineEndings;
}
public boolean isIntralineDifference() {
return intralineDifference;
}