LightTable icon indicating copy to clipboard operation
LightTable copied to clipboard

Don't autocomplete on numerics or in comments

Open mmower opened this issue 12 years ago • 18 comments

It's arguable but I think the autocomplete shouldn't try and autocomplete when typing numbers. For example if you type "2" it'll complete to "*2", "1" similarly has a bunch of autocompletes. My guess is it's pretty rare you're wanting one of those and most likely actually typing a number where using 'esc' to end the complete is wasted effort.

Anyone else think the same?

mmower avatar Jan 11 '14 18:01 mmower

:+1:

bilderbuchi avatar Jan 12 '14 10:01 bilderbuchi

It's probably worth nothing that I have auto-complete/auto-show-on-input enabled. Generally this is very useful but there are two problem cases: numerics and comments.

Auto-complete in comments turns out to be a bit of a pain and often ends up with me going back and undoing.

mmower avatar Jan 16 '14 19:01 mmower

Tangentially related - you can remove autocomplete on return and just use it on tab:

:editor.keys.hinting.active {"tab" [:auto-complete]
                             "enter" [:passthrough]}

That's probably why I haven't noticed that autocomplete in comments is annoying with the default settings.

jamii avatar Jan 16 '14 20:01 jamii

Ah that's a great tip Jamie, thanks.

Is it worth leaving this open? You've got lots more to look at and your work-around sounds good.

m/

mmower avatar Jan 16 '14 22:01 mmower

I tried adding that to my user.behaviours file and enter still seems to be autocompleting for me. Here's my config:

https://gist.github.com/mmower/a390a7ce228395590b28

any idea what I might have done wrong?

mmower avatar Jan 17 '14 01:01 mmower

You need to put that in your keymap file instead of your behaviors and it should be good :)

ibdknox avatar Jan 17 '14 04:01 ibdknox

Doh!

I did wonder when nothing was auto-completing but it still didn't occur to me ;-)

Thanks Chris.

m/

mmower avatar Jan 17 '14 11:01 mmower

Okay having tried this now it doesn't actually seem to work, at least now how I was expecting.

So if i am typing, say,

exp

and the autocomplete pops up then the enter key no longer autocompletes, but neither is it processed and the autocomplete popup remains open, even if pressed multiple times. It seems like enter is now ignored rather than passed through.

I take it you guys are not seeing that?

mmower avatar Jan 17 '14 11:01 mmower

Nope, works for me. Can I see your keymap?

ibdknox avatar Jan 17 '14 21:01 ibdknox

Thanks Chris

Keymap is here https://gist.github.com/mmower/3c902f2eb8b62c759cdc

I've prefixed the autocomplete stuff with x- to disable it while working out what's wrong. The prefix wasn't in place while I was testing.

m/

mmower avatar Jan 18 '14 15:01 mmower

Passthrough doesn't have a dash in the command name

On Saturday, January 18, 2014, Matt Mower [email protected] wrote:

Thanks Chris

Keymap is here https://gist.github.com/mmower/3c902f2eb8b62c759cdc

I've prefixed the autocomplete stuff with x- to disable it while working out what's wrong. The prefix wasn't in place while I was testing.

m/

— Reply to this email directly or view it on GitHubhttps://github.com/LightTable/LightTable/issues/1064#issuecomment-32684192 .

Cheers, Chris.

ibdknox avatar Jan 18 '14 16:01 ibdknox

This is quite baffling. Somehow between having it in the behaviours file and my keymap I added a dash. I'm wondering if I actually did that because it wasn't working (for some other reason) and it was difference to the auto-complete.

Anyway thanks Chris, it's working now.

Kind regards,

Matt

mmower avatar Jan 20 '14 17:01 mmower

totally agree, autocomplete for comments is unnecessary

dcz-switcher avatar Jan 05 '15 19:01 dcz-switcher

If possible, a sane default could be don't even suggest autocomplete until the third typed number.

Mostly, I get this a lot when playing around with single and double digits. Usually, I just want to type something like /3, and instead I get suggestions for any number starting with 3.

Joshfindit avatar Jul 05 '15 03:07 Joshfindit

Pull requests welcome!

kenny-evitt avatar Jul 06 '15 13:07 kenny-evitt

@cldwalker @rundis I'm inclined to move this to the feature wishlist. I can understand why someone would want this but (1) it's a pretty low relative priority; (2) I can understand why someone would not want this – I don't personally, for one. Any objections to closing this?

kenny-evitt avatar Jan 15 '16 22:01 kenny-evitt

@kenny-evitt Considering no one who's wanted this has looked into it I'm fine with the wishlist

cldwalker avatar Jan 15 '16 22:01 cldwalker

This is so annoying when it happens.

Mouvedia avatar May 31 '16 23:05 Mouvedia