yahan973 / zen-coding

Automatically exported from code.google.com/p/zen-coding
0 stars 0 forks source link

SublimeText 2 - No expand if attributes #342

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write li*2>a then press Tab
2. Constate it works
3. Write li*2>a[name][target="_blank"] then press Tab
4. Constate it doesn't

What is the expected output? What do you see instead?
I expect a standard
<li>
  <a name="|" target="_blank"></a>
</li>
<li>
  <a name="" target="_blank"></a>
</li>
with the cursor at the | position. 

What version of the product are you using? On what operating system?
Sublime Text 2, Version 2.0 Build 2210
Zen Coding support for Sublime Text 2 version 2012.06.26.13.02.20

Please provide any additional information below.
I upgraded Sublime Text 2 yesterday, as the last version was out. Before that, 
using attributes works as I expect to. Now, it's just pushing the cursor a tab 
from where it was. 

Thank you for your consideration.

Original issue reported on code.google.com by MarinEth...@gmail.com on 28 Jun 2012 at 12:42

GoogleCodeExporter commented 8 years ago
I'm getting this problem too. :( Only solution I"ve found so far is to use the 
origin key-binding. CTRL+ALT+ENTER and then typing the the selector/pattern.

Original comment by m...@airfront.co.uk on 29 Jun 2012 at 8:13

GoogleCodeExporter commented 8 years ago
Looks like it’s ST2 issue: it doesn’t poll `on_query_completions` anymore 
when character before caret is ] so ZC doesn’t even know that you’re trying 
to expand something.

As a quick workaround, try to enter something after ] character. For example: 
div[title] → div[title]s

Original comment by serge....@gmail.com on 29 Jun 2012 at 3:15

GoogleCodeExporter commented 8 years ago
I should kiss you, your tip works ! And will speed my dev ! Hallelujah !
Though, it's not perfect, but it's close !
I'm going to let a message on S2 board.
Thank you ! 

Original comment by MarinEth...@gmail.com on 29 Jun 2012 at 3:20

GoogleCodeExporter commented 8 years ago
The issue also exists with things like "table+", "ul+", etc. That workaround 
doesn't work with +. 

Original comment by youngwis...@gmail.com on 3 Jul 2012 at 6:59

GoogleCodeExporter commented 8 years ago
With my workspace, things like (ul>li*3>a[href])+h2+p>strong works perfectly… 
Strange…

Original comment by MarinEth...@gmail.com on 4 Jul 2012 at 3:37

GoogleCodeExporter commented 8 years ago
Nothing strange here: the last character of your abbreviation (“g” in this 
example) is a valid word character so ST2 gives control to ZC plugin and it  
able to expand abbreviation. When the character before caret of expanded 
abbreviation is not a valid word character (like, +, ), ]) ST2 doesn’t send 
messages to ZC plugin.

Original comment by serge....@gmail.com on 4 Jul 2012 at 8:28

GoogleCodeExporter commented 8 years ago
This is making my life very difficult when coding CSS :( Has anyone found any 
workarounds for things like bg+ and others?

Should this be fixed by the zen coding people, or the sublime text people?

Original comment by Jacky...@gmail.com on 5 Jul 2012 at 10:32

GoogleCodeExporter commented 8 years ago
It should be fixed by ST2 team in order to correctly expand abbreviations by 
Tab key.

Original comment by serge....@gmail.com on 6 Jul 2012 at 8:13

GoogleCodeExporter commented 8 years ago
Hey guys, I'm the reluctant "maintainer" of Zen for Sublime. I don't use it much
myself so it's not a priority for me. Pull requests/ patches welcome etc.

Regardless, I just implemented a quick tentative fix for the problem serge was
mentioning.  I've implemented a binding context with `side effects` that does a
quick switcheroo on the word_separators setting, allowing <tab> to work as
desired. It restores it on a 0ms timeout.

Hacky as shit :) Lemme know if it has any hickups.

Original comment by ndudfi...@gmail.com on 6 Jul 2012 at 9:54

GoogleCodeExporter commented 8 years ago
Thank you very much, it may be a hacky fix but it does work! And thus my 
workflow is back

Original comment by Jacky...@gmail.com on 6 Jul 2012 at 11:33

GoogleCodeExporter commented 8 years ago
Thanks Nicholas! I’m creating a new version of Zen Coding right now, and when 
I finish with the core, I’ll continue to develop the ST2 plugin.

Original comment by serge....@gmail.com on 6 Jul 2012 at 12:59

GoogleCodeExporter commented 8 years ago
Oh neat :) Is the new version multi select capable?

Original comment by ndudfi...@gmail.com on 6 Jul 2012 at 1:16

GoogleCodeExporter commented 8 years ago
Closing this issue since new plugin should work fine: 
https://github.com/sergeche/emmet-sublime

Original comment by serge....@gmail.com on 14 Sep 2012 at 11:36