Skip to content

Wrong line selected when viewing source code #3270

@smileBeda

Description

@smileBeda

When choosing the --sourcecode option generating DOCs, which works fine per se on a real server, the PopUp will scroll to the wrong line of code. Precisely, it will scroll to the end of the code definition instead of the begin.

Expected behavior

Viewing Source code scrolls the source code in the pop up to the start of the particular code definition and not the end

Actual behavior

The opposite is the case: Viewing Source code scrolls the source code in the pop up to the end of the particular code definition instead of the start

Steps to reproduce the problem

Simply run the PHP Documentor with the --sourcecode on.
Please find a real life use case here for better understanding.
In that DOC, view for example this var $plugin_name
Then, click the <> to the right to view the source code.

This is what you will see:
Screenshot 2022-07-17 at 10 36 52

This is what you should see:
Screenshot 2022-07-17 at 10 37 20

As you can notice, it shows the next var in the start of popup. That's wrong, it should show the actual viewed var.

Your environment

This is a barebones Apache server, the doc has been generated on a Mac MacBook Pro (16-inch, 2019), it runs PHP 7.4, it's the latest PHPDocumentor.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions