Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Can't accept code hints with Enter or Tab if using Emmet plugin #2455

Open
ujjaval opened this issue Dec 30, 2012 · 12 comments
Open

Can't accept code hints with Enter or Tab if using Emmet plugin #2455

ujjaval opened this issue Dec 30, 2012 · 12 comments

Comments

@ujjaval
Copy link

ujjaval commented Dec 30, 2012

Started using Emmet plugin in Brackets (Sprint 18) and noticed that intellisense gets affected by the plugin.

As I type <sc for <script>, options show below for matching tags. But when I selected one by the down arrow key and pressed Enter,
instead of completing <sc, it inserted new line in the code, without completing <script. Happened with other tags too.

Auto completion using Tab key also doesn't work, as Emmet plugin inserts tag for incomplete word. That is, type <sc and press tab key, instead of inserting <script, it inserts <<sc></sc> due to Emmet plugin.

Removed the Emmet plugin and tags started to auto complete again using Enter/Tab.

@ghost ghost assigned redmunds Jan 7, 2013
@redmunds
Copy link
Contributor

redmunds commented Jan 7, 2013

This is a related case of issue reported in #2353.

The preferred fix would be for CodeHintManager to get the key event before the Editor. Otherwise, I think we'd need an API call that Commands could use to determine if Code Hints are displayed (or more generically, if they can execute command).

@pthiess
Copy link
Contributor

pthiess commented Jan 11, 2013

@redmunds - with the fix for #2353 should we nominate this for sprint 19?

@redmunds
Copy link
Contributor

I don't think this is important for sprint 19. It needs some research.

@peterflynn
Copy link
Member

@redmunds: It seems like CodeHintManager would have to get the key not just before the Editor, but before KeyBindingManager too (otherwise it'll still get fed to the command Emmett registered, and then swallowed). That's way trickier since KBM's listener gets called so early (capture on document, I think).

@ahmetus
Copy link

ahmetus commented Jan 22, 2013

@sergeche has a strong suggestion about issue: emmetio/emmet#146 (comment)

@ahmetus
Copy link

ahmetus commented Jan 22, 2013

I installed Bracket Sprint 19, issue still there.

@sergeche
Copy link

OK, I made a few updated for Brackets plugin:

  1. Since GitHub disabled uploads, the Brackets plugin now lives here: https://github.com/emmetio/brackets-emmet
  2. The plugin code base is more “requirejsy”: the Emmet core is separated from plugin controller and editor proxy so it’s easier to test, contribute and update plugin.
  3. I made sure that action handler returns deferred object in all cases (“Find” dialog should work fine)
  4. Added hack for formatted line break insertion: if it detects opened code hint dialog it won’t work (code suggestions should work fine).

@redmunds
Copy link
Contributor

@sergeche Thanks for workaround and the suggestion about contexts for keybindings. We'll take a look at that.

@ahmetus
Copy link

ahmetus commented Jan 23, 2013

@sergeche I forked your work and tested. It works by all means, even with tab key and did not break intellisense or finding replacing. Issue solved. Thank you for your great effort and all interest.

@WebsiteDeveloper
Copy link
Contributor

@ujjaval is this fixed?

@njx
Copy link

njx commented Jun 6, 2013

It looks like #4110 might make it so @sergeche can remove the hack in the Emmet plugin--that change basically makes it so we're doing what @peterflynn suggests above (getting the key event before the default key binding handling). @sergeche, if you feel like checking out that pull request and seeing if it makes it you can remove the hack, that's great, otherwise you can wait until we've merged it to try that out.

@redmunds redmunds removed their assignment Jan 8, 2015
@sirme87
Copy link

sirme87 commented Nov 18, 2015

Using Release 1.5 build 1.5.0-16538 and latest Emmet 1.2.2 and this issue is still existing. Any ideas for the workaround?

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

No branches or pull requests

10 participants