MCPcopy Create free account
hub / github.com/cogentcore/core / OpenUser

Method OpenUser

spell/spell.go:70–84  ·  view source on GitHub ↗

OpenUser opens user dictionary of words

()

Source from the content-addressed store, hash-verified

68
69// OpenUser opens user dictionary of words
70func (sp *SpellData) OpenUser() error {
71 sp.mu.Lock()
72 defer sp.mu.Unlock()
73 d, err := OpenDict(sp.UserFile)
74 if err != nil {
75 // slog.Error(err.Error())
76 sp.model.UserDict = make(Dict)
77 return err
78 }
79 // note: does not have suggestions for new words
80 // future impl will not precompile suggs so it is not worth it
81 sp.openTime, err = modTime(sp.UserFile)
82 sp.model.UserDict = d
83 return err
84}
85
86// OpenUserCheck checks if the current user dict file has been modified
87// since last open time and re-opens it if so.

Callers 2

NewSpellFunction · 0.95
OpenUserCheckMethod · 0.95

Calls 4

OpenDictFunction · 0.85
modTimeFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected