Skip to content

Commit

Permalink
fixed backescape the first word in buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Vorobyov committed Nov 6, 2018
1 parent 2972be2 commit 16c12bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runebuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ func (r *RuneBuffer) BackEscapeWord() {
if r.idx == 0 {
return
}
for i := r.idx - 1; i > 0; i-- {
if !IsWordBreak(r.buf[i]) && IsWordBreak(r.buf[i-1]) {
for i := r.idx - 1; i >= 0; i-- {
if !IsWordBreak(r.buf[i]) && (i == 0 || IsWordBreak(r.buf[i-1])) {
r.pushKill(r.buf[i:r.idx])
r.buf = append(r.buf[:i], r.buf[r.idx:]...)
r.idx = i
Expand Down

0 comments on commit 16c12bf

Please sign in to comment.