peterh / liner

Pure Go line editor with history, inspired by linenoise
MIT License
1.04k stars 132 forks source link

feat/dedup-history #160

Open go-dockly opened 1 year ago

go-dockly commented 1 year ago

pretty self explanatory I hope the comment helps. Kuddos for the fantastic library

peterh commented 1 year ago

Sorry for the delay in responding. When I see someone update a branch after opening a pull request, I wait a couple of days to see if more updates are coming, and then I forgot about this.

What is the reason for deduplication? Assuming the reason for deduplication is to keep more unique history, we should deduplicate on history add (not history write). Either way, this is a deliberate change in behaviour, so it needs a persuasive rationale (certainly more than "pretty self explanatory") and possibly a flag to control the behaviour.

If we're going to deduplicate, we should keep the most recent copy, not the oldest.

In a pull request all the "fix" commits should be squashed into the commit that they fix.