rundis / lt-snippets

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

Error message being printed console upon expanding snippet #17

Closed habemus-papadum closed 9 years ago

habemus-papadum commented 9 years ago

Hi -- I'm trying to use lt-snippets with Lighttable bundled as the Juno editor from http://junolab.org

Juno is basically a recent version of Lighttable which with some plugins and users behaviors bundled. I am trying to add lt-snippets using the plugin manager (which in theory should not be a problem; e.g. I was able to add gitlight to Juno)

I tried creating a basic snippet, which does work correctly when I execute the "expand based on editor token" command (e.g. lt-snippets expands the text correctly), but it does dump an error message to the console:

TypeError: undefined is not a function
    at lt.plugins.lt_snippets.__BEH__complete_snippet.__BEH__complete_snippet__delegate (/Users/lilinjn/Library/Application%20Support/Juno-LT/plugins/lt_snippets/lt_snippets_compiled.js:727:36)
    at lt.plugins.lt_snippets.__BEH__complete_snippet.__BEH__complete_snippet (/Users/lilinjn/Library/Application%20Support/Juno-LT/plugins/lt_snippets/lt_snippets_compiled.js:749:42)
    at cljs.core.apply_to (file:///Applications/Juno.app/Contents/Resources/app/core/node_modules/lighttable/bootstrap.js:6105:91)
    at c (file:///Applications/Juno.app/Contents/Resources/app/core/node_modules/lighttable/bootstrap.js:6194:42)
    at a (file:///Applications/Juno.app/Contents/Resources/app/core/node_modules/lighttable/bootstrap.js:6236:18)
    at c (file:///Applications/Juno.app/Contents/Resources/app/core/node_modules/lighttable/bootstrap.js:20443:76)
    at a (file:///Applications/Juno.app/Contents/Resources/app/core/node_modules/lighttable/bootstrap.js:20477:18)
    at a (file:///Applications/Juno.app/Contents/Resources/app/core/node_modules/lighttable/bootstrap.js:20488:34)
    at b (file:///Applications/Juno.app/Contents/Resources/app/core/node_modules/lighttable/bootstrap.js:20492:14)
    at Function.__BEH__initiate_snippet (/Users/lilinjn/Library/Application%20Support/Juno-LT/plugins/lt_snippets/lt_snippets_compiled.js:766:25)

I'm just getting started with Lighttable so I'm not entirely sure what's the best way to track down this error. Any suggestions would be most welcome!

thanks!

rundis commented 9 years ago

Cheers

Would you mind removing lt_snippets_compiled.js and lt_snippets_compiled.js.map from the pull request ? I'll add the transpiled stuff once I make a release.

rundis commented 9 years ago

I can't reproduce the error and I'm having trouble understanding how the suggested fix changes anything.

habemus-papadum commented 9 years ago

I believe the issue is that .contains() is not portable javascript cf. http://stackoverflow.com/questions/1789945/how-can-i-check-if-one-string-contains-another-substring

Perhaps only noticeable when running LT under atom-shell...

rundis commented 9 years ago

This should be fixed with version 0.1.1