git://git.nikiroo.be
/
fanfix-jexer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3cde28f
)
justify tool: accepts \r\n text
author
Niki Roo
<niki@nikiroo.be>
Tue, 10 Apr 2018 08:08:34 +0000
(10:08 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Tue, 10 Apr 2018 08:08:34 +0000
(10:08 +0200)
src/be/nikiroo/utils/main/justify.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/utils/main/justify.java
b/src/be/nikiroo/utils/main/justify.java
index cf589059a5ebf398cea085fcfc06913067e32d73..32cfb103a8d1deea21df9d2e15aaa646a966f3b5 100644
(file)
--- a/
src/be/nikiroo/utils/main/justify.java
+++ b/
src/be/nikiroo/utils/main/justify.java
@@
-38,7
+38,7
@@
public class justify {
// TODO: move to utils?
List<String> lines = new ArrayList<String>();
Scanner scan = new Scanner(System.in);
- scan.useDelimiter("[\r\n]");
+ scan.useDelimiter("
\r\n|
[\r\n]");
try {
StringBuilder previous = null;
StringBuilder tmp = new StringBuilder();
@@
-90,6
+90,7
@@
public class justify {
return line.length() == 0 //
|| line.charAt(line.length() - 1) == '.'
|| line.charAt(line.length() - 1) == '"'
- || line.charAt(line.length() - 1) == '»';
+ || line.charAt(line.length() - 1) == '»'
+ ;
}
}