jade-tmbundle icon indicating copy to clipboard operation
jade-tmbundle copied to clipboard

Plugin crash on ST2

Open paprikka opened this issue 12 years ago • 8 comments

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?

paprikka avatar Mar 01 '13 14:03 paprikka

Same crashing here.

davidtheclark avatar Mar 01 '13 18:03 davidtheclark

+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.

alexhanh avatar Mar 04 '13 13:03 alexhanh

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.


paprikka avatar Mar 04 '13 14:03 paprikka

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?

alexhanh avatar Mar 04 '13 14:03 alexhanh

2013/3/4 Alexander Hanhikoski [email protected]

span.help-inline foo.

I can:) Same thing here.

paprikka avatar Mar 04 '13 14:03 paprikka

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

paprikka avatar Mar 04 '13 14:03 paprikka

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

alexhanh avatar Mar 04 '13 14:03 alexhanh

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.

davidrios avatar Mar 04 '13 22:03 davidrios