Skip to content

Commit

Permalink
Merge pull request #672 from noborus/fix-bsContent-check
Browse files Browse the repository at this point in the history
Enhance the length check of Contents
  • Loading branch information
noborus authored Dec 25, 2024
2 parents 8368efc + 276a5b9 commit a69b4a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oviewer/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ func (st *parseState) backspaceHandle() {
st.bsFlag = true
st.bsContent = st.lc.last()

if st.bsContent.width == 1 {
st.lc = st.lc[:len(st.lc)-1]
if st.bsContent.width == 2 && len(st.lc) > 1 {
st.lc = st.lc[:len(st.lc)-2]
return
}
st.lc = st.lc[:len(st.lc)-2]
st.lc = st.lc[:len(st.lc)-1]
}

// controlCharHandle handles control characters.
Expand Down

0 comments on commit a69b4a6

Please sign in to comment.