Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(notification): fix async stack and message maybe include \n #117

Merged
merged 2 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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