mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 06:12:35 +09:00
Move incomplete colorschemes and improve cd
The default colorschemes should ideally use 256 colors instead of just 16 colors. The `simple` colorscheme should cover most 16 color use cases. I went through the colorschemes and put the themes that didn't look good or looked incomplete in an in_progress directory. This commit also improves the `cd` command behavior when using an unnamed buffer.
This commit is contained in:
@@ -235,10 +235,18 @@ func TabSwitch(args []string) {
|
||||
func Cd(args []string) {
|
||||
if len(args) > 0 {
|
||||
path := ReplaceHome(args[0])
|
||||
os.Chdir(path)
|
||||
err := os.Chdir(path)
|
||||
if err != nil {
|
||||
messenger.Error("Error with cd: ", err)
|
||||
return
|
||||
}
|
||||
wd, _ := os.Getwd()
|
||||
for _, tab := range tabs {
|
||||
for _, view := range tab.views {
|
||||
wd, _ := os.Getwd()
|
||||
if len(view.Buf.name) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
view.Buf.Path, _ = MakeRelative(view.Buf.AbsPath, wd)
|
||||
if p, _ := filepath.Abs(view.Buf.Path); !strings.Contains(p, wd) {
|
||||
view.Buf.Path = view.Buf.AbsPath
|
||||
|
||||
Reference in New Issue
Block a user