You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Force Break Undo Groups When Forcing Grouping (#81)
### Description
Forces the undo manager to start a new undo group after calling `startUndoGrouping` or `endUndoGrouping`.
This fixes a case where two groups could accidentally be combined. For instance when dragging text and then dragging it back into the same spot. Previously that operation would result in the following undo grouping:
After first drag:
```
Group 1:
- {0,8} "" // Removed text
Group 2:
- {0, 0} "DragText" // Inserted text
```
After dragging back to the original location:
```
Group 1:
- {0,8} "" // Removed text
Group 2:
- {0, 0} "DragText" // Inserted text
- {0,8} "" // Removed text
Group 3:
- {0, 0} "DragText" // Inserted text
```
When it *should* have looked like the following after the second drag back to the original position.
```
Group 1:
- {0,8} "" // Removed text
Group 2:
- {0, 0} "DragText" // Inserted text
Group 3:
- {0,8} "" // Removed text
Group 4:
- {0, 0} "DragText" // Inserted text
```
### Related Issues
* N/A
### Checklist
<!--- Add things that are not yet implemented above -->
- [x] I read and understood the [contributing guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md)
- [x] The issues this PR addresses are related to each other
- [x] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] My changes are all related to the related issue above
- [x] I documented my code
### Screenshots
N/A
0 commit comments