Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Can't change autocomplete-plus:select-next in keymap #261

Closed
23tux opened this issue Feb 11, 2015 · 8 comments
Closed

Can't change autocomplete-plus:select-next in keymap #261

23tux opened this issue Feb 11, 2015 · 8 comments
Labels

Comments

@23tux
Copy link

23tux commented Feb 11, 2015

Hi,

I'm trying to overwrite some behaviour in my keymap.cson. But when I add this code, it has no effect:

'atom-text-editor:not(mini) .autocomplete-plus.autocomplete-suggestion-list':
  'tab': 'autocomplete-plus:select-next'
  'enter': 'autocomplete-plus:confirm'
  'up': 'unset!'
  'down': 'unset!'

I want to navigate through the suggestion list via tab and confirm them via enter. Can someone explain, why this isn't working? The example is from the readme.

@joefitzgerald
Copy link
Contributor

@park9140 could the change you made last night change the selector that needs to be used for keybindings? If so, we need a 🔤 docs update.

@park9140
Copy link
Contributor

@joefitzgerald, not anymore. The fix @benogle put in to remove the hidden input and allow IME input mode to work did however.

@23tux, you need to switch to using atom-text-editor.autocomplete-active as your selector.

@23tux
Copy link
Author

23tux commented Feb 11, 2015

@park9140 When I change it to atom-text-editor.autocomplete-active then every enter triggers an autocomplete, not only when the suggestion window is active. Where do I look to see what selector it is?

@joefitzgerald
Copy link
Contributor

I've observed this also.

@joefitzgerald
Copy link
Contributor

@park9140 it appears that with the move away from the hidden input, we've broken the ability to use keymaps to redefine the bindings. This is why we backed away from it last time, also.

When this behavior exhibits itself, confirm seems to always get called on the last-confirmed item. I think we need to clear our the selected item so that this doesn't happen.

@joefitzgerald
Copy link
Contributor

I found an easy way to prevent multiple-confirmation - but I'm not aware of how I allow enter to continue to service the editor once the suggestion list isn't active...

@joefitzgerald
Copy link
Contributor

We're not removing autocomplete-active when the suggestion list is hidden:

<atom-text-editor class="editor autocomplete-active" tabindex="-1" callattachhooks="true" data-grammar="source gfm" data-encoding="utf8"><div class="underlayer"><div is="wrap-guide" class="wrap-guide" style="left: 800px; display: block;"></div></div><div class="overlayer"></div></atom-text-editor>

@joefitzgerald
Copy link
Contributor

Yep, that fixed it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants