Skip to content

Commit

Permalink
fix(notification): fix async stack and message maybe include \n
Browse files Browse the repository at this point in the history
  • Loading branch information
iamcco committed Mar 29, 2021
1 parent b7e6956 commit 3af8393
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
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 @@ -63,7 +64,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 3af8393

Please sign in to comment.