mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-18 06:47:14 +09:00
Run notifications in background to hide latency
This commit is contained in:
@@ -227,7 +227,7 @@ func LSPComplete(b *Buffer) ([]string, []string) {
|
||||
|
||||
for i, item := range items {
|
||||
suggestions[i] = item.Label
|
||||
if len(item.TextEdit.NewText) > 0 {
|
||||
if item.TextEdit != nil && len(item.TextEdit.NewText) > 0 {
|
||||
completions[i] = util.SliceEndStr(item.TextEdit.NewText, c.X-argstart)
|
||||
} else if len(item.InsertText) > 0 {
|
||||
completions[i] = util.SliceEndStr(item.InsertText, c.X-argstart)
|
||||
|
||||
@@ -443,6 +443,8 @@ func (b *Buffer) Fini() {
|
||||
if b.Type == BTStdout {
|
||||
fmt.Fprint(util.Stdout, string(b.Bytes()))
|
||||
}
|
||||
|
||||
b.server.DidClose(b.AbsPath)
|
||||
}
|
||||
|
||||
// GetName returns the name that should be displayed in the statusline
|
||||
|
||||
@@ -195,5 +195,8 @@ func (b *Buffer) saveToFile(filename string, withSudo bool) error {
|
||||
b.AbsPath = absPath
|
||||
b.isModified = false
|
||||
b.UpdateRules()
|
||||
|
||||
b.server.DidSave(b.AbsPath)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user