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 0c1a239  reflow selection fixes
0c1a239 is described below

commit 0c1a239e43d39ab7de6b3acc52fb5e27eb5ba8eb
Author: Sam Ruby <[email protected]>
AuthorDate: Wed Apr 25 14:33:48 2018 -0400

    reflow selection fixes
---
 www/board/agenda/views/buttons/post.js.rb | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/www/board/agenda/views/buttons/post.js.rb 
b/www/board/agenda/views/buttons/post.js.rb
index e756982..4fe4dae 100644
--- a/www/board/agenda/views/buttons/post.js.rb
+++ b/www/board/agenda/views/buttons/post.js.rb
@@ -447,20 +447,7 @@ class Post < Vue
       start = textarea.selectionStart
       start -= 1  while start > 0 and report[start-1] != "\n"
       finish = textarea.selectionEnd
-      finish += 1 while report[finish] != '\n' and finish < report.length-1
-    end
-
-    # remove indentation
-    unless report =~ /^\S/
-      regex = RegExp.new('^( +)', 'gm')
-      indents = []
-      while (result = regex.exec(report))
-        indents.push result[1].length
-      end
-      unless indents.empty?
-        indent = Math.min(*indents)
-        report.gsub!(RegExp.new('^' + ' ' * indent, 'gm'), '')
-      end
+      finish += 1 while report[finish] != "\n" and finish < report.length-1
     end
 
     # enable special punctuation rules for the incubator
@@ -472,6 +459,19 @@ class Post < Vue
       report.gsub(/^/, ' ' * indent) if indent > 0
       @report = @report[0...start] + report + @report[finish+1..-1]
     else
+      # remove indentation
+      unless report =~ /^\S/
+       regex = RegExp.new('^( +)', 'gm')
+       indents = []
+       while (result = regex.exec(report))
+         indents.push result[1].length
+       end
+       unless indents.empty?
+         indent = Math.min(*indents)
+         report.gsub!(RegExp.new('^' + ' ' * indent, 'gm'), '')
+       end
+      end
+
       @report = Flow.text(report, @indent, puncrules)
     end
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to