boxer-project / boxer-sunrise

Sunrise on the Boxer Reconstruction Project
BSD 3-Clause "New" or "Revised" License
42 stars 2 forks source link

Deletions *sometimes* affect paste behavior #78

Closed rigdern closed 1 month ago

rigdern commented 3 months ago

When deleting text within Boxer, the deleted text overwrites what's on the clipboard if the clipboard data came from Boxer but not if the clipboard data came from another app. At the very least, I think these paste behaviors should match. Ideally, I think we should pick the paste behavior that matches what typical macOS applications do. More details below.

(These tests were done with Boxer 3.4.18 2024-05-26 on macOS)

Repro Steps A: Copying Text Within Boxer

  1. Copy the text "copy me" in Boxer
  2. Use the backspace key to delete the text "delete me" in Boxer
  3. Paste

Result: The text "delete me" is pasted.

Repro Steps B: Copying Text From Another App

  1. Copy the text "copy me" in another macOS app such as TextEdit
  2. Use the backspace key to delete the text "delete me" in Boxer
  3. Paste

Result: The text "copy me" is pasted.

Conclusions

sgithens commented 3 months ago

@rigdern Thanks for documenting this... I have some forthcoming notes on this, a lot of relates to our historical mimicings of certain emacs behaviors, including an emacs style killring. My plan is to modernize this so the cut and paste works as you'd expect (including with other applications), and actually repurposing much of the killring/yank code to implement an initial set of undo functionality... something which most people immediately notice isn't available.

sgithens commented 3 months ago

I've done some initial work on this, enough to satisfy this ticket I believe and should be in the 3.4.20 build. e19b676 Although I'd also like to make the cursor moving the end of what you've pasted on this round still. Additionally, this included some initial kill buffer reorganization, creation of a paste buffer item, and ideally some direction towards some primitive undo/redo. Leaving open until this is verified against 3.4.20.

rigdern commented 1 month ago

I confirmed this no longer repros in Boxer version 3.4.20 2024-08-06