From beb3482c661f90bdb1c9d8036a1f2c0891b6add8 Mon Sep 17 00:00:00 2001 From: shaoying Date: Tue, 20 Oct 2020 09:59:11 +0800 Subject: [PATCH] opt inner --- core/code/go.go | 6 +++--- core/code/inner.go | 3 +++ core/code/vimer.go | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/code/go.go b/core/code/go.go index cf0341f9..e3776ae5 100644 --- a/core/code/go.go +++ b/core/code/go.go @@ -27,7 +27,7 @@ func _go_tags(m *ice.Message, key string) { ls := strings.Split(key, ".") key = ls[len(ls)-1] - if _, e := os.Stat(path.Join(m.Option("_path"), ".tags")); e != nil { + if _, e := os.Stat(path.Join(m.Option(cli.CMD_DIR), ".tags")); e != nil { m.Cmd(cli.SYSTEM, "gotags", "-R", "-f", ".tags", "./") } for _, l := range strings.Split(m.Cmdx(cli.SYSTEM, "grep", "^"+key+"\\>", ".tags"), "\n") { @@ -42,7 +42,7 @@ func _go_tags(m *ice.Message, key string) { text := strings.TrimSuffix(strings.TrimPrefix(ls[0], "/^"), "$/") line := kit.Int(text) - p := path.Join(m.Option("_path"), file) + p := path.Join(m.Option(cli.CMD_DIR), file) f, e := os.Open(p) m.Assert(e) bio := bufio.NewScanner(f) @@ -130,7 +130,7 @@ func init() { if arg[0] == kit.MDB_FOREACH { return } - m.Option(cli.CMD_DIR, m.Option("_path")) + m.Option(cli.CMD_DIR, kit.Select("src", arg, 2)) _go_find(m, kit.Select("main", arg, 1)) _go_tags(m, kit.Select("main", arg, 1)) _go_help(m, kit.Select("main", arg, 1)) diff --git a/core/code/inner.go b/core/code/inner.go index c9b01252..7f9313cc 100644 --- a/core/code/inner.go +++ b/core/code/inner.go @@ -80,6 +80,9 @@ func init() { FAVOR: {Name: "favor", Help: "收藏", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(FAVOR, mdb.INSERT, arg) }}, + nfs.DIR: {Name: "dir", Help: "目录", Hand: func(m *ice.Message, arg ...string) { + m.Cmdy(nfs.DIR, arg) + }}, }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { if len(arg) < 2 { m.Cmdy(nfs.DIR, kit.Select("./", arg, 0)) diff --git a/core/code/vimer.go b/core/code/vimer.go index 5c4f74e5..ae6090f2 100644 --- a/core/code/vimer.go +++ b/core/code/vimer.go @@ -28,9 +28,9 @@ func init() { Index.Merge(&ice.Context{ Configs: map[string]*ice.Config{}, Commands: map[string]*ice.Command{ - VIMER: {Name: "vimer path=usr/demo file=hi.sh line=1 刷新:button=auto save project", Help: "编辑器", Meta: kit.Dict( + VIMER: {Name: "vimer path=usr/demo file=hi.sh line=1 刷新:button=auto save project search", Help: "编辑器", Meta: kit.Dict( "display", "/plugin/local/code/vimer.js", "style", "editor", - "trans", kit.Dict("project", "项目"), + "trans", kit.Dict("project", "项目", "search", "搜索"), ), Action: map[string]*ice.Action{ web.UPLOAD: {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) { _vimer_upload(m, m.Option(kit.MDB_PATH))