Skip to content

Commit 6d58a6e

Browse files
committed
Fix indent calculation
1 parent 33fbe05 commit 6d58a6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/thor/shell/basic.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ def print_wrapped(message, options = {})
234234
unwrapped.split(" ").inject do |memo, word|
235235
word = word.gsub(/\n\005/, "\n").gsub(/\005/, "\n")
236236
counter = 0 if word.include? "\n"
237-
if (counter + word.length + indent) < (width + word.length)
237+
if (counter + word.length + 1) < width
238238
memo = "#{memo} #{word}"
239-
counter += word.length+indent
239+
counter += (word.length + 1)
240240
else
241241
memo = "#{memo}\n#{word}"
242242
counter = word.length

0 commit comments

Comments
 (0)