mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-18 14:57:18 +09:00
LSP option and better LSP status
This commit is contained in:
@@ -401,7 +401,7 @@ func NewBuffer(r io.Reader, size int64, path string, startcursor Loc, btype BufT
|
||||
OpenBuffers = append(OpenBuffers, b)
|
||||
|
||||
if !found {
|
||||
if btype == BTDefault {
|
||||
if btype == BTDefault && b.Settings["lsp"].(bool) {
|
||||
b.lspInit()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,12 @@ func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error {
|
||||
b.isModified = true
|
||||
} else if option == "readonly" && b.Type.Kind == BTDefault.Kind {
|
||||
b.Type.Readonly = nativeValue.(bool)
|
||||
} else if option == "lsp" && b.Type.Kind == BTDefault.Kind {
|
||||
if nativeValue.(bool) && !b.HasLSP() {
|
||||
b.lspInit()
|
||||
} else if b.HasLSP() {
|
||||
b.Server.Shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user