mirror of
https://github.com/laurent22/joplin.git
synced 2025-02-04 19:16:07 +02:00
Fixed cursor problem
This commit is contained in:
parent
6384fe3b7d
commit
b98e0b945f
@ -30,6 +30,10 @@ class AppGui {
|
||||
this.rootWidget_ = this.buildUi();
|
||||
this.renderer_ = new Renderer(this.term(), this.rootWidget_);
|
||||
|
||||
this.renderer_.on('renderDone', async (event) => {
|
||||
if (this.widget('console').hasFocus()) this.widget('console').resetCursor();
|
||||
});
|
||||
|
||||
this.app_.on('modelAction', async (event) => {
|
||||
await this.handleModelAction(event.action);
|
||||
});
|
||||
@ -53,6 +57,7 @@ class AppGui {
|
||||
folderList.setVStretch(true);
|
||||
folderList.on('currentItemChange', async () => {
|
||||
const folder = folderList.currentItem();
|
||||
this.app().switchCurrentFolder(folder);
|
||||
await this.updateNoteList(folder ? folder.id : null);
|
||||
});
|
||||
|
||||
@ -160,6 +165,8 @@ class AppGui {
|
||||
}
|
||||
|
||||
async handleModelAction(action) {
|
||||
this.logger().info('Action:', action);
|
||||
|
||||
let state = Object.assign({}, defaultState);
|
||||
state.notes = this.widget('noteList').items();
|
||||
|
||||
|
@ -44,14 +44,9 @@ class Command extends BaseCommand {
|
||||
if (!notes.length) throw new Error(_('Cannot find "%s".', pattern));
|
||||
|
||||
const ok = force ? true : await this.prompt(_('%d notes match this pattern. Delete them?', notes.length));
|
||||
|
||||
|
||||
reg.logger().info('OK', ok);
|
||||
|
||||
// const ok = force ? true : await cliUtils.promptConfirm(_('%d notes match this pattern. Delete them?', notes.length));
|
||||
// if (!ok) return;
|
||||
// let ids = notes.map((n) => n.id);
|
||||
// await Note.batchDelete(ids);
|
||||
if (!ok) return;
|
||||
let ids = notes.map((n) => n.id);
|
||||
await Note.batchDelete(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user