From 2f2b6825d3d3454266a4e5b4ace1afff96cd6b8a Mon Sep 17 00:00:00 2001 From: Helio Guilherme Date: Wed, 20 Sep 2023 01:09:31 +0100 Subject: [PATCH] Fix missing link indication in User Keyword when pressing Ctrl in Grid Editor --- CHANGELOG.adoc | 1 + src/robotide/application/CHANGELOG.html | 3 ++- src/robotide/application/releasenotes.py | 3 ++- src/robotide/editor/kweditor.py | 17 ++++++++--------- src/robotide/editor/texteditor.py | 4 +++- src/robotide/version.py | 2 +- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 7a5a997fa..05742aa8b 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -18,6 +18,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni === Fixed +- Fixed missing indication of link for User Keyword, when pressing ``Ctrl`` in Grid Editor - Fixed exception when finding GREY color for excluded files and directories in Project Tree - Colorization of Grid Editor cells after the continuation marker ``...`` and correct parsing of those lines - Colorization of Grid Editor cells when contents is list or dictionary variables diff --git a/src/robotide/application/CHANGELOG.html b/src/robotide/application/CHANGELOG.html index d780e5679..bd9429807 100644 --- a/src/robotide/application/CHANGELOG.html +++ b/src/robotide/application/CHANGELOG.html @@ -10,7 +10,8 @@ Added variables creation shortcuts (``Ctrl-1,2,5``) to fields Arguments in Grid Editor
  • Added support for JSON variables, by using the installed Robot Framework import method -
  • 1.2. Fixed

    • +

    1.2. Fixed

      +
    • Fixed missing indication of link for User Keyword, when pressing ``Ctrl`` in Grid Editor
    • Fixed exception when finding GREY color for excluded files and directories in Project Tree
    • Colorization of Grid Editor cells after the continuation marker ``…`` and correct parsing of those lines diff --git a/src/robotide/application/releasenotes.py b/src/robotide/application/releasenotes.py index a9aa4ff6b..d9c660646 100644 --- a/src/robotide/application/releasenotes.py +++ b/src/robotide/application/releasenotes.py @@ -168,6 +168,7 @@ def set_content(self, html_win, content):

    New Features and Fixes Highlights

      +
    • Fixed missing indication of link for User Keyword, when pressing Ctrl in Grid Editor
    • Added content help pop-up on Text Editor by pressing Ctrl-M for text at cursor position or selected autocomplete list item
    • Added Exclude option in context nenu for Test files, previously was only possible for Test Suites folders
    • Added exclusion of monitoring filesystem changes for files and directories excluded in Preferences
    • @@ -237,6 +238,6 @@ def set_content(self, html_win, content):
       python -m robotide.postinstall -install
       
      -

      RIDE {VERSION} was released on 19/Sep/2023.

      +

      RIDE {VERSION} was released on 20/Sep/2023.

    """ diff --git a/src/robotide/editor/kweditor.py b/src/robotide/editor/kweditor.py index 8818b8c68..75a0bffc2 100755 --- a/src/robotide/editor/kweditor.py +++ b/src/robotide/editor/kweditor.py @@ -113,7 +113,7 @@ def __init__(self, parent, controller, tree): self._controller.datafile_controller.register_for_namespace_updates( self._namespace_updated) self._tooltips = GridToolTips(self) - self._marked_cell = None + self._marked_cell = (-1, -1) self._make_bindings() self._write_steps(self._controller) self.autosize() @@ -256,9 +256,11 @@ def on_kill_focus(self, event): def _execute(self, command): return self._controller.execute(command) - def _toggle_underlined(self, cell): + def _toggle_underlined(self, cell, clear=False): font = self.GetCellFont(cell.Row, cell.Col) - font.SetUnderlined(not font.Underlined) + toggle = not font.GetUnderlined() if not clear else False + self._marked_cell = cell if toggle else (-1, -1) + font.SetUnderlined(toggle) self.SetCellFont(cell.Row, cell.Col, font) self.Refresh() @@ -731,7 +733,6 @@ def _cell_value(self, cell): def _show_user_keyword_link(self, cell, value): if cell != self._marked_cell and self._plugin.get_user_keyword(value): self._toggle_underlined(cell) - self._marked_cell = cell def _show_keyword_details(self, cell, value): details = self._plugin.get_keyword_details(value) @@ -872,8 +873,7 @@ def _navigate_to_matching_user_keyword(self, row, col): value = self.GetCellValue(row, col) uk = self._plugin.get_user_keyword(value) if uk: - self._toggle_underlined((grid.GridCellCoords(row, col))) - self._marked_cell = None + self._toggle_underlined((grid.GridCellCoords(row, col)), True) wx.CallAfter(self._tree.select_user_keyword_node, uk) return True return False @@ -882,10 +882,9 @@ def _is_active_window(self): return self.IsShownOnScreen() and self.FindFocus() def _hide_link_if_necessary(self): - if not self._marked_cell: + if self._marked_cell == (-1, -1): return - self._toggle_underlined(self._marked_cell) - self._marked_cell = None + self._toggle_underlined(self._marked_cell, True) def on_create_keyword(self, event): _ = event diff --git a/src/robotide/editor/texteditor.py b/src/robotide/editor/texteditor.py index 98ec29bd2..e65a7d5f6 100644 --- a/src/robotide/editor/texteditor.py +++ b/src/robotide/editor/texteditor.py @@ -1523,7 +1523,9 @@ def show_kw_doc(self): def hide_kw_doc(self): if self._information_popup: - self._information_popup.hide() + # self._information_popup.hide() + self._information_popup.Show(False) + self._information_popup.Destroy() self._information_popup = None def on_key_pressed(self, event): diff --git a/src/robotide/version.py b/src/robotide/version.py index ae412d3f3..ba16c9b85 100644 --- a/src/robotide/version.py +++ b/src/robotide/version.py @@ -14,4 +14,4 @@ # limitations under the License. # # Automatically generated by `tasks.py`. -VERSION = 'v2.0.8dev12' +VERSION = 'v2.0.8dev13'