mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 22:07:09 +09:00
Small fixes
This commit is contained in:
@@ -57,7 +57,9 @@ func (b *Buffer) CycleAutocomplete(forward bool) {
|
||||
}
|
||||
|
||||
b.Replace(start, end, b.Completions[b.CurSuggestion])
|
||||
b.HasSuggestions = true
|
||||
if len(b.Suggestions) > 1 {
|
||||
b.HasSuggestions = true
|
||||
}
|
||||
}
|
||||
|
||||
func GetArg(b *Buffer) (string, int) {
|
||||
|
||||
@@ -134,8 +134,8 @@ func NewBufferFromFile(path string, btype BufType) (*Buffer, error) {
|
||||
|
||||
defer file.Close()
|
||||
|
||||
cursorLoc, err := ParseCursorLocation(cursorPos)
|
||||
if err != nil {
|
||||
cursorLoc, cursorerr := ParseCursorLocation(cursorPos)
|
||||
if cursorerr != nil {
|
||||
cursorLoc = Loc{-1, -1}
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ func (b *Buffer) UpdateRules() {
|
||||
}
|
||||
|
||||
ft := b.Settings["filetype"].(string)
|
||||
if (ft == "Unknown" || ft == "") && !rehighlight {
|
||||
if (ft == "unknown" || ft == "") && !rehighlight {
|
||||
if highlight.MatchFiletype(ftdetect, b.Path, b.lines[0].data) {
|
||||
header := new(highlight.Header)
|
||||
header.FileType = file.FileType
|
||||
|
||||
@@ -197,7 +197,7 @@ func DefaultGlobalSettings() map[string]interface{} {
|
||||
// Note that filetype is a local only option
|
||||
func DefaultLocalSettings() map[string]interface{} {
|
||||
common := DefaultCommonSettings()
|
||||
common["filetype"] = "Unknown"
|
||||
common["filetype"] = "unknown"
|
||||
return common
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user