pry / pry-doc

Provide MRI Core documentation and source code for the Pry REPL
https://github.com/pry/pry-doc
Other
175 stars 26 forks source link

show-source (on mri internals) doesn't work with some globals #83

Closed banister closed 6 years ago

banister commented 6 years ago

e.g

rb_vm_t *ruby_current_vm ^?ruby_current_vm^A313,7867

The code isn't written to accept both a ^? (\x7) and a ^A (\x01) chars on the same line:

https://github.com/pry/pry-doc/blob/master/lib/pry-doc/pry_ext/show_source_with_c_internals/c_file.rb#L28

It expects the line number to appear immediately after the first ^? char

Note that ^A is 001 see here:

https://en.wikipedia.org/wiki/Ctags#Etags_2 i.e

{tag_definition_text}<\x7f>{tagname}<\x01>{line_number},{byte_offset}
{tagname} (along with <\x01>) can be omitted if the name of the tag can be deduced from the text at the tag definition.
banister commented 6 years ago

Fixed via https://github.com/pry/pry-doc/commit/cd6b1476e806244c660c49d1764e95f37b3038ba