mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
Autocomplete for any non-whitespace
This commit is contained in:
@@ -246,14 +246,14 @@ func LSPComplete(b *Buffer) []Completion {
|
|||||||
Start: toLoc(item.TextEdit.Range.Start),
|
Start: toLoc(item.TextEdit.Range.Start),
|
||||||
End: toLoc(item.TextEdit.Range.End),
|
End: toLoc(item.TextEdit.Range.End),
|
||||||
}}
|
}}
|
||||||
for _, e := range item.AdditionalTextEdits {
|
// for _, e := range item.AdditionalTextEdits {
|
||||||
d := Delta{
|
// d := Delta{
|
||||||
Text: []byte(e.NewText),
|
// Text: []byte(e.NewText),
|
||||||
Start: toLoc(e.Range.Start),
|
// Start: toLoc(e.Range.Start),
|
||||||
End: toLoc(e.Range.End),
|
// End: toLoc(e.Range.End),
|
||||||
}
|
// }
|
||||||
completions[i].Edits = append(completions[i].Edits, d)
|
// completions[i].Edits = append(completions[i].Edits, d)
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
var t string
|
var t string
|
||||||
if len(item.InsertText) > 0 {
|
if len(item.InsertText) > 0 {
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ func IsNonAlphaNumeric(c rune) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsAutocomplete(c rune) bool {
|
func IsAutocomplete(c rune) bool {
|
||||||
return c == '.' || !IsNonAlphaNumeric(c)
|
return !unicode.IsSpace(c) || !IsNonAlphaNumeric(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseSpecial(s string) string {
|
func ParseSpecial(s string) string {
|
||||||
|
|||||||
Reference in New Issue
Block a user