Skip to content

Commit

Permalink
fix(notification): fix async stack and message maybe include \n (#117)
Browse files Browse the repository at this point in the history
* fix(notification): fix async stack and message maybe include \n

* fix(notification): updated changelog and version

Co-authored-by: Pieter van Loon <[email protected]>
  • Loading branch information
iamcco and Kavantix authored Mar 29, 2021
1 parent fcb834a commit d4c6f3d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOD.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coc-flutter",
"version": "1.9.1",
"version": "1.9.2",
"description": "flutter support for (Neo)vim",
"author": "iamcco <[email protected]>",
"license": "MIT",
Expand Down
16 changes: 8 additions & 8 deletions src/lib/notification/floatwindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/lib/notification/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { window, workspace } from 'coc.nvim';
import { formatMessage } from '../../util';
import { Dispose } from '../../util/dispose';
import { Message } from './message';

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d4c6f3d

Please sign in to comment.