Skip to content

Commit 9d3b6b7

Browse files
committed
CodeEditor remove line keybind
1 parent a5fece4 commit 9d3b6b7

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,11 @@ public override void _GuiInput(InputEvent @event)
419419
AcceptEvent();
420420
return;
421421
}
422+
if (@event.IsActionPressed(InputStringNames.CodeEditorRemoveLine))
423+
{
424+
DeleteLines();
425+
return;
426+
}
422427
if (@event is InputEventMouseButton { Pressed: true, ButtonIndex: MouseButton.Left or MouseButton.Right } mouseEvent)
423428
{
424429
var (col, line) = GetLineColumnAtPos((Vector2I)mouseEvent.Position);

src/SharpIDE.Godot/InputStringNames.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public static class InputStringNames
2020
public static readonly StringName EditorFontSizeDecrease = nameof(EditorFontSizeDecrease);
2121
public static readonly StringName CodeEditorRequestCompletions = nameof(CodeEditorRequestCompletions);
2222
public static readonly StringName CodeEditorRequestSignatureInfo = nameof(CodeEditorRequestSignatureInfo);
23+
public static readonly StringName CodeEditorRemoveLine = nameof(CodeEditorRemoveLine);
2324
}
2425

2526
public static class ThemeStringNames

src/SharpIDE.Godot/project.godot

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ CodeEditorRequestSignatureInfo={
113113
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
114114
]
115115
}
116+
CodeEditorRemoveLine={
117+
"deadzone": 0.2,
118+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":76,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
119+
]
120+
}
116121

117122
[rendering]
118123

0 commit comments

Comments
 (0)