Repository navigation
Keep recent captures replayable, and walk them inside a snip - #19
Merged
Merged
Conversation
Snipaste's trick, which Peg was missing: a capture saved as a frozen frame plus its selection and marks, so a region that was framed badly — or annotated badly — can be redone later instead of starting from a new screenshot of a screen that has moved on. - Every finished snip stores the full frame (JPEG, quality 0.9) and a small JSON of the selection and the marks under Application Support/Peg/sessions. - A fixed count is kept, 10 / 30 / 50 in settings, default 30. Reaching the limit drops the oldest; there is no time-based expiry. - Inside a snip, `,` walks back and `.` walks forward. The frame, the selection and the marks all come back, editable straight away — no separate "reopen" step. Walking forward past the newest entry returns to the live capture and its own selection. - The two keys are ordinary shortcuts in settings (plain `,` and `.` by default) but are never registered as global hot keys; they only act on the overlay.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Snipaste's history replay, which Peg was missing.
What is stored
Every finished snip saves:
Under
~/Library/Application Support/Peg/sessions/, next to each other, so the saved screenshots in the pictures folder are untouched.Retention
A fixed count, not a time window: 10 / 30 / 50 in settings, default 30. When the limit is reached the oldest pair is deleted as the new one lands.
Using it
Inside a snip overlay:
,.The frame, the selection and the annotations all come back, and everything is editable immediately — no separate "reopen for editing" step, which was the point. Walking forward past the newest entry restores the live capture and its own selection (or lack of one).
Both keys are ordinary entries in the settings window, so they can be rebound; they are deliberately not registered as global hot keys, only handled by the overlay.
Verification
session-*.jpg+session-*.jsonwrittenhistory: showing entry 0 shapes=1, the old frame with its 800×600 selection and the caption, bar activehistory: back to the live frame, live content, live selection restoredSessionStore.prune()keys offPrefs.sessionLimit; 10/30/50 in settingsFocus-stealing is refused while another app is in front, so the key path was exercised through a
history:prev/history:nextdebug command; the key handler itself is a two-line match on key code plus modifiers.