racket / drracket

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

`M-q` seems to break the definitions panel? #180

Open florence opened 6 years ago

florence commented 6 years ago

In the following program:

#lang scribble/manual
@(require (for-label racket)) @defform[(run& proc)]{

 Some text goes here.

}

If I put my cursor on the third to last line (in between the } and Some text goes here and hit M-q, the entire definitions panel goes blank (no cursor, nothing but white). An error flashes briefly in bottom, but its too fast for me to read. The error doesn't show up in the terminal when I launch DrRacket manually. ctrl-z doesn't fix things, I need to close the tab and reopen.

I'm currently running the latest git head (as of a few hours ago).

dfeltey commented 6 years ago

I can replicate this, and I think this is the error message that DrRacket is trying to show:

delete in text%: bad argument combination: -1 0
  context...:
   next
   /Applications/Racket v6.10/share/pkgs/gui-lib/scribble/private/indentation.rkt:342:2: loop
   /Applications/Racket v6.10/share/pkgs/gui-lib/scribble/private/indentation.rkt:67:0: paragraph-indentation
   /Applications/Racket v6.10/collects/racket/contract/private/arrow-higher-order.rkt:342:33
   /Applications/Racket v6.10/share/pkgs/drracket/drracket/private/insulated-read-language.rkt:156:7
   /Applications/Racket v6.10/share/pkgs/gui-lib/mred/private/wxme/keymap.rkt:736:2: core502
   /Applications/Racket v6.10/share/pkgs/gui-lib/mred/private/wxme/keymap.rkt:508:2: chain-handle-key-event method in keymap%
   [repeats 1 more time]
   /Applications/Racket v6.10/share/pkgs/gui-lib/mred/private/wxme/keymap.rkt:459:2: handle-key-event method in keymap%
   /Applications/Racket v6.10/share/pkgs/gui-lib/mred/private/wxme/editor.rkt:214:2: on-local-char method in editor%
   /Applications/Racket v6.10/share/pkgs/gui-lib/mred/private/wxme/editor-canvas.rkt:462:2: on-char method in editor-canvas%
   /Applications/Racket v6.10/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
   /Applications/Racket v6.10/collects/ffi/unsafe/atomic.rkt:72:13
   /Applications/Racket v6.10/share/pkgs/gui-lib/mred/private/wx/cocoa/window.rkt:801:4: dispatch-on-char method in window%
   /Applications/Racket v6.10/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:454:6
   /Applications/Racket v6.10/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:505:32
   ...
dfeltey commented 6 years ago

I tried to look into fixing this, but I can't figure out where the esc;q keybinding is implemented because that seems like the first place to look.

florence commented 6 years ago

I think this is it?

https://github.com/racket/gui/blob/master/gui-lib/scribble/private/indentation.rkt#L60