godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.36k stars 19.23k forks source link

Editor scrolls to the right when caret moves to the end of line after deleting another line #49507

Closed KoBeWi closed 2 years ago

KoBeWi commented 3 years ago

Godot version

3.3

System information

W10

Issue description

When deleting empty line, the caret jumps to the end of next line and editor scrolls all to the right: DrzEOO9fd9

Steps to reproduce

  1. Paste this code

    func collision_avoidance() -> Vector2:
    var avoidance_force: Vector2
    var left = physics.raycast(left_collision_start.global_position, left_collision_end.global_position)
    if not left:
        left = get_world_2d().direct_space_state.intersect_ray(left_collision_start.global_position, left_collision_end.global_position, [self], Const.ENEMY_COLLISION_LAYER, false, true)
    
        if left.collider is BaseBuilding:
            print("kill")
  2. Click at the blank line in the middle
  3. Delete the line (e.g. by pressing Ctrl+X)

Minimal reproduction project

No response

jmb462 commented 2 years ago

ctrlX

I can reproduce it even on 4.0 using CTRL+X (only)