rundis / lt-snippets

Snippets/templates support for Light Table
MIT License
12 stars 4 forks source link

Strange problem with custom Snippet #7

Closed Armaklan closed 10 years ago

Armaklan commented 10 years ago

I try to create snippet

{:mode "editor.html"
 :snippets [
  {:name "Bootstrap: Col div"
   :key "col"
   :snippet-file "col.snip"
   }]}
<div class="col-md-5">
    $1
</div>
$0

When i expand this snippet => no content (snippet expand has no text). No problem with example snippet. No problem when i try with this :

<div class="col-md-5">

</div>
$0

I'm on Linux (Ubuntu). 
rundis commented 10 years ago

I'm guessing its because I'm not escaping snippet content. When you have tabstops in a snippet a div widget is shown inline in the editor. Your html currently becomes part of the widget rather than displayed as text. I'll look into it !

Armaklan commented 10 years ago

I try to replace "plugin" by a clone of this repository. When i launch LightTable i have this error :

Error loading JS file: /home/armaklan/.config/LightTable/plugins/lt-snippets/lt_snippets_compiled.js : TypeError: Cannot call method 'call' of undefined
bootstrap.js [28808]    lt.objs.plugins.__BEH__load_js
TypeError: Cannot call method 'call' of undefined at eval (/home/armaklan/.config/LightTable/plugins/lt-snippets/lt_snippets_compiled.js:50:65) at eval (native) at c (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:21370:41) at a (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:21378:18) at Function.lt.objs.plugins.__BEH__load_js (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:28800:33) at c (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:6196:14) at a (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:6236:18) at lt.object.raise_STAR_ (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:20533:74) at lt.object.update_listeners (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:20352:167) at lt.object.refresh_BANG_ (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:20695:66)
bootstrap.js [28809]    lt.objs.plugins.__BEH__load_js
rundis commented 10 years ago

I've probably didn't commit the compiled clojurescript files. I'm not consistent whether or not I do it, but I do think they muddle the commits. So if you decide to clone the repo to get bleeding edge I suppose you could try to open one of the cljs files in src, and trigger a compile (ie save the file should trigger it), (maybe you need to reload behaviors as well). Thx for the heads up though, I should probably add a disclaimer in the readme :-)

FYI I am working on getting a release 0.0.2 out today so you should be good soon !

Armaklan commented 10 years ago

Try to trigger compile but same error.

I'll wait release :)

Thx

rundis commented 10 years ago

the error you got was due to a silly println I forgot to remove (:

Armaklan commented 10 years ago

Test with 0.2. Work fine :)

rundis commented 10 years ago

Tx for your contribution !