error_highlight icon indicating copy to clipboard operation
error_highlight copied to clipboard

Handle very long line well

Open mame opened this issue 4 years ago • 1 comments

$ ruby t.rb
t.rb:1:in `<main>': undefined method `gsuub' for "fooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooo
ooooooooooooooooooooooooooooooooooooooooooooooooooo":S
tring (NoMethodError)

"foooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooo
oo".gsuub(//, "")


   ^^^^^^
Did you mean?  gsub

Should we truncate such a long code snippet to fit it with the width of terminal?

mame avatar Jul 12 '21 07:07 mame

image

This might be another argument for using bold or xterm color in addition or alternatively to ^^^ style.

ioquatix avatar Feb 28 '23 00:02 ioquatix

Should we truncate such a long code snippet to fit it with the width of terminal?

Hey @mame, I share the same understanding, and I believe that’s a good idea (I’ve noticed other similar tools adopting the same approach). I’ve left a proposal here: https://github.com/ruby/error_highlight/pull/51

karreiro avatar Oct 10 '24 23:10 karreiro