buffer: Fix broken auto indent when pasting code starting with new line (#28134)
Smit Barmase
created
Closes #26907
Currently, in case of new line to find delta, it is comparing old first
line indent with new second line indent. This results into incorrect
indentation. This PR fixes this delta calculation by passing correct
second line indent in that particular case.
- [X] Add Test
Before:
https://github.com/user-attachments/assets/065deba0-be19-4643-a784-d248a8e7c891
After:
https://github.com/user-attachments/assets/a0037043-4bd8-460f-b8ba-b7da7bdbe1ea
Release Notes:
- Fixed issue where pasting code starting with new line resulted
incorrect auto indent.