Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMD + Alt + . Keyboard Shortcut is Disabled #23

Closed
JohnONolan opened this issue Aug 20, 2013 · 12 comments
Closed

CMD + Alt + . Keyboard Shortcut is Disabled #23

JohnONolan opened this issue Aug 20, 2013 · 12 comments
Labels

Comments

@JohnONolan
Copy link

I can't figure out why - but when I have a file type set to Handlebars, the standard Sublime keyboard shortcut of CMD + Alt + . - which is the shortcut for Edit > Tag > Complete Tag does not function at all.

I've been able to verify this with a couple of people to ensure it's not just my environment, but I'm not sure what other info I can provide to debug.

I'm on Sublime 2.0.2 build 2221

@daaain
Copy link
Owner

daaain commented Aug 20, 2013

Hmm, strangely that shortcut is cmd+option+. for me, but I can confirm that it doesn't work.

Not really sure how to fix it as this shortcut is outside of this package. Just checked and even the HTML5 package breaks it, even though it has the same text.html.basic scope so there might be some dirty hardcoding action going on in Sublime :)

Sadly it seems to be similarly broken in ST3 too :(

I'll close this issue for now, but if you find a third party package where this shortcut works I'm happy to investigate.

@daaain daaain closed this as completed Aug 20, 2013
@GeoffreyBooth
Copy link

I have this issue too, and it's very annoying! I would suggest leaving the issue open in the hope that eventually a solution can be found :)

@daaain
Copy link
Owner

daaain commented Sep 12, 2013

All right, I don't mind reopening just so it's tracked, but as I wrote above this bug doesn't seem to be specific to this package and I definitely won't have time to spend on investigating this issue in the near future. Just let me know if you find any other package where it works I'm happy to take a look and of course pull requests are also welcome :)

@daaain daaain reopened this Sep 12, 2013
@whalesalad
Copy link

I've been banging my head against the wall trying to find a solution for this. One thing that I found is that the TMPL plugin works for completion: https://github.com/ademey/TMPL

I had to install it from source and then change the filetypes to include "hbs" and then it worked for completing tags, but gave me a big headache mess because it was meant for inline <script> style handlebars stuff and not external files. If you typed "if" and hit tab, an iframe would get inserted haha.

Anyway ... don't have the kind of skills to debug this fully but that repo might be of some assistance.

And +1 for this issue, I'd honestly pay $50 to whoever fixes this.

Also, I'd like to add that I am using Sublime Text 3. My completions work in HTML and other files, but not in Handlebars.

@mikefowler
Copy link

@daaain, @whalesalad, @DiegeticShadow, @JohnONolan: I'm going to dig back into this. Finally decided it's annoying enough for me to spend some time on.

@daaain, you likely know far more than me about the .tmLanguage syntax, but I've narrowed the issue down to 6 pattern blocks in the html_tags section. If you remove these pattern blocks and recompile the syntax, the tag autocompletion starts working again. Since I hardly know what I'm doing with this syntax, I'm basically just going to start playing around and see if I can isolate the specific issue, but I wanted to kickstart this issue again and knock it out together.

UPDATE 1: The { "include" : "#entities" } can be left in and the completion still works.

UPDATE 2: No discernible difference in the syntax highlighting after removing the pattern blocks mentioned above. Maybe I'm missing something.

@mikefowler
Copy link

In the meantime, here's a workaround that should work for everybody:

  1. Install the Tag plugin from Package Control
  2. Edit your user key bindings and add: { "keys": ["super+."], "command": "tag_close_tag" }

@daaain
Copy link
Owner

daaain commented Jan 31, 2014

Thanks a lot @mikefowler for the investigation!

There's a lot of syntax definition I had to paste in wholesale from the HTML5 package to be able to override and can't remember why exactly did I need them, but there are some tricky cases with nesting.

Just read your updates, did you look at the test files (in test folder) to see if there's anything changing in them? Also, did you check with the Show scope name shortcut (Shift + Control + P (OSX) or Shift + Control + Alt + P (Windows)) what is happening with the syntax scope?

If you don't mind creating a branch with stuff which worked for you I'm more than happy to take a look!

@wjthomas9
Copy link

Doesn't work for me either. Thanks for the temporary solution!

@thedamon
Copy link

Very weird indeed.
I used the the Laravel Blade Syntax Highlighter previously and it does not mess up the normal close tag shortcut...

@daaain
Copy link
Owner

daaain commented Feb 7, 2015

Thanks for the tip @thedamon, I just had a look.

One thing which I noticed is that in the README the author mentions that the package is incompatible with the HTML5 one, hmm, I wonder if I should be testing with and without that one.

But anyway, it seems that this package is also doing the approach I'm trying to avoid by importing the entire HTML and later PHP package so now there's 3500+ LOC to maintain. Also no idea how ST deals with the execution of syntax packages, but having to crunch through that much code can't be good for performance either.

Anyway, I'll leave this issue open for now hoping that one day it'll become clear what's exactly causing the problem.

@thedamon
Copy link

thedamon commented Feb 7, 2015

I will say that while I'm not using the blade syntax much anymore I did find that package to be a little buggy and kept breaking.. So hearing that abt the preloading and wanting to avoid it does make sense

@daaain
Copy link
Owner

daaain commented Dec 13, 2015

I just had a look and it seems installing Tag package fixes the keyboard shortcut even without having to manually add any binding. Since there's a simple and quick workaround (which I now added to the README) I'm very unlikely to give time to this fix, so closing the issue. PRs are still welcome though!

@daaain daaain closed this as completed Dec 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants