diff --git a/src/completion.ts b/src/completion.ts index 79af51bb966..a632b8fc95b 100644 --- a/src/completion.ts +++ b/src/completion.ts @@ -179,6 +179,7 @@ export class Completion implements Disposable { if (this.completing) return let search = await increment.getResumeInput() if (search != null) return await this.resumeCompletion(search) + // no trigger for word character if (latestInsertChar && isWord(latestInsertChar)) return } else if (increment.search && !latestInsertChar) { // restart when user correct search diff --git a/src/diagnostic/buffer.ts b/src/diagnostic/buffer.ts index 074b89b41ac..45102d27294 100644 --- a/src/diagnostic/buffer.ts +++ b/src/diagnostic/buffer.ts @@ -28,13 +28,11 @@ function getNameFromSeverity(severity: DiagnosticSeverity): string { export class DiagnosticBuffer { private signMap: Map = new Map() private srcIdMap: Map> = new Map() - private nvim: Neovim private signId: number private promise: Promise = Promise.resolve(null) public setLocationlist: Function & { clear: () => void } constructor(public readonly bufnr: number, public readonly uri: string, private manager: DiagnosticManager) { - this.nvim = workspace.nvim this.signId = manager.config.signOffset || 1000 this.setLocationlist = debounce(() => { this._setLocationlist().catch(e => { @@ -43,6 +41,10 @@ export class DiagnosticBuffer { }, 200) } + private get nvim(): Neovim { + return workspace.nvim + } + private enableLoclist(): boolean { return this.manager.config.locationlist } diff --git a/src/diagnostic/manager.ts b/src/diagnostic/manager.ts index d07caaacda2..af9afeb7ce6 100644 --- a/src/diagnostic/manager.ts +++ b/src/diagnostic/manager.ts @@ -378,7 +378,7 @@ export class DiagnosticManager { await workspace.echoLines(lines, truncate) } - private diagnosticsAtOffset(offset:number, textDocument:TextDocument):Diagnostic[] { + private diagnosticsAtOffset(offset: number, textDocument: TextDocument): Diagnostic[] { let res: Diagnostic[] = [] let { uri } = textDocument let collections = this.getCollections(uri) diff --git a/src/increment.ts b/src/increment.ts index c26d8f74b59..48f76a5b241 100644 --- a/src/increment.ts +++ b/src/increment.ts @@ -21,7 +21,6 @@ export default class Increment extends Emitter { private _search: string // private lastChange: LastChange | null | undefined private activted = false - private _incrementopt?: string constructor(private nvim: Neovim) { super() @@ -62,7 +61,7 @@ export default class Increment extends Emitter { } this.activted = true this._search = option.input - let opt = this._incrementopt = Increment.getStartOption() + let opt = Increment.getStartOption() nvim.command(`noa set completeopt=${opt}`, true) this.emit('start', Object.assign({}, option)) }