summaryrefslogtreecommitdiff
path: root/lib/error_highlight/core_ext.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/error_highlight/core_ext.rb')
-rw-r--r--lib/error_highlight/core_ext.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/error_highlight/core_ext.rb b/lib/error_highlight/core_ext.rb
index 3cfc72951d..d8d2175f8a 100644
--- a/lib/error_highlight/core_ext.rb
+++ b/lib/error_highlight/core_ext.rb
@@ -21,16 +21,13 @@ module ErrorHighlight
case self
when NoMethodError, NameError
- point = :name
+ opts[:point_type] = :name
opts[:name] = name
when TypeError, ArgumentError
- point = :args
+ opts[:point_type] = :args
end
- spot = ErrorHighlight.spot(node, point, **opts) do |lineno, last_lineno|
- last_lineno ||= lineno
- node.script_lines[lineno - 1 .. last_lineno - 1].join("")
- end
+ spot = ErrorHighlight.spot(node, **opts)
rescue Errno::ENOENT
end