aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-04-14 21:05:53 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2021-04-14 23:02:52 +0900
commit09ec6d49435d855f0b2e51c71ff7cedb059ecb86 (patch)
treee385785f9b9346e67f5ad51d66b9395226643dd2 /src
parent7293efa90edd927e5a310343401999310bf7dbc7 (diff)
Show an error on mark not set
Diffstat (limited to 'src')
-rw-r--r--src/content/usecases/MarkUseCase.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/content/usecases/MarkUseCase.ts b/src/content/usecases/MarkUseCase.ts
index 002fdee..f5f512c 100644
--- a/src/content/usecases/MarkUseCase.ts
+++ b/src/content/usecases/MarkUseCase.ts
@@ -18,7 +18,7 @@ export default class MarkUseCase {
async set(key: string): Promise<void> {
const pos = this.scrollPresenter.getScroll();
if (this.globalKey(key)) {
- this.client.setGloablMark(key, pos);
+ await this.client.setGloablMark(key, pos);
await this.consoleClient.info(`Set global mark to '${key}'`);
} else {
this.repository.set(key, pos);
@@ -32,7 +32,8 @@ export default class MarkUseCase {
} else {
const pos = this.repository.get(key);
if (!pos) {
- throw new Error("Mark is not set");
+ await this.consoleClient.error("Mark is not set");
+ return;
}
this.scroll(pos.x, pos.y);
}