Skip to content

Commit

Permalink
chore(all): format code
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Oct 5, 2018
1 parent bd74d02 commit d80e2aa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/diagnostic/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ function getNameFromSeverity(severity: DiagnosticSeverity): string {
export class DiagnosticBuffer {
private signMap: Map<string, number[]> = new Map()
private srcIdMap: Map<string, Set<number>> = new Map()
private nvim: Neovim
private signId: number
private promise: Promise<void | void[]> = 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 => {
Expand All @@ -43,6 +41,10 @@ export class DiagnosticBuffer {
}, 200)
}

private get nvim(): Neovim {
return workspace.nvim
}

private enableLoclist(): boolean {
return this.manager.config.locationlist
}
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostic/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions src/increment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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))
}
Expand Down

0 comments on commit d80e2aa

Please sign in to comment.