ThisIsMissEm / jade-tmbundle

[DEPRECATED] A textmate bundle for the Jade language
http://jade-lang.com
220 stars 81 forks source link

Plugin crash on ST2 #26

Open paprikka opened 11 years ago

paprikka commented 11 years ago

Plugin crashes every time I open the file or paste its content to Sublime Text 2 (OSX Mountain Lion).

I'm using JADE with AngularJS, btw.

index.jade

div(ng-controller="app.controllers.MediaIndexCtrl").subpage.media-index-page
  .hero-unit
    h1 Multimedia
    p.lead Zarządzaj logotypami oraz materiałami dotyczącymi leków.
  div(upload, btn-title="Prześlij nowy plik", accept-file-types="(\.|\/)(gif|jpe?g|png|xlsx)$", ng-model="uploadWidgetActive", upload-target="/media/upload", on-uploaded="reloadMedia()")
  div
    h2
      | Dodane pliki:
      span.input-append.pull-right
        input(type="search", ng-model="mediaQuery", placeholder="Szukaj")
        button.btn(ng-click="mediaQuery=''") ×
    div(ng-show="!files.length").alert.alert-info Nie dodano jeszcze żadnego pliku.
    ul.thumbnails.files-list
      li(ng-hide="filtered.length")
        div.alert.alert-info Brak wyników
      li.thumbnail.span2(ng-repeat="file in filtered = (files | filter:mediaQuery)")
        a.thumbnail(ng-click="preview(file)")
          img.file-icon(ng-src="{{src = (file.thumbnailUrl || '/img/folder.jpeg')}}")
        div.caption
          h5 {{file.name}}
          div
            a.btn.btn-small(ng-href="{{file.url}}", target="_blank")
              i.icon-download
              |  Pobierz
            |  
            a.btn-small.btn.btn-inverse(ng-click="tryRemove(file)")
              i.icon-trash

Any idea what might be the cause of crash?

davidtheclark commented 11 years ago

Same crashing here.

alexhanh commented 11 years ago

+1

Using AngularJS and Jade. Here's what seems to crash ST2 when pasting:

        .holding(style="position: relative;")
          .sidetip(style="position: absolute; left: 310px; margin-top: 5px; width: 250px;")
            span.help-block.tip(ng-show="orderForm.firstName.$error.tip || orderForm.lastName.$error.tip && !(orderForm.firstName.$error.required || orderForm.lastName.$error.required)") Kirjoita etu- ja sukunimesi.
            span.help-block.error(ng-show="orderForm.firstName.$error.required || orderForm.lastName.$error.required && !(orderForm.firstName.$error.tip || orderForm.lastName.$error.tip)")
              i.icon-remove
              |  Etu- tai sukunimi puuttuu!
            span.help-block.ok(ng-show="orderForm.firstName.$valid && orderForm.lastName.$valid")
              i.icon-ok
              |  Nimi näyttää hyvältä.
          input.name(type="text", name="firstName", ng-model="orderData.firstName", placeholder="Etunimi", validatenames="validatenames")
          input.name(type="text", name="lastName", ng-model="orderData.lastName", placeholder="Sukunimi", validatenames="validatenames")

When I remove the special accent character (äö), the paste works. Could this be an encoding issue?

What is weird that I've been using Jade with Angular quite some time just fine, with accented characters. This just recently started to brake.

paprikka commented 11 years ago

This sounds pretty probable to me, but removing polish characters didn't help in my case.

That's the smallest piece of code that made ST2 unresponsive for few seconds:


        .control-group
          label.control-label Rola
          .controls
            div(user-role-picker, ng-model="user.role")              

        .control-group
          label.control-label Obszary terapeutyczne
          .controls
            div(specialization-picker, ng-model="user.specializations")
        .control-group 
          .controls
            input(type="checkbox",  name="mustChangePassword", ng-model="user.mustChangePassword")
            label.help-inline Uzytkownik musi ustawic haslo przy nastepnym logowaniu.
alexhanh commented 11 years ago

I've been able to get it down to

span.help-inline foo.

Causes a momentary hangup. Can someone confirm?

The dot at the end along with the dots in the classes seems to cause the problems. Without looking at the bundle code, could this be a regexp problem inside the bundle?

paprikka commented 11 years ago

2013/3/4 Alexander Hanhikoski notifications@github.com

span.help-inline foo.

I can:) Same thing here.

paprikka commented 11 years ago

Seems that trailing dot causes the hangup. Maybe because of the alternative multiline syntax?

alexhanh commented 11 years ago

I found the breaking commit https://github.com/davidrios/jade-tmbundle/commit/8d928377fb043bb40c659fd8d8d30af49ee2c4b4

davidrios commented 11 years ago

sorry, my repo was linking to this one incorrectly on the README. this one does not have that bug, and it's already fixed on mine.