pyqt-code-editor 0.0.52__tar.gz → 0.0.53__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/PKG-INFO +1 -1
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/__init__.py +1 -1
- pyqt_code_editor-0.0.53/pyqt_code_editor/mixins/merge_undo_actions.py +54 -0
- pyqt_code_editor-0.0.52/pyqt_code_editor/mixins/merge_undo_actions.py +0 -32
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/COPYING +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyproject.toml +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/_settings.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/app.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/code_editors.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/languages/javascript.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/languages/markdown.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/languages/python.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/languages/text.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/editor_panel.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/find_in_files.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/jupyter_console.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/project_explorer.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/settings_panel.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/sigmund.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/workspace_explorer.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/environment_manager.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/auto_indent.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/auto_pair.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/base.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/check.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/comment.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/complete.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/execute.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/file_link.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/highlight_matching_brackets.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/line_number.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/python_auto_indent.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/search_replace.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/shortcuts.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/smart_backspace_delete.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/symbols.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/theme.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/widgets/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/zoom.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/sigmund-analyst.png +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/signal_router.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/syntax_highlighters/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/syntax_highlighters/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/syntax_highlighters/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/syntax_highlighters/languages/python.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/syntax_highlighters/syntax_highlighter.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/themes.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/utils/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/utils/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/utils/languages/python/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/utils/languages/python/_auto_indent.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/utils/languages/python/_extract_cells.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/utils/languages/python/_mask_str_in_code.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/watchdog.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/calltip_widget.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/completion_popup.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/dock.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/quick_open_dialog.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/quick_open_file_dialog.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/quick_symbol_dialog.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/search_replace_frame.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/tab_splitter.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/tabbed_editor.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/languages/python.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/manager.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/process.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/__init__.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/codestral.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/jedi.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/ruff.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/sigmund.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/symbol.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/tree_sitter.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/settings.py +0 -0
- {pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/readme.md +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from qtpy.QtCore import Qt
|
|
2
|
+
from qtpy.QtGui import QTextCursor
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class MergeUndoActions:
|
|
6
|
+
"""Ensures that all changes made as part of a key press result in a
|
|
7
|
+
single edit block for undo purposes. This class should be the first
|
|
8
|
+
mixin of the list.
|
|
9
|
+
"""
|
|
10
|
+
def keyPressEvent(self, event):
|
|
11
|
+
# Navigation keys that should NOT be wrapped in edit blocks. This
|
|
12
|
+
# avoids cursor glitches when navigating vertically/horizontally.
|
|
13
|
+
navigation_keys = {
|
|
14
|
+
Qt.Key.Key_Up, Qt.Key.Key_Down,
|
|
15
|
+
Qt.Key.Key_Left, Qt.Key.Key_Right,
|
|
16
|
+
Qt.Key.Key_Home, Qt.Key.Key_End,
|
|
17
|
+
Qt.Key.Key_PageUp, Qt.Key.Key_PageDown,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
key = event.key()
|
|
21
|
+
modifiers = event.modifiers()
|
|
22
|
+
|
|
23
|
+
is_navigation = (
|
|
24
|
+
key in navigation_keys
|
|
25
|
+
and not (modifiers & Qt.KeyboardModifier.ShiftModifier)
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
# Treat platform "command" modifier as well (Control on Windows/Linux, Meta on macOS)
|
|
29
|
+
ctrl_or_meta = Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.MetaModifier
|
|
30
|
+
has_ctrl_or_meta = bool(modifiers & ctrl_or_meta)
|
|
31
|
+
has_shift = bool(modifiers & Qt.KeyboardModifier.ShiftModifier)
|
|
32
|
+
|
|
33
|
+
# Common Undo/Redo shortcuts:
|
|
34
|
+
# - Undo: Ctrl+Z / Cmd+Z
|
|
35
|
+
# - Redo: Ctrl+Shift+Z / Cmd+Shift+Z / Ctrl+Y / Cmd+Y
|
|
36
|
+
is_undo = has_ctrl_or_meta and key == Qt.Key.Key_Z and not has_shift
|
|
37
|
+
is_redo = has_ctrl_or_meta and (
|
|
38
|
+
(key == Qt.Key.Key_Z and has_shift) or
|
|
39
|
+
key == Qt.Key.Key_Y
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
if is_navigation or is_undo or is_redo:
|
|
43
|
+
# Do not wrap these in an edit block
|
|
44
|
+
super().keyPressEvent(event)
|
|
45
|
+
return
|
|
46
|
+
|
|
47
|
+
# For editing keys, wrap the operation in a single edit block.
|
|
48
|
+
# Use the widget's actual text cursor, not a fresh document cursor.
|
|
49
|
+
cursor = self.textCursor()
|
|
50
|
+
cursor.beginEditBlock()
|
|
51
|
+
try:
|
|
52
|
+
super().keyPressEvent(event)
|
|
53
|
+
finally:
|
|
54
|
+
cursor.endEditBlock()
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from qtpy.QtCore import Qt
|
|
2
|
-
from qtpy.QtGui import QTextCursor
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class MergeUndoActions:
|
|
6
|
-
"""Ensures that all changes made as part of a key press result in a
|
|
7
|
-
single edit block for undo purposes. This class should be the first
|
|
8
|
-
mixin of the list.
|
|
9
|
-
"""
|
|
10
|
-
def keyPressEvent(self, event):
|
|
11
|
-
# Navigation keys that should NOT be wrapped in edit blocks. This
|
|
12
|
-
# causes a specific issue with the cursor jumping to the start of a
|
|
13
|
-
# line when navigating vertically.
|
|
14
|
-
navigation_keys = {
|
|
15
|
-
Qt.Key.Key_Up, Qt.Key.Key_Down,
|
|
16
|
-
Qt.Key.Key_Left, Qt.Key.Key_Right,
|
|
17
|
-
Qt.Key.Key_Home, Qt.Key.Key_End,
|
|
18
|
-
Qt.Key.Key_PageUp, Qt.Key.Key_PageDown
|
|
19
|
-
}
|
|
20
|
-
is_navigation = (event.key() in navigation_keys and
|
|
21
|
-
not (event.modifiers() & Qt.KeyboardModifier.ShiftModifier))
|
|
22
|
-
if is_navigation:
|
|
23
|
-
super().keyPressEvent(event)
|
|
24
|
-
return
|
|
25
|
-
# Wrap all other keys (editing operations) in a single edit block to
|
|
26
|
-
# unify changes into a single undo action
|
|
27
|
-
cursor = QTextCursor(self.document())
|
|
28
|
-
cursor.beginEditBlock()
|
|
29
|
-
try:
|
|
30
|
-
super().keyPressEvent(event)
|
|
31
|
-
finally:
|
|
32
|
-
cursor.endEditBlock()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/__init__.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/code_editors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/code_editors/languages/text.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/editor_panel.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/find_in_files.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/jupyter_console.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/project_explorer.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/components/settings_panel.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/python_auto_indent.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/search_replace.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/mixins/widgets/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/syntax_highlighters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/utils/languages/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/calltip_widget.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/completion_popup.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/quick_open_dialog.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/quick_symbol_dialog.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/search_replace_frame.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/tab_splitter.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/widgets/tabbed_editor.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/languages/__init__.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/languages/generic.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/languages/python.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/__init__.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/codestral.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/jedi.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/ruff.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/sigmund.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/symbol.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.52 → pyqt_code_editor-0.0.53}/pyqt_code_editor/worker/providers/tree_sitter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|