(st, ed lexer.Pos)
| 932 | } |
| 933 | |
| 934 | func (ls *Lines) deleteTextRectImpl(st, ed lexer.Pos) *Edit { |
| 935 | tbe := ls.regionRect(st, ed) |
| 936 | if tbe == nil { |
| 937 | return nil |
| 938 | } |
| 939 | tbe.Delete = true |
| 940 | for ln := st.Ln; ln <= ed.Ln; ln++ { |
| 941 | l := ls.lines[ln] |
| 942 | if len(l) > st.Ch { |
| 943 | if ed.Ch < len(l)-1 { |
| 944 | ls.lines[ln] = append(l[:st.Ch], l[ed.Ch:]...) |
| 945 | } else { |
| 946 | ls.lines[ln] = l[:st.Ch] |
| 947 | } |
| 948 | } |
| 949 | } |
| 950 | ls.linesEdited(tbe) |
| 951 | ls.changed = true |
| 952 | ls.callChangedFunc() |
| 953 | return tbe |
| 954 | } |
| 955 | |
| 956 | // insertText is the primary method for inserting text, |
| 957 | // at given starting position. Sets the timestamp on resulting Edit to now. |
no test coverage detected