Skip to content

Commit a66edb2

Browse files
authored
Merge pull request #786 from Shopify/vs/use_empty_not_blank
Use empty? instead of blank? on strings
2 parents faaa84d + 267a427 commit a66edb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ruby_lsp/requests/on_type_formatting.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ def handle_statement_end
8888
current_line = @lines[@position[:line]]
8989
next_line = @lines[@position[:line] + 1]
9090

91-
if current_line.nil? || current_line.blank?
91+
if current_line.nil? || current_line.strip.empty?
9292
add_edit_with_text(" \n#{indents}end")
9393
move_cursor_to(@position[:line], @indentation + 2)
94-
elsif next_line.nil? || next_line.blank?
94+
elsif next_line.nil? || next_line.strip.empty?
9595
add_edit_with_text("#{indents}end", { line: @position[:line] + 1, character: @position[:character] })
9696
move_cursor_to(@position[:line], @indentation + 3)
9797
end

0 commit comments

Comments
 (0)