pyqt-code-editor 0.0.26__tar.gz → 0.0.27__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.26 → pyqt_code_editor-0.0.27}/PKG-INFO +1 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/__init__.py +1 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/_settings.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/app.py +10 -5
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/code_editors/code_editors.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/editor_panel.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/settings_panel.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/sigmund.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/auto_indent.py +16 -16
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/auto_pair.py +2 -2
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/base.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/check.py +1 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/complete.py +1 -2
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/file_link.py +1 -2
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/python_auto_indent.py +18 -18
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/shortcuts.py +1 -2
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/smart_backspace_delete.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/symbols.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/theme.py +2 -3
- pyqt_code_editor-0.0.27/pyqt_code_editor/sigmund-analyst.png +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/signal_router.py +0 -2
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/syntax_highlighters/languages/generic.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/syntax_highlighters/languages/python.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/syntax_highlighters/syntax_highlighter.py +1 -2
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/utils/languages/python/_auto_indent.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/watchdog.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/quick_open_dialog.py +1 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/tabbed_editor.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/manager.py +1 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/process.py +0 -1
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/COPYING +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyproject.toml +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/code_editors/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/code_editors/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/code_editors/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/code_editors/languages/markdown.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/code_editors/languages/python.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/code_editors/languages/text.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/find_in_files.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/jupyter_console.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/project_explorer.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/workspace_explorer.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/environment_manager.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/comment.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/execute.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/line_number.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/search_replace.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/widgets/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/zoom.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/syntax_highlighters/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/syntax_highlighters/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/themes.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/utils/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/utils/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/utils/languages/python/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/utils/languages/python/_extract_cells.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/utils/languages/python/_mask_str_in_code.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/calltip_widget.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/completion_popup.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/dock.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/quick_open_file_dialog.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/quick_symbol_dialog.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/search_replace_frame.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/tab_splitter.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/languages/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/languages/generic.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/languages/python.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/__init__.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/codestral.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/jedi.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/ruff.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/sigmund.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/symbol.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/settings.py +0 -0
- {pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/readme.md +0 -0
|
@@ -4,7 +4,7 @@ import logging
|
|
|
4
4
|
from qtpy.QtWidgets import QMainWindow, QShortcut, QMessageBox, \
|
|
5
5
|
QDockWidget, QToolBar, QAction, QApplication
|
|
6
6
|
from qtpy.QtCore import Qt, QSize
|
|
7
|
-
from qtpy.QtGui import QKeySequence
|
|
7
|
+
from qtpy.QtGui import QKeySequence, QIcon
|
|
8
8
|
import qtawesome as qta
|
|
9
9
|
from .widgets import QuickOpenFileDialog
|
|
10
10
|
from .components.editor_panel import EditorPanel
|
|
@@ -16,12 +16,14 @@ from .components.sigmund import Sigmund
|
|
|
16
16
|
from .components.settings_panel import SettingsPanel
|
|
17
17
|
from . import settings, watchdog, __version__
|
|
18
18
|
from pyqt_code_editor.signal_router import signal_router
|
|
19
|
-
|
|
20
|
-
logging.basicConfig(level=logging.INFO, force=True)
|
|
19
|
+
if '--debug' in sys.argv:
|
|
20
|
+
logging.basicConfig(level=logging.INFO, force=True)
|
|
21
|
+
else:
|
|
22
|
+
logging.basicConfig(level=logging.WARNING, force=True)
|
|
21
23
|
logger = logging.getLogger(__name__)
|
|
22
24
|
|
|
23
25
|
|
|
24
|
-
class
|
|
26
|
+
class SigmundAnalyst(QMainWindow):
|
|
25
27
|
def __init__(self, root_path=None):
|
|
26
28
|
super().__init__()
|
|
27
29
|
logger.info("MainWindow initialized")
|
|
@@ -29,6 +31,9 @@ class MainWindow(QMainWindow):
|
|
|
29
31
|
if root_path:
|
|
30
32
|
settings.project_folders = settings.current_folder = root_path
|
|
31
33
|
self.setWindowTitle(f"Sigmund Analyst {__version__}")
|
|
34
|
+
self.setWindowIcon(
|
|
35
|
+
QIcon(os.path.join(os.path.dirname(__file__),
|
|
36
|
+
'sigmund-analyst.png')))
|
|
32
37
|
# The editor panel provides splittable editor tabs
|
|
33
38
|
self._editor_panel = EditorPanel()
|
|
34
39
|
self._editor_panel.open_folder_requested.connect(self._open_folder)
|
|
@@ -447,6 +452,6 @@ class MainWindow(QMainWindow):
|
|
|
447
452
|
def launch_app():
|
|
448
453
|
app = QApplication(sys.argv)
|
|
449
454
|
settings.set_font_family()
|
|
450
|
-
window =
|
|
455
|
+
window = SigmundAnalyst()
|
|
451
456
|
window.show()
|
|
452
457
|
sys.exit(app.exec_())
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/settings_panel.py
RENAMED
|
@@ -4,7 +4,6 @@ from qtpy.QtWidgets import (QWidget, QVBoxLayout, QHBoxLayout,
|
|
|
4
4
|
from .. import settings, themes
|
|
5
5
|
from ..widgets import Dock
|
|
6
6
|
import logging
|
|
7
|
-
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
8
7
|
logger = logging.getLogger(__name__)
|
|
9
8
|
|
|
10
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from qtpy.QtCore import Qt
|
|
2
2
|
from .. import settings
|
|
3
3
|
import logging
|
|
4
|
-
logging.
|
|
4
|
+
logger = logging.getLogger(__name__)
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class AutoIndent:
|
|
@@ -50,15 +50,15 @@ class AutoIndent:
|
|
|
50
50
|
def keyPressEvent(self, event):
|
|
51
51
|
key = event.key()
|
|
52
52
|
modifiers = event.modifiers()
|
|
53
|
-
|
|
53
|
+
logger.info("keyPressEvent: key=%s, modifiers=%s", key, modifiers)
|
|
54
54
|
|
|
55
55
|
# Check for Tab/Shift+Tab indentation
|
|
56
56
|
if key == Qt.Key_Tab and modifiers == Qt.NoModifier:
|
|
57
|
-
|
|
57
|
+
logger.info("Tab pressed -> indent code")
|
|
58
58
|
self.indent_code()
|
|
59
59
|
return
|
|
60
60
|
elif (key == Qt.Key_Tab and modifiers == Qt.ShiftModifier) or key == Qt.Key_Backtab:
|
|
61
|
-
|
|
61
|
+
logger.info("Shift+Tab pressed -> dedent code")
|
|
62
62
|
self.dedent_code()
|
|
63
63
|
return
|
|
64
64
|
|
|
@@ -74,7 +74,7 @@ class AutoIndent:
|
|
|
74
74
|
|
|
75
75
|
# Check for Enter/Return (preserve indentation)
|
|
76
76
|
if key in (Qt.Key_Enter, Qt.Key_Return):
|
|
77
|
-
|
|
77
|
+
logger.info("Enter/Return pressed -> preserve indentation on new line")
|
|
78
78
|
cursor = self.textCursor()
|
|
79
79
|
|
|
80
80
|
# Get leading whitespace of the current line
|
|
@@ -116,15 +116,15 @@ class AutoIndent:
|
|
|
116
116
|
Indent either the selected lines (if multi-line selection)
|
|
117
117
|
or just the current cursor position (if single-line).
|
|
118
118
|
"""
|
|
119
|
-
|
|
119
|
+
logger.info("indent_code triggered")
|
|
120
120
|
cursor = self.textCursor()
|
|
121
121
|
cursor.beginEditBlock()
|
|
122
122
|
|
|
123
123
|
if self._is_multiline_selection():
|
|
124
|
-
|
|
124
|
+
logger.info("Multi-line selection -> indent each line")
|
|
125
125
|
self._indent_selection()
|
|
126
126
|
else:
|
|
127
|
-
|
|
127
|
+
logger.info("Single line -> insert indent at cursor")
|
|
128
128
|
indent_str = self._get_indent_string()
|
|
129
129
|
cursor.insertText(indent_str)
|
|
130
130
|
|
|
@@ -135,22 +135,22 @@ class AutoIndent:
|
|
|
135
135
|
Dedent either the selected lines (if multi-line selection)
|
|
136
136
|
or just the current line (if single-line).
|
|
137
137
|
"""
|
|
138
|
-
|
|
138
|
+
logger.info("dedent_code triggered")
|
|
139
139
|
cursor = self.textCursor()
|
|
140
140
|
cursor.beginEditBlock()
|
|
141
141
|
|
|
142
142
|
if self._is_multiline_selection():
|
|
143
|
-
|
|
143
|
+
logger.info("Multi-line selection -> dedent each line")
|
|
144
144
|
self._dedent_selection()
|
|
145
145
|
else:
|
|
146
|
-
|
|
146
|
+
logger.info("Single line -> remove up to one indent chunk from start")
|
|
147
147
|
line_start = cursor.block().position()
|
|
148
148
|
line_text = cursor.block().text()
|
|
149
149
|
leading_ws = len(line_text) - len(line_text.lstrip(' \t'))
|
|
150
150
|
|
|
151
151
|
chunk_size = self._compute_chunk_size()
|
|
152
152
|
remove_chars = min(chunk_size, leading_ws)
|
|
153
|
-
|
|
153
|
+
logger.info("Removing up to %d chars from leading whitespace", remove_chars)
|
|
154
154
|
|
|
155
155
|
cursor.setPosition(line_start)
|
|
156
156
|
for _ in range(remove_chars):
|
|
@@ -162,7 +162,7 @@ class AutoIndent:
|
|
|
162
162
|
"""
|
|
163
163
|
Increase indent for each selected line by one chunk.
|
|
164
164
|
"""
|
|
165
|
-
|
|
165
|
+
logger.info("indent_selection (multi-line)")
|
|
166
166
|
indent_str = self._get_indent_string()
|
|
167
167
|
|
|
168
168
|
cursor = self.textCursor()
|
|
@@ -183,7 +183,7 @@ class AutoIndent:
|
|
|
183
183
|
Decrease indent for each selected line by one chunk,
|
|
184
184
|
ensuring we don't go below zero indentation.
|
|
185
185
|
"""
|
|
186
|
-
|
|
186
|
+
logger.info("dedent_selection (multi-line)")
|
|
187
187
|
cursor = self.textCursor()
|
|
188
188
|
start = cursor.selectionStart()
|
|
189
189
|
end = cursor.selectionEnd()
|
|
@@ -220,7 +220,7 @@ class AutoIndent:
|
|
|
220
220
|
if 0 < pos_in_block <= leading_ws:
|
|
221
221
|
chunk_size = self._compute_chunk_size()
|
|
222
222
|
remove_count = min(chunk_size, pos_in_block)
|
|
223
|
-
|
|
223
|
+
logger.info("Backspace in leading whitespace -> removing %d chars", remove_count)
|
|
224
224
|
|
|
225
225
|
for _ in range(remove_count):
|
|
226
226
|
cursor.deletePreviousChar()
|
|
@@ -241,7 +241,7 @@ class AutoIndent:
|
|
|
241
241
|
if pos_in_block < leading_ws:
|
|
242
242
|
chunk_size = self._compute_chunk_size()
|
|
243
243
|
remove_count = min(chunk_size, leading_ws - pos_in_block)
|
|
244
|
-
|
|
244
|
+
logger.info("Delete in leading whitespace -> removing %d chars", remove_count)
|
|
245
245
|
|
|
246
246
|
for _ in range(remove_count):
|
|
247
247
|
cursor.deleteChar()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from qtpy.QtCore import Qt
|
|
2
2
|
import logging
|
|
3
|
-
logging.
|
|
3
|
+
logger = logging.getLogger(__name__)
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class AutoPair:
|
|
@@ -158,7 +158,7 @@ class AutoPair:
|
|
|
158
158
|
c.endEditBlock()
|
|
159
159
|
self.setTextCursor(c)
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
logger.info(
|
|
162
162
|
"Auto-paired '%s' with '%s', inserted in-between '%s'. "
|
|
163
163
|
"Cursor restored to position %d",
|
|
164
164
|
open_seq, close_seq, inbetween_seq, old_pos
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import logging; logging.basicConfig(level=logging.INFO, force=True)
|
|
2
1
|
from qtpy.QtWidgets import QWidget, QPlainTextEdit
|
|
3
2
|
from qtpy.QtCore import Qt, QRect, QPoint, QSize, QTimer
|
|
4
3
|
from qtpy.QtGui import QPainter, QColor, QBrush
|
|
4
|
+
import logging
|
|
5
5
|
logger = logging.getLogger(__name__)
|
|
6
6
|
|
|
7
7
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
|
-
import logging
|
|
4
3
|
from qtpy.QtCore import QTimer, Qt
|
|
5
4
|
from qtpy.QtGui import QTextCursor
|
|
6
5
|
from qtpy.QtWidgets import QApplication
|
|
@@ -8,7 +7,7 @@ from ..widgets.completion_popup import CompletionPopup
|
|
|
8
7
|
from ..widgets.calltip_widget import CalltipWidget
|
|
9
8
|
from ..environment_manager import environment_manager
|
|
10
9
|
from .. import settings
|
|
11
|
-
logging
|
|
10
|
+
import logging
|
|
12
11
|
logger = logging.getLogger(__name__)
|
|
13
12
|
|
|
14
13
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import os
|
|
2
|
-
import logging
|
|
3
2
|
import chardet
|
|
4
3
|
from pathlib import Path
|
|
5
4
|
from qtpy.QtCore import QFileSystemWatcher, Signal
|
|
6
5
|
from qtpy.QtWidgets import QMessageBox, QFileDialog
|
|
7
6
|
from .. import settings
|
|
8
|
-
logging
|
|
7
|
+
import logging
|
|
9
8
|
logger = logging.getLogger(__name__)
|
|
10
9
|
|
|
11
10
|
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/python_auto_indent.py
RENAMED
|
@@ -3,7 +3,7 @@ from qtpy.QtGui import QTextCursor
|
|
|
3
3
|
from .. import settings
|
|
4
4
|
from ..utils.languages import python as python_utils
|
|
5
5
|
import logging
|
|
6
|
-
logging.
|
|
6
|
+
logger = logging.getLogger(__name__)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class PythonAutoIndent:
|
|
@@ -25,15 +25,15 @@ class PythonAutoIndent:
|
|
|
25
25
|
def keyPressEvent(self, event):
|
|
26
26
|
key = event.key()
|
|
27
27
|
modifiers = event.modifiers()
|
|
28
|
-
|
|
28
|
+
logger.info("keyPressEvent: key=%s, modifiers=%s", key, modifiers)
|
|
29
29
|
|
|
30
30
|
# Check for Tab/Shift+Tab indentation
|
|
31
31
|
if key == Qt.Key_Tab and modifiers == Qt.NoModifier:
|
|
32
|
-
|
|
32
|
+
logger.info("Tab pressed, indent code")
|
|
33
33
|
self.indent_code()
|
|
34
34
|
return
|
|
35
35
|
elif (key == Qt.Key_Tab and modifiers == Qt.ShiftModifier) or key == Qt.Key_Backtab:
|
|
36
|
-
|
|
36
|
+
logger.info("Shift+Tab pressed, dedent code")
|
|
37
37
|
self.dedent_code()
|
|
38
38
|
return
|
|
39
39
|
|
|
@@ -49,7 +49,7 @@ class PythonAutoIndent:
|
|
|
49
49
|
|
|
50
50
|
# Check for Enter/Return
|
|
51
51
|
if key in (Qt.Key_Enter, Qt.Key_Return):
|
|
52
|
-
|
|
52
|
+
logger.info("Enter/Return pressed")
|
|
53
53
|
cursor = self.textCursor()
|
|
54
54
|
cursor.beginEditBlock()
|
|
55
55
|
|
|
@@ -64,7 +64,7 @@ class PythonAutoIndent:
|
|
|
64
64
|
# Insert the computed indentation
|
|
65
65
|
super().keyPressEvent(event)
|
|
66
66
|
if new_indent > 0:
|
|
67
|
-
|
|
67
|
+
logger.info("Inserting %d spaces of indentation", new_indent)
|
|
68
68
|
self._insert_indentation(new_indent)
|
|
69
69
|
cursor.endEditBlock()
|
|
70
70
|
self.setTextCursor(cursor)
|
|
@@ -92,7 +92,7 @@ class PythonAutoIndent:
|
|
|
92
92
|
remainder = settings.tab_width
|
|
93
93
|
|
|
94
94
|
remove_count = min(remainder, pos_in_block)
|
|
95
|
-
|
|
95
|
+
logger.info("Backspace in leading indentation, removing %d spaces", remove_count)
|
|
96
96
|
|
|
97
97
|
# Delete the chunk of spaces
|
|
98
98
|
for _ in range(remove_count):
|
|
@@ -117,7 +117,7 @@ class PythonAutoIndent:
|
|
|
117
117
|
# Figure out how many spaces remain in this "tab chunk"
|
|
118
118
|
chunk_end = ((pos_in_block // settings.tab_width) + 1) * settings.tab_width
|
|
119
119
|
remove_count = min(chunk_end - pos_in_block, leading_spaces - pos_in_block)
|
|
120
|
-
|
|
120
|
+
logger.info("Delete in leading indentation, removing %d spaces", remove_count)
|
|
121
121
|
|
|
122
122
|
for _ in range(remove_count):
|
|
123
123
|
cursor.deleteChar()
|
|
@@ -142,15 +142,15 @@ class PythonAutoIndent:
|
|
|
142
142
|
or just the current cursor position (if single-line or no selection).
|
|
143
143
|
All changes happen in a single undo block.
|
|
144
144
|
"""
|
|
145
|
-
|
|
145
|
+
logger.info("Indent code triggered")
|
|
146
146
|
cursor = self.textCursor()
|
|
147
147
|
cursor.beginEditBlock()
|
|
148
148
|
|
|
149
149
|
if self._is_multiline_selection():
|
|
150
|
-
|
|
150
|
+
logger.info("Multi-line selection detected -> Indenting each line")
|
|
151
151
|
self._indent_selection()
|
|
152
152
|
else:
|
|
153
|
-
|
|
153
|
+
logger.info("Single-line (or no) selection -> Inserting indent at cursor")
|
|
154
154
|
# Insert spacing at the current cursor position
|
|
155
155
|
cursor.insertText(' ' * settings.tab_width)
|
|
156
156
|
|
|
@@ -162,15 +162,15 @@ class PythonAutoIndent:
|
|
|
162
162
|
or just the current line (if single-line or no selection).
|
|
163
163
|
All changes happen in a single undo block.
|
|
164
164
|
"""
|
|
165
|
-
|
|
165
|
+
logger.info("Dedent code triggered")
|
|
166
166
|
cursor = self.textCursor()
|
|
167
167
|
cursor.beginEditBlock()
|
|
168
168
|
|
|
169
169
|
if self._is_multiline_selection():
|
|
170
|
-
|
|
170
|
+
logger.info("Multi-line selection detected -> Dedenting each line")
|
|
171
171
|
self._dedent_selection()
|
|
172
172
|
else:
|
|
173
|
-
|
|
173
|
+
logger.info("Single-line (or no) selection -> Removing indent from current line if possible")
|
|
174
174
|
line_start = cursor.block().position()
|
|
175
175
|
leading_spaces = 0
|
|
176
176
|
doc_text = cursor.block().text()
|
|
@@ -192,7 +192,7 @@ class PythonAutoIndent:
|
|
|
192
192
|
Increase indent for each selected line by settings.tab_width spaces.
|
|
193
193
|
If no selection or selection on one line, that is handled outside.
|
|
194
194
|
"""
|
|
195
|
-
|
|
195
|
+
logger.info("Indent selection (multi-line)")
|
|
196
196
|
cursor = self.textCursor()
|
|
197
197
|
start = cursor.selectionStart()
|
|
198
198
|
end = cursor.selectionEnd()
|
|
@@ -213,7 +213,7 @@ class PythonAutoIndent:
|
|
|
213
213
|
ensuring no reduction below zero.
|
|
214
214
|
If no selection or selection on one line, that is handled outside.
|
|
215
215
|
"""
|
|
216
|
-
|
|
216
|
+
logger.info("Dedent selection (multi-line)")
|
|
217
217
|
cursor = self.textCursor()
|
|
218
218
|
start = cursor.selectionStart()
|
|
219
219
|
end = cursor.selectionEnd()
|
|
@@ -238,10 +238,10 @@ class PythonAutoIndent:
|
|
|
238
238
|
Deletes one character if it is a space, used in dedent logic.
|
|
239
239
|
"""
|
|
240
240
|
if cursor.document().characterAt(cursor.position()) == ' ':
|
|
241
|
-
|
|
241
|
+
logger.info("Deleting forward space during dedent")
|
|
242
242
|
cursor.deleteChar()
|
|
243
243
|
|
|
244
244
|
def _insert_indentation(self, indent_count):
|
|
245
245
|
"""Insert the specified number of spaces at the cursor."""
|
|
246
|
-
|
|
246
|
+
logger.info("Inserting indentation: %d spaces", indent_count)
|
|
247
247
|
self.textCursor().insertText(' ' * indent_count)
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
from qtpy.QtWidgets import QShortcut
|
|
3
2
|
from qtpy.QtGui import QTextCursor, QKeySequence
|
|
4
3
|
from qtpy.QtCore import Qt, QEvent
|
|
5
4
|
from .. import settings
|
|
5
|
+
import logging
|
|
6
6
|
logger = logging.getLogger(__name__)
|
|
7
|
-
logging.basicConfig(level=logging.INFO, force=True)
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class Shortcuts:
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
from pygments.token import Token
|
|
2
2
|
from .. import settings
|
|
3
3
|
from ..syntax_highlighters.syntax_highlighter import create_syntax_highlighter
|
|
4
|
-
import logging
|
|
5
4
|
from qtpy.QtGui import QPainter, QColor, QFont, QFontMetrics
|
|
6
5
|
from qtpy.QtWidgets import QPlainTextEdit
|
|
7
|
-
|
|
8
|
-
logging.basicConfig(level=logging.INFO, force=True)
|
|
6
|
+
import logging
|
|
9
7
|
logger = logging.getLogger(__name__)
|
|
10
8
|
|
|
9
|
+
|
|
11
10
|
class Theme:
|
|
12
11
|
"""
|
|
13
12
|
Mixin for QPlainTextEdit that provides theming. It handles the following:
|
|
Binary file
|
|
@@ -2,7 +2,6 @@ from pygments.styles import get_style_by_name
|
|
|
2
2
|
from pygments.formatters.html import HtmlFormatter
|
|
3
3
|
from qtpy.QtGui import QSyntaxHighlighter, QTextCharFormat, QBrush, QColor, QFont
|
|
4
4
|
import logging
|
|
5
|
-
logging.basicConfig(level=logging.INFO, force=True)
|
|
6
5
|
logger = logging.getLogger(__name__)
|
|
7
6
|
|
|
8
7
|
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/tabbed_editor.py
RENAMED
|
@@ -7,7 +7,6 @@ from qtpy.QtCore import Signal, Qt, QMimeData, QPoint, QByteArray, QDataStream
|
|
|
7
7
|
from ..code_editors import create_editor
|
|
8
8
|
from .. import settings, utils
|
|
9
9
|
from ..signal_router import signal_router
|
|
10
|
-
logging.basicConfig(level=logging.INFO, force=True)
|
|
11
10
|
logger = logging.getLogger(__name__)
|
|
12
11
|
|
|
13
12
|
|
|
@@ -18,7 +18,7 @@ def send_worker_request(**data) -> (Queue, int):
|
|
|
18
18
|
# 1. Look for an existing free worker
|
|
19
19
|
for pid, w in list(_workers.items()):
|
|
20
20
|
if w["is_free"] and w["process"].is_alive():
|
|
21
|
-
logger.info(f"Reusing free worker {pid} for request {list(data.keys())}")
|
|
21
|
+
logger.info(f"Reusing free worker {pid} (of {len(_workers)}) for request {list(data.keys())}")
|
|
22
22
|
w["is_free"] = False
|
|
23
23
|
w["request_queue"].put(data)
|
|
24
24
|
return w["result_queue"], pid
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/code_editors/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/code_editors/languages/text.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/find_in_files.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/jupyter_console.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/components/project_explorer.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.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/search_replace.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/mixins/widgets/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/syntax_highlighters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/utils/languages/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/calltip_widget.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/completion_popup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/quick_symbol_dialog.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/search_replace_frame.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/widgets/tab_splitter.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/languages/__init__.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/languages/generic.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/languages/python.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/__init__.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/codestral.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/jedi.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/ruff.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/sigmund.py
RENAMED
|
File without changes
|
{pyqt_code_editor-0.0.26 → pyqt_code_editor-0.0.27}/pyqt_code_editor/worker/providers/symbol.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|