summaryrefslogtreecommitdiff
path: root/lib/syntax_suggest/code_line.rb
diff options
context:
space:
mode:
authorschneems <[email protected]>2023-03-09 14:13:46 -0600
committerHiroshi SHIBATA <[email protected]>2023-04-06 15:45:29 +0900
commit63ea6b0cf2b7fd27e22dc7b468fe65ee2c79b23a (patch)
treecd71a5059b23d68e5fcb808499390d21897210af /lib/syntax_suggest/code_line.rb
parent2acbcec056f54df9b4d98d4d15b1e9f612ac1432 (diff)
[ruby/syntax_suggest] Rollback comment indentation behavior
Originally I fixed https://github.com/ruby/syntax_suggest/pull/177 by making the process of comment removal indentation aware. The next commit is the more general fix and means we don't need to carry that additional logic/overhead. Also: Update syntax via linter
Diffstat (limited to 'lib/syntax_suggest/code_line.rb')
-rw-r--r--lib/syntax_suggest/code_line.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/syntax_suggest/code_line.rb b/lib/syntax_suggest/code_line.rb
index d771a2c0dd..a20f34afa4 100644
--- a/lib/syntax_suggest/code_line.rb
+++ b/lib/syntax_suggest/code_line.rb
@@ -48,10 +48,10 @@ module SyntaxSuggest
strip_line = line.dup
strip_line.lstrip!
- if (@empty = strip_line.empty?)
- @indent = line.length - 1 # Newline removed from strip_line is not "whitespace"
+ @indent = if (@empty = strip_line.empty?)
+ line.length - 1 # Newline removed from strip_line is not "whitespace"
else
- @indent = line.length - strip_line.length
+ line.length - strip_line.length
end
set_kw_end