lib/review/textutils.rb in review-5.2.0 vs lib/review/textutils.rb in review-5.3.0
- old
+ new
@@ -13,11 +13,11 @@
module TextUtils
def detab(str, ts = 8)
add = 0
len = nil
str.gsub("\t") do
- len = ts - ($`.size + add) % ts
+ len = ts - (($`.size + add) % ts)
add += len - 1
' ' * len
end
end
@@ -70,15 +70,16 @@
(tail =~ /\p{P}/ || head =~ /\p{S}/ || Unicode::Eaw.property(tail) == :A))
space = nil
end
# lazy than rule 3, but it looks better
- if lazy &&
- (%i[F W H].include?(Unicode::Eaw.property(tail)) &&
- tail !~ /\p{Hangul}/) ||
- (%i[F W H].include?(Unicode::Eaw.property(head)) &&
- head !~ /\p{Hangul}/)
- space = nil
+ if lazy
+ if (%i[F W H].include?(Unicode::Eaw.property(tail)) &&
+ tail !~ /\p{Hangul}/) ||
+ (%i[F W H].include?(Unicode::Eaw.property(head)) &&
+ head !~ /\p{Hangul}/)
+ space = nil
+ end
end
end
space
end