CdCmd changes the current working directory
(args []string)
| 243 | |
| 244 | // CdCmd changes the current working directory |
| 245 | func (h *BufPane) CdCmd(args []string) { |
| 246 | if len(args) > 0 { |
| 247 | path, err := util.ReplaceHome(args[0]) |
| 248 | if err != nil { |
| 249 | InfoBar.Error(err) |
| 250 | return |
| 251 | } |
| 252 | err = os.Chdir(path) |
| 253 | if err != nil { |
| 254 | InfoBar.Error(err) |
| 255 | return |
| 256 | } |
| 257 | wd, _ := os.Getwd() |
| 258 | for _, b := range buffer.OpenBuffers { |
| 259 | if len(b.Path) > 0 { |
| 260 | b.Path, _ = util.MakeRelative(b.AbsPath, wd) |
| 261 | if p, _ := filepath.Abs(b.Path); !strings.Contains(p, wd) { |
| 262 | b.Path = b.AbsPath |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | // MemUsageCmd prints micro's memory usage |
| 270 | // Alloc shows how many bytes are currently in use |
nothing calls this directly
no test coverage detected