Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text editor fixes #2646

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/robotide/editor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
Delete Cells | Delete Cells | Ctrlcmd-Shift-D
Insert Rows | Insert Rows | Ctrlcmd-I
Delete Rows | Delete Rows | Ctrlcmd-D
Move Rows Up | Move Rows Up | Alt-Up
Move Rows Down | Move Rows Down | Alt-Down
[Tools]
Content Assistance (Ctrl-Space or Ctrl-Alt-Space) | Show possible keyword and variable completions | | | POSITION-70
"""
Expand Down Expand Up @@ -108,7 +110,7 @@ def unregister_context_menu_hook_to_grid(self, hook):
def _show_editor(self):
if not self._tab:
self._tab = _EditorTab(self)
self.add_tab(self._tab, 'Edit', allow_closing=False)
self.add_tab(self._tab, self._tab.plugin.name, allow_closing=False)
if self.is_focused():
self._editor = self._create_editor()
self._tab.show_editor(self._editor)
Expand Down Expand Up @@ -230,6 +232,14 @@ def on_delete_rows(self, event):
_ = event
wx.CallAfter(self.editor.delete_rows)

def on_move_rows_up(self, event):
_ = event
self.editor.on_move_rows_up()

def on_move_rows_down(self, event):
_ = event
self.editor.on_move_rows_down()

def on_delete(self, event):
_ = event
self.editor.delete()
Expand Down
10 changes: 7 additions & 3 deletions src/robotide/editor/kweditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,6 @@ def _call_direct_function(self, event: object, keycode: int):
def _call_alt_function(self, event, keycode: int):
if keycode == wx.WXK_SPACE:
self._open_cell_editor_with_content_assist() # Mac CMD
elif keycode in [wx.WXK_DOWN, wx.WXK_UP]:
# Mac Option key(⌥)
self._move_rows(keycode)
elif keycode == wx.WXK_RETURN:
if self.IsCellEditControlShown():
event.GetEventObject().WriteText(linesep)
Expand All @@ -690,6 +687,13 @@ def _call_alt_function(self, event, keycode: int):
return False # event must not be skipped in this case
return True

"""
elif keycode in [wx.WXK_DOWN, wx.WXK_UP]:
print(f"DEBUG kweditor call move_rews ky={keycode}")
# Mac Option key(⌥)
self._move_rows(keycode)
"""

def on_key_down(self, event):
keycode = event.GetUnicodeKey() or event.GetKeyCode()
if event.ControlDown():
Expand Down
6 changes: 6 additions & 0 deletions src/robotide/editor/macroeditors.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ def insert_rows(self):
def delete_rows(self):
self.kweditor.on_delete_rows(None) # DEBUG python 3

def on_move_rows_up(self):
self.kweditor.on_move_rows_up()

def on_move_rows_down(self):
self.kweditor.on_move_rows_down()

def delete(self):
self.kweditor.on_delete()

Expand Down
Loading