instance method
SyntaxSuggest::DisplayCodeWithLineNumbers#format
format(contents:, number:, empty:, highlight: false)
lib/syntax_suggest/display_code_with_line_numbers.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/syntax_suggest/display_code_with_line_numbers.rb, line 50
def format(contents:, number:, empty:, highlight: false)
string = +""
string << if highlight
"> "
else
" "
end
string << number.rjust(@digit_count).to_s
if empty
string << contents
else
string << " "
string << TERMINAL_HIGHLIGHT if @terminal && highlight
string << contents
string << TERMINAL_END if @terminal
end
string
end
No documentation available