whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: don't break lines with no spaces
Date Sun, 12 Nov 2017 14:50:44 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 2cbb8b4  don't break lines with no spaces
2cbb8b4 is described below

commit 2cbb8b485e42dd3e14554936f44bb2d2577d2865
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Nov 12 09:50:04 2017 -0500

    don't break lines with no spaces
---
 www/board/agenda/views/utils.js.rb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/www/board/agenda/views/utils.js.rb b/www/board/agenda/views/utils.js.rb
index 69e340f..b1ade3b 100644
--- a/www/board/agenda/views/utils.js.rb
+++ b/www/board/agenda/views/utils.js.rb
@@ -165,15 +165,15 @@ class Flow
       if prefix.length == 0
         # not indented -> split
         lines[i] = line.
-          gsub(/(.{1,#{len}})( +|$\n?)|(.{1,#{len}})/, "$1$3\n").
+          gsub(/(.{1,#{len}})( +|$\n?)/, "$1\n").
           sub(/[\n\r]+$/, '')
       else
         # preserve indentation.
         n = len - prefix.length;
         indent = prefix.gsub(/\W/, ' ')
-        lines[i] = line[prefix.length..-1].
-          gsub(/(.{1,#{n}})( +|$\n?)|(.{1,#{n}})/, indent + "$1$3\n").
-          sub(indent, prefix). sub(/[\n\r]+$/, '')
+        lines[i] = prefix + line[prefix.length..-1].
+          gsub(/^(.{1,#{n}})( +|$\n?)/, indent + "$1\n").
+          sub(indent, '').sub(/[\n\r]+$/, '')
       end
     end
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message