Add guard clause to insertMarkdownText
What does this MR do and why?
This MR adds a performance improvement and resiliency to insertMarkdownText
. We can short circuit and return early if we don't actually have anything to insert (this happens in the attach-file
toolbar button is pressed).
Screenshots or screen recordings
This bug is also being fixed in !145034 (merged), but this bit of code also fixes it:
Before | After |
---|---|
bug_attach_file_delete | fix_attach_file_delete |
The following screenshots show that existing behavior still works:
List continuation | Source markdown editor | Comment markdown editor |
---|---|---|
![]() |
![]() |
![]() |
How to set up and validate locally
If !145034 (merged) is not merged yet:
- Start GDK.
- In an issue comment click the "Attach file" button.
- The cursor should not move.
Otherwise:
- Start GDK
- Use the markdown editor in an issue comment to ensure that the toolbar buttons still work as expected.
- Use the source code markdown editor to update a
README.md
file. Ensure that the toolbar buttons still work as expected.
Thanks
Thanks to @leipert and @john-slaughter for pairing with me here
Edited by Paul Slaughter