func (v *View) indentLine(line buffer.Cursor) { line.Boffset = 0 v.buf.Insert(line, []byte{'\t'}) if v.cursor.Line == line.Line { cursor := v.cursor cursor.Boffset += 1 v.MoveCursorTo(cursor) } }
func (v *View) deindentLine(line buffer.Cursor) { line.Boffset = 0 if r, _ := line.RuneUnder(); r == '\t' { v.buf.Delete(line, 1) } if v.cursor.Line == line.Line && v.cursor.Boffset > 0 { cursor := v.cursor cursor.Boffset -= 1 v.MoveCursorTo(cursor) } }