Refined-github: Extra spaces in comments because of using TAB

Created on 6 Apr 2016  Â·  24Comments  Â·  Source: sindresorhus/refined-github

This is a side effect of #117 I believe (pretty close to positive).

To use the available autocomplete when inserting a @ mention or emoji, you type @, TAB or :, TAB. This winds up adding extra spaces to the end of the comment. You don't really notice until you try to quickly get to the end of the text/line with ⌘→.

I have a sneaking suspicion that other keyboard events are adding spacing too, but I can't replicate it.

bug

All 24 comments

// @blackjid

We can work around that by detecting if we are in a code block or fenced code block. If we can't easily do that, I'd suggest using Shift + Tab for indenting.

I made a PR where I check whether the suggestion box is active of not before to indent

Can't we just use Shift + Tab for indenting so we won't be affecting the normal Tab behaviour?

I don't like the idea of Shift + Tab to fallback to normal. I rather prefer to unindent with that combination. That is what my muscle memory would expect.

Thoughts?

Does anyone have an objection to squashing this one via a revert of the functionality? There are 3 PRs to fix this (#164, #192, #197) and none seem close to completion.

Some motiviation: https://bugs.mysql.com/bug.php?id=16555

More motivation: https://bugs.mysql.com/bug.php?id=11472

The tab functionality is what finally got me to install this. So I would hate to see it go.

Is there any possibility to display whitespace characters like my editor does?

screenshot 2016-05-05 22 39 19

I'd like to keep it too, but I see the bug more than I use the feature.

but I see the bug more than I use the feature.

I don't get the problem though. It doesn't render, so why is it a big deal?

The OP of this issue explains it, but I wind up with extra spaces at the end of the comment that I have to delete.

I'm asking why you feel the need to delete them.

Because, @jamestalmage this is why.

E: GitHub trims the space? Still annoying. Let's kill the bug.

E: GitHub trims the space? Still annoying. Let's kill the bug

That's my point though. The extra whitespace doesn't matter. Both of my previous messages have tons of added whitespace in them and you never noticed. Even the email notification has no extra spaces in it. I'm all for killing the bug, but if it's living with this bug or living without the feature, I'll happily live with the bug. (I definitely think we can fix it though).

We merged a temp fix, but would be nice to fix it properly.

I'd also like to see Shift + Tab.
Although I use refined-github for a while now and I like it, I'm still used to do Shift + Enter to submit a comment/PR/etc.

To avoid conflicts between those keyboard shortcuts I'd prefer that solution. If enough people are in favor of it (seen some comments of people who were against it) I could do this in a PR.

@Ma27 Shift+Tab is more commonly used for unindenting. I would prefer a solution that preserved Tab for indenting.

The current behavior also interacts poorly with using Ctrl + Tab for switching tabs. If I'm writing a comment and have to switch to another tab for reference, pressing Ctrl + Tab causes spaces to be inserted into the comment just before the tab switch occurs. When I switch back, I have to erase the spaces before I can continue typing :(

I can't reproduce any of the issues described here, which were probably addressed by https://github.com/sindresorhus/refined-github/blob/f304ff7fcfc8edbe07f4e33794fd2a043024711f/src/content.js#L470-L473

Can we close this?

Reopen if this is still an issue even after #567

@bfred-it it is an issue for me as for today. It also makes me very disappointed that there are an uncountable number of feature that I can disable, but this is not one of them.

This is one of them, it’s part of the keyboard shortcuts.

The only feature you can’t disable are CSS-only ones, and even some of those still have JS switches to be disableable.

If someone is facing the same problem and want to disable it, the feature is called comment-fields-keyboard-shortcuts, thank you @bfred-it for the insight.

Reopen if this is still an issue even after #567

This is still absolutely the case, when selecting an emoji from the popover with tab extra whitespaces are inserted for me.

Can we reopen?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hkdobrev picture hkdobrev  Â·  3Comments

sindresorhus picture sindresorhus  Â·  3Comments

olso picture olso  Â·  3Comments

hkdobrev picture hkdobrev  Â·  3Comments

yakov116 picture yakov116  Â·  3Comments