Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actively detect links under the cursor when lines change #4323

Open
Tyriar opened this issue Dec 16, 2022 · 2 comments
Open

Actively detect links under the cursor when lines change #4323

Tyriar opened this issue Dec 16, 2022 · 2 comments
Labels
area/links help wanted type/enhancement Features or improvements to existing features

Comments

@Tyriar
Copy link
Member

Tyriar commented Dec 16, 2022

The PR #4298 made it so that an active link under the cursor would be re-evaluated instead of thrown away when the line changes, but we also want to capture this case:

Recording 2022-12-09 at 09 19 23

Repro:

  1. Fill viewport
  2. Run echo -n "http://example.com/" && sleep 1 && echo -n "a" && sleep 1 && echo -n "b" && sleep 1 && echo -n "c" && sleep 1 && echo -n " x" && sleep 1 && echo -n "x" && sleep 1 && echo "x" && sleep 1 && echo "y" && sleep 1 && echo "y" && sleep 1 && echo "y"
  3. Put cursor above http://example.com/, when a line is added such that the cursor is over the link, the link should get an underline and clicking should activate it, without needing to move the cursor beforehand

This change makes this happen but will result in a lot of work:

    this._renderService.onRenderedViewportChange(e => {
      if (this._lastMouseEvent) {
        this._handleMouseMove(this._lastMouseEvent);
      }
    });

Can augment the above, the solution in #4298, some debouncing and possible some other form of caching to save some CPU cycles?

@Tyriar Tyriar added type/enhancement Features or improvements to existing features help wanted area/links labels Dec 16, 2022
@jerch
Copy link
Member

jerch commented Dec 17, 2022

@Tyriar Yes the other PR partially fixes the old issue, but not yet for that particular edge case.

Can augment the above, the solution in #4298, some debouncing and possible some other form of caching to save some CPU cycles?

I think so, but the devil might be in details here, how to get proper debouncing working from several terminal actions/states. (Have not yet checked how bad the perf would degrade w'o any debouncing...)

@Tyriar
Copy link
Member Author

Tyriar commented Dec 17, 2022

With debouncing we could make it quite small like 50ms as we're just trying to avoid it checking when constant parsing is happening, we would also only want to debounce these refreshes to keep regular mouse moves as responsive as possible as the delay would affect the underline showing up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/links help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

No branches or pull requests

2 participants