Opened 11 years ago

Closed 11 years ago

#424 closed defect (duplicate)

dragging a proxy icon or a finder icon to an editor window errors

Reported by: jaj Owned by: gz
Priority: normal Milestone: Cocoa IDE v1
Component: IDE Version:
Keywords: Cc:

Description

It fails in various ways. The first time it brought up the console window with a failed assertion.

I'm marking this normal, not major, because I don't think it's a typical thing for a user to do

Change History (2)

comment:1 Changed 11 years ago by gb

One simple way to reproduce this (at least one case of a simple assertion failure) is to do:

 (process-interrupt ccl::*cocoa-event-process* 
   (lambda () 
     (let* ((ts (slot-value (hi::buffer-document (cadr hi::*buffer-list*)) 'gui::textstorage)))
       (#/beginEditing ts) 
       (#/replaceCharactersInRange:withString: ts (ns:make-ns-range 0 0) #@"Banzai!")
       (#/endEditing ts)))) 

If we remove the #/beginEditing and #/endEditing calls, it probably won't get the assertion failures and will likely work as expected. Our implementation of #/replaceCharactersInRange:withString: on HEMLOCK-TEXT-STORAGE should only be called by "foreign" code - things like cut and paste, drag-and-drop, etc. Anything that's modifying a displayable textstorage object directly (via #/replaceCharactersInRange:withString: or anything like that) should have surrounded those modifying operations with #/beginEditing and #/endEditing. (Our implementation of #/paste on HEMLOCK-TEXT-VIEW neglects to do this, but that "works" because our #/replaceCharactersInRange:withString: method assumes that the string is not being edited. Note that we specialize #/paste on HEMLOCK-TEXT-VIEW but not on ECHO-AREA-VIEW, and generally get the same bogus assertion failure (see ticket:258) when pasting into the echo area.

comment:2 Changed 11 years ago by jaj

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of ticket:360

Note: See TracTickets for help on using tickets.