Skip to content
Myr

Prevent index out of range error

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #2293

authored by Junegunn Choi · committed by Junegunn Choi · parent ab3937e · Browse files · 1 file+5 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−3 removed

  • other:+5 added−3 removed

1 file+5 added−3 removed

modified:src/terminal.go+5 added-3 removed
2128 unmodified lines
2129 req(reqPrompt, reqList, reqInfo, reqHeader)2130 }2131 }2132 toggle := func() bool {2133 if t.cy < t.merger.Length() && t.toggleItem(t.merger.Get(t.cy).item) {2133 current := t.currentItem()2134 if current != nil && t.toggleItem(current) {2135 req(reqInfo)2136 return true2137 }2138 return false
102 unmodified lines
2241 refreshPreview(a.a)2242 case actRefreshPreview:2243 refreshPreview(t.previewOpts.command)2244 case actReplaceQuery:2244 if t.cy >= 0 && t.cy < t.merger.Length() {2245 t.input = t.merger.Get(t.cy).item.text.ToRunes()2245 current := t.currentItem()2246 if current != nil {2247 t.input = current.text.ToRunes()2248 t.cx = len(t.input)2249 }2250 case actAbort:2251 req(reqQuit)
384 unmodified lines