You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two main concepts added to the viewport code:
- A **mask** is a subarea of the canvas which subsequent calls will implicitly not render outside of. This lets us overlay one component on top of another in a fixed area. We use this to allocate the top line of the screen to the menu bar and the rest of the screen to the files. We could also use this in the future for e.g. rendering files side-by-side.
- A **timestamp** is a monotonically-increasing integer assigned to each component as it's drawn. Previously, we tried to figure out which component was being clicked by finding all components which drew to a certain point on the screen and selecting the smallest one. In some cases, this wasn't sufficient. For example, the sticky file header may be larger than a changed line drawn behind it, but we still want to select the sticky file header in this case. Now, we use the timestamp value to infer which of two components is drawn on top (with the later-drawn component being on top).
The menu bar is a fairly straightforward state machine. There may come to be issues with managing interactions between components. For example, we now have an event to unfocus the menu bar, which means that we need to be aware of the menu bar when clicking on any other component on the screen. This sort of behavior will eventually lead to O(n^2) state transitions. The proper fix would probably be some kind of event system in combination with a focus system.
Copy file name to clipboardExpand all lines: scm-record/README.md
-24Lines changed: 0 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,29 +23,6 @@ This is a standalone binary that uses the `scm-record` library as a front-end, a
23
23
-[Mercurial](https://www.mercurial-scm.org/): via [the `extdiff` extension](https://wiki.mercurial-scm.org/ExtdiffExtension). Only supports viewing diffs, not editing them.
24
24
-[Jujutsu](https://github.com/martinvonz/jj): via [the `ui.diff-editor` option](https://github.com/martinvonz/jj/blob/main/docs/config.md#editing-diffs).
25
25
26
-
# Keybindings
27
-
28
-
Ideally, these would be documented in the UI itself.
29
-
30
-
-`ctrl-c`, `q`: discard changes and quit. If there are unsaved changes, you will be prompted to confirm discarding them.
31
-
-`c`: confirm changes and quit.
32
-
-`f`: expand/collapse the current item.
33
-
-`F`: expand/collapse all items.
34
-
-`up`/`k`: select the next item.
35
-
-`down`/`j`: select the previous item.
36
-
-`left`/`h`: select the outer item.
37
-
-`right`/`l`: select the inner item.
38
-
-`space`: toggle the current item.
39
-
-`enter`: toggle the current item and move to the next item of the same kind.
40
-
-`a`: invert the toggled state of each item.
41
-
-`A`: toggle or untoggle all items uniformly.
42
-
-`ctrl-y`: scroll the viewport up by one line.
43
-
-`ctrl-e`: scroll the viewport down by one line.
44
-
-`page-up`/`ctrl-b`: scroll the viewport up by one screen.
45
-
-`page-down`/`ctrl-f`: scroll the viewport up by one screen.
46
-
-`ctrl-u`: move the selection half a screen up from the currently-selected item.
47
-
-`ctrl-d`: move the selection half a screen down from the currently-selected item.
48
-
49
26
# Integration with other projects
50
27
51
28
Here's some projects that don't use `scm-record`, but could benefit from integration with it (with your contribution):
@@ -62,5 +39,4 @@ Here's some projects that don't use `scm-record`, but could benefit from integra
62
39
Here are some features in the UI which are not yet implemented:
63
40
64
41
- Jump to next/previous element of same kind.
65
-
- Menu bar to explain available actions and keybindings.
0 commit comments