Skip to content

Commit

Permalink
fix: error at modify empty list;
Browse files Browse the repository at this point in the history
  • Loading branch information
MapoMagpie committed Feb 10, 2024
1 parent 019ffc6 commit eaa26f8
Show file tree
Hide file tree
Showing 47 changed files with 128,107 additions and 128,100 deletions.
Empty file modified .assets/rimedm_修改.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified .assets/rimedm_修改.mkv
100644 → 100755
Empty file.
Empty file modified .assets/rimedm_删词.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified .assets/rimedm_删词.mkv
100644 → 100755
Empty file.
Empty file modified .assets/rimedm_加词.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified .assets/rimedm_加词.mkv
100644 → 100755
Empty file.
Empty file modified .github/workflows/test.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .goreleaser.yaml
100644 → 100755
Empty file.
Empty file modified CHANGELOG.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified config/config.yaml
100644 → 100755
Empty file.
10 changes: 7 additions & 3 deletions core/core.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ func Start(opts *Options) {
menuNameDelete := tui.Menu{Name: "Delete", Cb: func(m *tui.Model) (cmd tea.Cmd) {
item, err := m.CurrItem()
if err != nil {
return
m.Inputs = []string{}
m.InputCursor = 0
return tui.ExitMenuCmd
}
switch item := item.(type) {
case *dict.MatchResult:
Expand All @@ -84,11 +86,13 @@ func Start(opts *Options) {
// 修改菜单
var modifyingItem tui.ItemRender
menuNameModify := tui.Menu{Name: "Modify", Cb: func(m *tui.Model) (cmd tea.Cmd) {
m.Modifying = true
item, err := m.CurrItem()
if err != nil {
return
m.Inputs = []string{}
m.InputCursor = 0
return tui.ExitMenuCmd
}
m.Modifying = true
modifyingItem = item
m.Inputs = strings.Split(strings.TrimSpace(modifyingItem.String()), "")
m.InputCursor = len(m.Inputs)
Expand Down
Empty file modified core/options.go
100644 → 100755
Empty file.
Empty file modified core/options_test.go
100644 → 100755
Empty file.
Empty file modified dict/dictionary.go
100644 → 100755
Empty file.
Empty file modified dict/dictionary_test.go
100644 → 100755
Empty file.
Empty file modified dict/loader.go
100644 → 100755
Empty file.
Empty file modified dict/loader_test.go
100644 → 100755
Empty file.
Empty file modified dict/matcher.go
100644 → 100755
Empty file.
Empty file modified dict/output.go
100644 → 100755
Empty file.
Empty file modified dict/output_test.go
100644 → 100755
Empty file.
Empty file modified go.mod
100644 → 100755
Empty file.
Empty file modified go.sum
100644 → 100755
Empty file.
Empty file modified install.ps1
100644 → 100755
Empty file.
Empty file modified main.go
100644 → 100755
Empty file.
Empty file modified rime/default.custom.yaml
100644 → 100755
Empty file.
Empty file modified rime/xhup/flypy_full全码字.txt
100644 → 100755
Empty file.
Empty file modified rime/xhup/flypy_sys.txt
100644 → 100755
Empty file.
Empty file modified rime/xhup/flypy_top.txt
100644 → 100755
Empty file.
Empty file modified rime/xhup/flypy_user.txt
100644 → 100755
Empty file.
Empty file modified rime/xkjd/xkjd6.buchong.dict.yaml
100644 → 100755
Empty file.
Empty file modified rime/xkjd/xkjd6.chaojizici.dict.yaml
100644 → 100755
Empty file.
Loading

0 comments on commit eaa26f8

Please sign in to comment.