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

Method SetFilename

texteditor/buffer.go:252–257  ·  view source on GitHub ↗

SetFilename sets the filename associated with the buffer and updates the code highlighting information accordingly.

(fn string)

Source from the content-addressed store, hash-verified

250// SetFilename sets the filename associated with the buffer and updates
251// the code highlighting information accordingly.
252func (tb *Buffer) SetFilename(fn string) *Buffer {
253 tb.Filename = core.Filename(fn)
254 tb.Stat()
255 tb.SetFileInfo(&tb.Info)
256 return tb
257}
258
259// Stat gets info about the file, including the highlighting language.
260func (tb *Buffer) Stat() error {

Callers 3

OpenFSMethod · 0.95
openFileMethod · 0.95
setFilenamesMethod · 0.45

Calls 3

StatMethod · 0.95
FilenameTypeAlias · 0.92
SetFileInfoMethod · 0.80

Tested by

no test coverage detected