jerone / UserScripts

🐵 My UserScripts
https://github.com/jerone/UserScripts#readme
GNU General Public License v3.0
339 stars 39 forks source link

(Github Comment Enhancer) Select the text inside the backticks when formatting as code #65

Closed thomaslevesque closed 8 years ago

thomaslevesque commented 9 years ago

Just a suggestion to improve the usability of Github Comment Enhancer:

When I type Ctrl+K, it inserts the `` characters and selects them. But it would be better to have the caret between the backticks, rather than select them, so that I can type immediately. Similarly, if I select some text and hit Ctrl+K, it would be better to select the text inside the backticks rather than include the backticks in the selection, so that I can immediately edit the text if I need to.

(the same is true for things like bold, italic, etc.)

jerone commented 9 years ago

Good suggestion. This script just inserts some text at the position of the cursor. Right now it doesn't know where to put the cursor, so it selects the whole insert for some commands (e.g. bold, italic, underline, ...) and appends the cursor for some other commands. The inserted text is added as a whole, not with a prefix and postfix. That's why it doesn't know where to put the cursor.

I agree this is a good suggestion, but it requires a complete rewrite of the commands logic.

I'm open for a PR :smile:

thomaslevesque commented 9 years ago

I'm open for a PR :smile:

Maybe I'll give it a try, but Javascript isn't my strong suit ;)

jerone commented 8 years ago

Closing this issue as Github Comment Enhancer is deprecated.