Hacker News new | ask | show | jobs
by Diogenesian 10 days ago
This reads to me as the default behavior of "cut" makes certain usability choices that don't gel with the author's personal mental model and workflow, which is of course totally valid. But it is odd to see things described as a "flaw" instead of a choice.

The most glaring example seems to be the first: typically an accidental cut was intended to be a copy, not a delete, so leaving the text in your clipboard is a sensible design. I understand the author's perspective, and maybe OSes should have configurable "cut." But I think most people understand "undo" as "undo change to file" and not "undo change to file + OS state." In that sense the default behavior is not a flaw.

Again - the author's points about an alternative cut are reasonable, but they seem to appeal to a minority of users.

2 comments

Yes, I disagree that the cited behavior is defective. But I respect his pointing-out of the shortcomings and offering other options.

I find myself using the clipboard-erasure "defect" somewhat frequently to cut something to the clipboard, and then undoing the change and using the clipboard contents. And this is specifically useful in a way that merely copying isn't... but at the moment I can't remember why, or whether I use this when programming or working around InDesign's many defects.

It's really natural!

- make a bunch of edits

- decide I don't like all of them

- copy the part I want to keep

- undo a bunch

- paste the good part

This is copy, not cut, but it wouldn't work if the clipboard state was part of the undo system.

The article isn't arguing that clipboard state should be part of the undo system, it is arguing that cut shouldn't touch clipboard state. In the "Side effects" section they mention if you want the contents to go to the clipboard, then you should use copy instead of cut.
If it doesn't change the state how do I cut and paste between programs? And is 'paste' now using the clipboard half the time but not the other half?
Yes exactly, cut (and pasting a cut) is entirely within the same app. If you want to put something in another program you would have to copy.

Not saying I would prefer it, just explaining what the article says.

Exactly, you've nailed it.
Agreed, I like being able to cut or copy text into the clipboard, undo a few recent edits (Ctrl/Cmd+Z), then paste the contents of the clipboard in a new spot. The author's proposal would prevent me from doing that, at least without adding intermediate steps like pasting the clipboard into a temp file before undoing.