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 improvements and fixes #2837 #2840

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
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 <= 3.12) Install current development version (**2.1dev61**) with:
(3.8 <= python <= 3.12) Install current development version (**2.1dev62**) with:

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

Expand Down
2 changes: 1 addition & 1 deletion src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def set_content(self, html_win, content):
<pre class="literal-block">
python -m robotide.postinstall -install
</pre>
<p>RIDE {VERSION} was released on 29/July/2024.</p>
<p>RIDE {VERSION} was released on 03/August/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>
Expand Down
3 changes: 3 additions & 0 deletions src/robotide/editor/kweditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def _resize_grid(self):
self.AutoSizeColumns(False)
if self.settings.get("word wrap", True):
self.AutoSizeRows(False)
self.SetFocus()

def _set_cells(self):
col_size = self.settings.get("col size", 150)
Expand Down Expand Up @@ -794,6 +795,7 @@ def _call_ctrl_function(self, event: object, keycode: int):
elif keycode == ord('V'):
self.on_paste(event)
elif keycode == ord('Z'):
# print("DEBUG: kweditor.py _call_ctrl_function Pressed CTRL-Z")
self.on_undo(event)
elif keycode == ord('A'):
self.on_select_all(event)
Expand Down Expand Up @@ -859,6 +861,7 @@ def on_key_down(self, event):
skip = self._call_alt_function(event, keycode)
else:
skip = self._call_direct_function(event, keycode)
self.SetFocus()
if skip:
event.Skip()

Expand Down
4 changes: 3 additions & 1 deletion src/robotide/editor/macroeditors.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def save(self):
self.kweditor.save()

def undo(self):
self.kweditor.on_undo()
# DEBUG: On Linux we were having double Ctrl-Z action
# self.kweditor.on_undo()
pass

def redo(self):
self.kweditor.on_redo()
Expand Down
1 change: 1 addition & 0 deletions src/robotide/editor/texteditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def on_tab_change(self, message):
self._set_read_only(self._editor.source_editor.readonly)
except Exception as e: # DEBUG: When using only Text Editor exists error in message topic
print(e)
wx.CallAfter(self._editor.source_editor.on_style, None) # DEBUG Sometimes when we enter Text Edit, styles are not applied
self._editor.Refresh()
elif message.oldtab == self.title:
self._editor.remove_and_store_state()
Expand Down
8 changes: 4 additions & 4 deletions src/robotide/lib/robot/parsing/tablepopulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ def add(self, row):
self._comments.add(row)

def _add(self, row):
if row.cells == ['...']:
self._deprecate_continuation_without_values()
# if row.cells == ['...']: # DEBUG: Removed non-useful warning
# self._deprecate_continuation_without_values()
self._value.extend(row.tail if self.row_continue or not self._data_added else row.data)
# print(f"DEBUG: tablepopulators.py _PropertyPopulator {self._data_added=} _add row.cells={row.cells}"
# f" ADDED value={self._value}")
Expand Down Expand Up @@ -430,8 +430,8 @@ def _add(self, row):
class StepPopulator(_PropertyPopulator):

def _add(self, row):
if row.cells == ['...']:
self._deprecate_continuation_without_values()
# if row.cells == ['...']: # DEBUG: Removed non-useful warning
# self._deprecate_continuation_without_values()
if row.cells[0] == '...':
self._value.extend(row.cells)
else:
Expand Down
8 changes: 6 additions & 2 deletions src/robotide/lib/robot/variables/tablesetter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def __init__(self, values, error_reporter=None):
self._resolving = False

def _format_values(self, values):
# print(f"DEBUG: tablesetter.py VariableTableValueBase ENTER values={values}")
if '...' in values:
values = [elem for elem in values if elem != '...']
# print(f"DEBUG: tablesetter.py VariableTableValueBase REMOVED ... values={values}")
return values

def resolve(self, variables):
Expand Down Expand Up @@ -103,8 +107,8 @@ def _format_values(self, values):
elif values[-1].startswith('separator='): # New in RF 7.0
separator = values[-1][10:]
values = values[:-2]
# if '...' in values:
# values = [elem for elem in values if elem != '...']
if not separator and '...' in values:
values = [elem for elem in values if elem != '...']
return separator, values

def _replace_variables(self, values, variables):
Expand Down
2 changes: 1 addition & 1 deletion src/robotide/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
#
# Automatically generated by `tasks.py`.

VERSION = 'v2.1dev61'
VERSION = 'v2.1dev62'
11 changes: 9 additions & 2 deletions utest/editor/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ def setUp(self):
self._editor = EditorWithData()

def test_copy_one_cell(self):
print("")
for row in range(3):
text = f"{row}: "
for col in range(3):
cell = self._editor.GetCellValue(row, col)
text += f" {cell} |"
print(f"{text}")
self._copy_block_and_verify((0, 0, 0, 0), [['kw1']])

def test_copy_row(self):
Expand All @@ -103,8 +110,8 @@ def test_copy_block(self):
def _copy_block_and_verify(self, block, exp_content):
self._editor.SelectBlock(*block)
self._editor.copy()
assert (self._editor._clipboard_handler._clipboard.get_contents() ==
exp_content)
print(f"\nClipboard Content: {self._editor._clipboard_handler._clipboard.get_contents()}")
assert (self._editor._clipboard_handler._clipboard.get_contents() == exp_content)
self._verify_grid_content(DATA)

def test_cut_one_cell(self):
Expand Down
5 changes: 3 additions & 2 deletions utest/editor/test_macroeditors.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def setUp(self):
def test_delegation_to_kw_editor(self):
for method, kw_method in \
[('save', 'save'),
('undo', 'on_undo'),
# ('undo', 'on_undo'), # Disabled because of double Ctrl-Z
('redo', 'on_redo'),
('cut', 'on_cut'),
('copy', 'on_copy'),
Expand All @@ -84,7 +84,8 @@ def test_delegation_to_kw_editor(self):
self.tc_editor.kweditor = kw_mock
getattr(kw_mock, kw_method).is_to_be_called()
getattr(self.tc_editor, method)()
assert getattr(kw_mock, kw_method).has_been_called(), f"Should have called \"{kw_method}\" when calling \"{method}\""
assert getattr(kw_mock, kw_method).has_been_called(), (f"Should have called \""
f"{kw_method}\" when calling \"{method}\"")


if __name__ == '__main__':
Expand Down
Loading