Skip to content

Commit

Permalink
* Bug fix for Ctrl -X
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvaes committed Apr 8, 2024
1 parent 31bbdfe commit 88b7e59
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
## 1.4.8
* Bug fix for Ctrl -X

## 1.4.7
* Added keyboard shortcut Ctrl -X to delete the current line
* Added keyboard shortcut Ctrl -D to duplicate the current line


## 1.4.6
* Added checkbox in the View menu to turn off the log view in case you're using an external log viewer

Expand Down
2 changes: 1 addition & 1 deletion dcs_code_injector/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

VERSION = "1.4.7"
VERSION = "1.4.8"
ICON = os.path.join(os.path.dirname(__file__), "ui", "icons", "icon.png")
LOGO = os.path.join(os.path.dirname(__file__), "ui", "icons", "logo.png")
UI_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ui")
10 changes: 7 additions & 3 deletions dcs_code_injector/code_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,13 @@ def keyPressEvent(self, event: QKeyEvent) -> None:
elif event.key() in (Qt.Key_Up, Qt.Key_Down):
super().keyPressEvent(event)
self.check_cursor_position()
if event.key() == Qt.Key_X and event.modifiers() == Qt.ControlModifier:
self.delete_current_line()
if event.key() == Qt.Key_D and event.modifiers() == Qt.ControlModifier:
elif event.key() == Qt.Key_X and event.modifiers() == Qt.ControlModifier:
cursor: QCursor = self.textCursor()
if cursor.hasSelection():
super().keyPressEvent(event)
else:
self.delete_current_line()
elif event.key() == Qt.Key_D and event.modifiers() == Qt.ControlModifier:
self.duplicate_current_line()
elif event.key() == Qt.Key_Return or event.key() == Qt.Key_Enter and not event.modifiers() == Qt.ControlModifier:
cursor = self.textCursor()
Expand Down

0 comments on commit 88b7e59

Please sign in to comment.