diff --git a/CHANGELOD.md b/CHANGELOD.md index 9ad32bd..275bf13 100644 --- a/CHANGELOD.md +++ b/CHANGELOD.md @@ -3,6 +3,7 @@ - The FlutterDevices list now has new actions and also a new default. It will now use the `workspaceState` as the default location to store the selected device. If you want the previous behavior then you can change the `flutter.devicesDefaultAction` config to `workspaceConfig`. +- Fixed #116 where `resumeNotification` was not called within the same tick when showing a floating notification. # 1.9.1 diff --git a/package.json b/package.json index 7bfcd26..61c4a77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coc-flutter", - "version": "1.9.1", + "version": "1.9.2", "description": "flutter support for (Neo)vim", "author": "iamcco ", "license": "MIT", diff --git a/src/lib/notification/floatwindow.ts b/src/lib/notification/floatwindow.ts index 4e6c889..83ef4c4 100644 --- a/src/lib/notification/floatwindow.ts +++ b/src/lib/notification/floatwindow.ts @@ -42,14 +42,14 @@ export class FloatWindow extends Dispose { this.win = win; nvim.pauseNotification(); - await win.setOption('number', false); - await win.setOption('wrap', true); - await win.setOption('relativenumber', false); - await win.setOption('cursorline', false); - await win.setOption('cursorcolumn', false); - await win.setOption('conceallevel', 2); - await win.setOption('signcolumn', 'no'); - await win.setOption('winhighlight', 'FoldColumn:NormalFloat'); + win.setOption('number', false); + win.setOption('wrap', true); + win.setOption('relativenumber', false); + win.setOption('cursorline', false); + win.setOption('cursorcolumn', false); + win.setOption('conceallevel', 2); + win.setOption('signcolumn', 'no'); + win.setOption('winhighlight', 'FoldColumn:NormalFloat'); await nvim.resumeNotification(); try { // vim and neovim < 0.5.0 foldcolumn is number diff --git a/src/lib/notification/index.ts b/src/lib/notification/index.ts index 1d54660..38cae70 100644 --- a/src/lib/notification/index.ts +++ b/src/lib/notification/index.ts @@ -1,4 +1,5 @@ import { window, workspace } from 'coc.nvim'; +import { formatMessage } from '../../util'; import { Dispose } from '../../util/dispose'; import { Message } from './message'; @@ -64,7 +65,7 @@ class Notification extends Dispose { } show(message: string | string[], showTime: number = messageDefaultShowTime) { - const messages = ([] as string[]).concat(message); + const messages = typeof message === 'string' ? formatMessage(message) : message; if (messages.length === 0) { return; }