Removes the text at the current caret position as if the user pressed backspace `count` times.
(t *testing.T, count int)
| 3704 | |
| 3705 | // Removes the text at the current caret position as if the user pressed backspace `count` times. |
| 3706 | func (f *FourslashTest) Backspace(t *testing.T, count int) { |
| 3707 | script := f.getScriptInfo(f.activeFilename) |
| 3708 | offset := int(f.converters.LineAndCharacterToPosition(script, f.currentCaretPosition)) |
| 3709 | f.baselineState(t) |
| 3710 | |
| 3711 | for range count { |
| 3712 | offset-- |
| 3713 | f.editScriptAndUpdateMarkers(t, f.activeFilename, offset, offset+1, "") |
| 3714 | f.currentCaretPosition = f.converters.PositionToLineAndCharacter(script, core.TextPos(offset)) |
| 3715 | // Don't need to examine formatting because there are no formatting changes on backspace. |
| 3716 | } |
| 3717 | |
| 3718 | // f.checkPostEditInvariants() // !!! do we need this? |
| 3719 | } |
| 3720 | |
| 3721 | // DeleteAtCaret removes the text at the current caret position as if the user pressed delete `count` times. |
| 3722 | func (f *FourslashTest) DeleteAtCaret(t *testing.T, count int) { |