1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-02-07 19:30:04 +02:00

Fixed cursor problem

This commit is contained in:
Laurent Cozic 2017-10-07 19:05:35 +01:00
parent 6384fe3b7d
commit b98e0b945f
2 changed files with 10 additions and 8 deletions

View File

@ -30,6 +30,10 @@ class AppGui {
this.rootWidget_ = this.buildUi(); this.rootWidget_ = this.buildUi();
this.renderer_ = new Renderer(this.term(), this.rootWidget_); 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) => { this.app_.on('modelAction', async (event) => {
await this.handleModelAction(event.action); await this.handleModelAction(event.action);
}); });
@ -53,6 +57,7 @@ class AppGui {
folderList.setVStretch(true); folderList.setVStretch(true);
folderList.on('currentItemChange', async () => { folderList.on('currentItemChange', async () => {
const folder = folderList.currentItem(); const folder = folderList.currentItem();
this.app().switchCurrentFolder(folder);
await this.updateNoteList(folder ? folder.id : null); await this.updateNoteList(folder ? folder.id : null);
}); });
@ -160,6 +165,8 @@ class AppGui {
} }
async handleModelAction(action) { async handleModelAction(action) {
this.logger().info('Action:', action);
let state = Object.assign({}, defaultState); let state = Object.assign({}, defaultState);
state.notes = this.widget('noteList').items(); state.notes = this.widget('noteList').items();

View File

@ -44,14 +44,9 @@ class Command extends BaseCommand {
if (!notes.length) throw new Error(_('Cannot find "%s".', pattern)); 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)); const ok = force ? true : await this.prompt(_('%d notes match this pattern. Delete them?', notes.length));
if (!ok) return;
let ids = notes.map((n) => n.id);
reg.logger().info('OK', ok); await Note.batchDelete(ids);
// 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);
} }
} }