olivierdagenais / tampermonkey-copy-url

A Tampermonkey userscript to copy nice-looking URLs to the clipboard.
MIT License
0 stars 0 forks source link

fix: home/end keys in Bitbucket DC's CodeMirror-based editors #63

Closed olivierdagenais closed 6 months ago

olivierdagenais commented 6 months ago

Fixes #51.

Manual testing

GIVEN

A computer with access to Bitbucket v8.9.9 and running Firefox, Tampermonkey and the index.user.js file generated by the changes in this pull request.

WHEN

I give focus to a CodeMirror-based editor (such as creating a pull request, editing a pull request description or creating/modifying a pull request comment) and I activate the Home and End keys.

THEN

The cursor jumps to the home and end of the current line, even if it is a very long line wrapped across more than one visible line. In other words, the cursor is no longer taken to the very beginning or the very end of the wrapped line.

NOTES

There are still a few edge cases with "arrow up" when the cursor is on a longer virtual line than the one above it or when we're at or around the line-breaking character (likely based on the sticky value), but Home and End appear to function as expected, which was the biggest problem to fix.

Mission accomplished!