greghendershott / racket-mode

Emacs major and minor modes for Racket: edit, REPL, check-syntax, debug, profile, packages, and more.
https://www.racket-mode.com/
GNU General Public License v3.0
682 stars 93 forks source link

`args-out-of-range` error with `electric-pair-delete-pair` at end of buffer #674

Closed greghendershott closed 1 year ago

greghendershott commented 1 year ago
  1. Open or create a buffer using racket-hash-lang-mode, with e.g. #lang rhombus.
  2. Enable electric-pair-local-mode.
  3. At end of buffer, type (. Result: (), with point between the parens.
  4. Type BACKSPACE or M-x electric-pair-delete-pair to delete both parens.

Result:

Error running timer ‘racket--hash-lang-on-notify’: (args-out-of-range 159 160)

Due to put-text-property being called with an end position greater than point-max.

Note: A similar recipe does not cause a problem with paredit-mode instead of electric-pair-local-mode.