racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
447 stars 94 forks source link

Internal error: starting index is out of range #458

Open sorawee opened 3 years ago

sorawee commented 3 years ago
open-input-text-editor: starting index is out of range
  starting index: 19
  valid range: [0, 18]
  editor: (object:add-on-paint-logging ...)
  context...:
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/mred/private/snipfile.rkt:24:4: open-input-text-editor
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/framework/private/color.rkt:592:4: colorer-driver method in text-mixin
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/framework/private/color.rkt:615:4: colorer-callback method in text-mixin
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/mred/private/wx/common/queue.rkt:435:6
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/mred/private/wx/common/queue.rkt:433:3

Steps to reproduce:

  1. Open a new tab.
  2. Paste (('x (#<))).
  3. Undo.

The internal error should occur.

EDITED: sorry, should have put this in racket/gui. Feel free to move if anyone wants to.

jbclements commented 3 years ago

Per a comment on racket/gui#220, one workaround here (worked for me, anyway) is to call "freeze-colorer" on the offending text%. Yeah, I see that that isn't actually very effective in the situation described in this bug. Works great for me, though!

jbclements commented 3 years ago

Hmm... may have spoken too soon. My new workaround is just creating a fresh text% for each piece of text I want to indent. Ah well.