Support global marks which select a tab

This commit is contained in:
Shin'ya Ueoka 2018-10-12 10:14:33 +09:00
parent 6e6e306275
commit 003742ec51
11 changed files with 179 additions and 4 deletions

View file

@ -30,8 +30,10 @@ export default class MarkComponent {
if (key.ctrlKey || key.metaKey || key.altKey) {
consoleFrames.postError(window.document, 'Unknown mark');
} else if (key.shiftKey) {
consoleFrames.postError(window.document, 'Globa marks not supported');
} else if (key.shiftKey && markStage.setMode) {
this.doSetGlobal(key);
} else if (key.shiftKey && markStage.jumpMode) {
this.doJumpGlobal(key);
} else if (markStage.setMode) {
this.doSet(key);
} else if (markStage.jumpMode) {
@ -56,4 +58,13 @@ export default class MarkComponent {
let { x, y } = marks[key.key];
scrolls.scrollTo(x, y, smoothscroll);
}
doSetGlobal(key) {
let { x, y } = scrolls.getScroll();
this.store.dispatch(markActions.setGlobal(key.key, x, y));
}
doJumpGlobal(key) {
this.store.dispatch(markActions.jumpGlobal(key.key));
}
}