Fix clipdel cutting timestamps from file cache #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The actual bug I encountered was that clipdel apparently re-ordered the clipmenu entries (seen when writing my own clipmenu-del).
Looking into it, I found clipdel
cut
ed the timestamp column from the line cache file!So, I tried to fix this, and keep the pattern retro-compatible:
sed
sed -E
clipdel -d '^exact_match$'
(the pattern is matched only against the text, without the timestamp).Turns out sed is quite powerful, I discovered more sed commands that did the trick. But there could be a better solution I didn't see.
sed command
h
andg
seems standard (at least non-gnu compatible), but I did not actually test it with a non-gnu sed (on bsd ?).Also, I thought of using
sed -i
instead of for+mktemp, but I know there might be compatibility issues with non-gnu-sed, so I dropped it...