✨ Improved Formatting functionality #85
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed executing any of the formatting options on a blank selection.
Original Behavior: Injected prefix, and suffix, and selected the prefix and suffix (with nothing in the middle!)
Expected/New Behavior: Injects prefix and suffix before and after your mouse cursor.
Fixed focus after formatting
Original Behavior: Whenever any of the format buttons are pressed, the formatting is finished, but the focus is transferred onto the format button.
Expected/New Behavior: Whenever any of the format buttons are pressed, the formatting is finished, focus should be restored to the textbox. When the selection is empty, the cursor is simply moved between prefix and suffix. When selection is not empty, the formatted section is still selected, but also focused, as per standard text editors.
This PR fixes the issue presented in #83, as well as some additional things that I felt were related.