Skip to content

Commit

Permalink
Merge pull request #2803 from HelioGuilherme66/cherry
Browse files Browse the repository at this point in the history
Fix recursion error when selecting rows, Grid Editor
  • Loading branch information
HelioGuilherme66 authored Jun 11, 2024
2 parents 71ba712 + a4eb807 commit fde92a9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.1, but RIDE is known to work w

`pip install -U robotframework-ride`

(3.8 < python &lt;= 3.12) Install current development version (**2.1dev47**) with:
(3.8 < python &lt;= 3.12) Install current development version (**2.1dev48**) with:

`pip install -U https://github.com/robotframework/RIDE/archive/master.zip`

Expand Down
6 changes: 4 additions & 2 deletions src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,11 @@ def set_content(self, html_win, content):
<pre class="literal-block">
python -m robotide.postinstall -install
</pre>
<p>RIDE {VERSION} was released on 10/June/2024.</p>
<br/>
<p>RIDE {VERSION} was released on 12/June/2024.</p>
<!-- <br/>
<h3>May The Fourth Be With You!</h3>
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>
<h3 align='center'>🇵🇹</h3>
-->
</div>
"""
22 changes: 16 additions & 6 deletions src/robotide/editor/gridbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, parent, num_rows, num_cols, popup_creator=None):
self.color_secondary_foreground = self.general_settings['secondary foreground']

self._bind_to_events()
self.selected = 0
self.selected = 2
self.cells = None
self.selection = _GridSelection(self)
self._clipboard_handler = ClipboardHandler(self)
Expand Down Expand Up @@ -159,14 +159,24 @@ def get_selected_content(self):

def get_single_selection_content(self):
if 0 <= self.selected <= 2: # To prevent max recursion error
cells = self._get_block_content(self.selection.rows(), self.selection.cols()) # self.get_selected_content()
self.cells = cells
self.selected += 1
cells = self.get_selected_content()
if self.cells != cells:
self.cells = cells
self.selected = 0
else:
self.selected += 1
else:
cells = self.cells
self.selected = -1
cells = self._is_whole_row_selection()
if cells:
cells = [self.GetCellValue(cells[0], 0)]
self.cells = cells
self.selected = 0
return cells[0][0]
else:
return None
if len(cells) != 1 or len(cells[0]) != 1:
return None
self.selected = 0
return cells[0][0]

def _current_cell_value(self):
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 @@ -298,9 +298,13 @@ def on_settings_changed(self, message):
self._colorize_grid()

def on_select_cell(self, event):
event.Skip()
if self.selected == -1: # To avoid max recursion error
return
self._cell_selected = True
GridEditor.on_select_cell(self, event)
rows = self._is_whole_row_selection()
if rows:
self.ClearSelection()
self.GoToCell(rows[0], 0)
wx.CallAfter(self.SelectBlock,rows[0], 0, rows[-1], self.NumberCols-1)
self._colorize_grid()

def on_kill_focus(self, event):
Expand Down
3 changes: 2 additions & 1 deletion src/robotide/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
# limitations under the License.
#
# Automatically generated by `tasks.py`.
VERSION = 'v2.1dev47'

VERSION = 'v2.1dev48'

0 comments on commit fde92a9

Please sign in to comment.