Fossil SCM

Shortcut SHIFT+H to scroll to the focused entry without moving focus. This may be handy in conjunction with scrolling by arrow keys or PgUp/Dn.

florian 2022-08-07 08:09 timeline-keyboard-navigation
Commit 8d1edb82061eb09e4fcbdc2fb13b78cf96478db814f2e7c881023d6cb4fce5f9
2 files changed +8 -1 +1
+8 -1
--- src/graph.js
+++ src/graph.js
@@ -956,10 +956,11 @@
956956
kFRST = mSHIFT | 78 /* SHIFT+N */,
957957
kNEXT = 78 /* N */,
958958
kPREV = 77 /* M */,
959959
kLAST = mSHIFT | 77 /* SHIFT+M */,
960960
kCYCL = 72 /* H */,
961
+ kSCRL = mSHIFT | 72 /* H */,
961962
kTICK = 188 /* , */,
962963
kUNTK = mSHIFT | 188 /* , */,
963964
kCPYH = 66 /* B */,
964965
kCPYB = mSHIFT | 66 /* SHIFT+B */,
965966
kTMLN = 74 /* J */,
@@ -973,10 +974,11 @@
973974
case kFRST: dx = -2; break;
974975
case kNEXT: dx = -1; break;
975976
case kPREV: dx = +1; break;
976977
case kLAST: dx = +2; break;
977978
case kCYCL:
979
+ case kSCRL:
978980
case kTICK:
979981
case kUNTK:
980982
case kCPYH:
981983
case kCPYB:
982984
case kTMLN:
@@ -983,11 +985,16 @@
983985
case kTMLB:
984986
case kVIEW:
985987
case kDONE: break;
986988
default: return;
987989
}
988
- if( key==kUNTK ){
990
+ if( key==kSCRL ){
991
+ var td = document.querySelector('.timelineFocused');
992
+ if( td ) focusScrollToIntoViewTheFossilWay(td);
993
+ return;
994
+ }
995
+ else if( key==kUNTK ){
989996
var tid = focusTickedId();
990997
if( tid ){
991998
var gn = document.getElementById('tln'+tid.slice(1));
992999
if( gn ) gn.click();
9931000
}
9941001
--- src/graph.js
+++ src/graph.js
@@ -956,10 +956,11 @@
956 kFRST = mSHIFT | 78 /* SHIFT+N */,
957 kNEXT = 78 /* N */,
958 kPREV = 77 /* M */,
959 kLAST = mSHIFT | 77 /* SHIFT+M */,
960 kCYCL = 72 /* H */,
 
961 kTICK = 188 /* , */,
962 kUNTK = mSHIFT | 188 /* , */,
963 kCPYH = 66 /* B */,
964 kCPYB = mSHIFT | 66 /* SHIFT+B */,
965 kTMLN = 74 /* J */,
@@ -973,10 +974,11 @@
973 case kFRST: dx = -2; break;
974 case kNEXT: dx = -1; break;
975 case kPREV: dx = +1; break;
976 case kLAST: dx = +2; break;
977 case kCYCL:
 
978 case kTICK:
979 case kUNTK:
980 case kCPYH:
981 case kCPYB:
982 case kTMLN:
@@ -983,11 +985,16 @@
983 case kTMLB:
984 case kVIEW:
985 case kDONE: break;
986 default: return;
987 }
988 if( key==kUNTK ){
 
 
 
 
 
989 var tid = focusTickedId();
990 if( tid ){
991 var gn = document.getElementById('tln'+tid.slice(1));
992 if( gn ) gn.click();
993 }
994
--- src/graph.js
+++ src/graph.js
@@ -956,10 +956,11 @@
956 kFRST = mSHIFT | 78 /* SHIFT+N */,
957 kNEXT = 78 /* N */,
958 kPREV = 77 /* M */,
959 kLAST = mSHIFT | 77 /* SHIFT+M */,
960 kCYCL = 72 /* H */,
961 kSCRL = mSHIFT | 72 /* H */,
962 kTICK = 188 /* , */,
963 kUNTK = mSHIFT | 188 /* , */,
964 kCPYH = 66 /* B */,
965 kCPYB = mSHIFT | 66 /* SHIFT+B */,
966 kTMLN = 74 /* J */,
@@ -973,10 +974,11 @@
974 case kFRST: dx = -2; break;
975 case kNEXT: dx = -1; break;
976 case kPREV: dx = +1; break;
977 case kLAST: dx = +2; break;
978 case kCYCL:
979 case kSCRL:
980 case kTICK:
981 case kUNTK:
982 case kCPYH:
983 case kCPYB:
984 case kTMLN:
@@ -983,11 +985,16 @@
985 case kTMLB:
986 case kVIEW:
987 case kDONE: break;
988 default: return;
989 }
990 if( key==kSCRL ){
991 var td = document.querySelector('.timelineFocused');
992 if( td ) focusScrollToIntoViewTheFossilWay(td);
993 return;
994 }
995 else if( key==kUNTK ){
996 var tid = focusTickedId();
997 if( tid ){
998 var gn = document.getElementById('tln'+tid.slice(1));
999 if( gn ) gn.click();
1000 }
1001
--- src/timeline.c
+++ src/timeline.c
@@ -1635,10 +1635,11 @@
16351635
** N Focus first (newest) entry.
16361636
** n Focus next (newer) entry, or open next page.
16371637
** m Focus previous (older) entry, or open previous page.
16381638
** M Focus last (oldest) entry.
16391639
** h Move focus between selected, current (check-out) and ticked entries.
1640
+** H Scroll to focused entry.
16401641
** , Tick/untick the node of the focused entry.
16411642
** ; Untick the nodes of all entries.
16421643
** b Copy the commit hash of the focused entry to clipboard.
16431644
** B Copy the branch name of the focused entry to clipboard.
16441645
** j View timeline of focused entry.
16451646
--- src/timeline.c
+++ src/timeline.c
@@ -1635,10 +1635,11 @@
1635 ** N Focus first (newest) entry.
1636 ** n Focus next (newer) entry, or open next page.
1637 ** m Focus previous (older) entry, or open previous page.
1638 ** M Focus last (oldest) entry.
1639 ** h Move focus between selected, current (check-out) and ticked entries.
 
1640 ** , Tick/untick the node of the focused entry.
1641 ** ; Untick the nodes of all entries.
1642 ** b Copy the commit hash of the focused entry to clipboard.
1643 ** B Copy the branch name of the focused entry to clipboard.
1644 ** j View timeline of focused entry.
1645
--- src/timeline.c
+++ src/timeline.c
@@ -1635,10 +1635,11 @@
1635 ** N Focus first (newest) entry.
1636 ** n Focus next (newer) entry, or open next page.
1637 ** m Focus previous (older) entry, or open previous page.
1638 ** M Focus last (oldest) entry.
1639 ** h Move focus between selected, current (check-out) and ticked entries.
1640 ** H Scroll to focused entry.
1641 ** , Tick/untick the node of the focused entry.
1642 ** ; Untick the nodes of all entries.
1643 ** b Copy the commit hash of the focused entry to clipboard.
1644 ** B Copy the branch name of the focused entry to clipboard.
1645 ** j View timeline of focused entry.
1646

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button