Skip to content

Commit

Permalink
Merge pull request #23320 from athompson673/patch-2
Browse files Browse the repository at this point in the history
PR: Make `TextEditBaseWidget.__move_line_or_selection` public
  • Loading branch information
ccordoba12 authored Dec 21, 2024
2 parents 3f64ee3 + 7c3b2ae commit 90cf98f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions spyder/plugins/editor/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ def duplicate_line_up(self):
"""
self.__duplicate_line_or_selection(after_current_line=True)

def __move_line_or_selection(self, after_current_line=True):
def move_line_or_selection(self, after_current_line=True):
"""Move current line or selected text"""
cursor = self.textCursor()
cursor.beginEditBlock()
Expand Down Expand Up @@ -881,14 +881,6 @@ def __move_line_or_selection(self, after_current_line=True):
self.setTextCursor(cursor)
self.__restore_selection(start_pos, end_pos)

def move_line_up(self):
"""Move up current line or selected text"""
self.__move_line_or_selection(after_current_line=False)

def move_line_down(self):
"""Move down current line or selected text"""
self.__move_line_or_selection(after_current_line=True)

def go_to_new_line(self):
"""Go to the end of the current line and create a new line"""
self.stdkey_end(False, False)
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/editor/widgets/codeeditor/codeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4303,7 +4303,7 @@ def __move_line_or_selection(self, after_current_line=True):
if fold_status:
self.folding_panel.toggle_fold_trigger(block)

self._TextEditBaseWidget__move_line_or_selection(
self.move_line_or_selection(
after_current_line=after_current_line
)

Expand Down

0 comments on commit 90cf98f

Please sign in to comment.