koxudaxi / ruff-pycharm-plugin

PyCharm plugin for ruff. This plugin provides reformat code using ruff.
MIT License
196 stars 9 forks source link

Breakpoints are removed and the caret is moved #312

Closed lyphrowny closed 7 months ago

lyphrowny commented 9 months ago

Describe the bug Breakpoints are removed when using Reformat Code with checked "Run ruff when Reformat Code". The caret jumps one position to the right. The the caret is at the beginning of the line such a jump causes the editor's view to move down

To Reproduce Steps to reproduce the behavior:

  1. Download MRE main.txt
  2. Create new project with ruff plugin enabled, my settings: image
  3. Rename main.txt to main.py and place it into the created project
  4. Set breakpoint on line 82 (return 1, res)
  5. Place caret at the beginning of the line 82 (any other place on line 82 will just move the caret one position to the right, the editor's view will not be moved)
  6. Reformat Code
  7. See the caret jumped to the end of the line 81, the editor's view shifted (the top shown line was 62, became 61), the breakpoint was removed

Expected behavior I expect the breakpoints remain set, the caret is not moved and the editor's view is not moved

Screenshots Before Reformat Code

image

After Reformat Code

image

Environments (please complete the following information):

Additional context Not all breakpoints are removed for some reason Sometimes the editor's view is moved down by more than 1 line

koxudaxi commented 8 months ago

@lyphrowny I'm sorry for my late reply. We should fix it. Thank you

koxudaxi commented 7 months ago

@lyphrowny I have released the fixed version as 0.0.29 Thank you for you help!!