Skip to content

Commit e9356a8

Browse files
Improve nav txt (#3058)
* Fix nav from Tree in same test suite. Fix first start no language set * Fix selection of items from Tree and highlight at Text Editor. * Improve Text Editor selection of items
1 parent 7a7ad18 commit e9356a8

7 files changed

Lines changed: 40 additions & 31 deletions

File tree

CHANGELOG.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
99
== https://github.com/robotframework/RIDE[Unreleased]
1010

1111
=== Fixed
12+
- Fix selection of items (variables, test names, keywords) from Project Explorer and highlight at Text Editor.
1213
- Fixed Tab spacing in Text Editor. When pressing tab the expected spaces were not written, causing failing steps.
1314

1415
== https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride-2.2.4.rst[2.2.4] - 2026-07-09

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Likewise, the current version of wxPython, is 4.2.5, but RIDE is known to work w
4646

4747
`pip install -U robotframework-ride`
4848

49-
(3.9 <= python <= 3.14) Install current development version (**2.2.5dev2**) with:
49+
(3.9 <= python <= 3.14) Install current development version (**2.2.5dev3**) with:
5050

5151
`pip install -U https://github.com/robotframework/RIDE/archive/develop.zip`
5252

src/robotide/application/CHANGELOG.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Changelog</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id1337">_</a>Changelog</h2></div></div><hr /></div><p>All notable changes to this project will be documented in this file.</p><p>The format is based on <a class="ulink" href="http://keepachangelog.com/en/1.0.0/" target="_top">Keep a Changelog</a>
33
and this project adheres to <a class="ulink" href="http://semver.org/spec/v2.0.0.html" target="_top">Semantic Versioning</a>.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_ulink_url_https_github_com_robotframework_ride_unreleased_ulink">_</a>1. <a class="ulink" href="https://github.com/robotframework/RIDE" target="_top">Unreleased</a></h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_fixed">_</a>1.1. Fixed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
4+
Fix selection of items (variables, test names, keywords) from Project Explorer and highlight at Text Editor.
5+
</li><li class="listitem">
46
Fixed Tab spacing in Text Editor. When pressing tab the expected spaces were not written, causing failing steps.
57
</li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_ulink_url_https_github_com_robotframework_ride_blob_master_doc_releasenotes_ride_2_2_4_rst_2_2_4_ulink_2026_07_09">_</a>2. <a class="ulink" href="https://github.com/robotframework/RIDE/blob/master/doc/releasenotes/ride-2.2.4.rst" target="_top">2.2.4</a> - 2026-07-09</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_fixed_2">_</a>2.1. Fixed</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
68
Fixed <span class="emphasis"><em>background assign</em></span> setting in Grid Editor preferences.

src/robotide/application/releasenotes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def set_content(self, html_win, content):
179179
</ul>
180180
<p><strong>New Features and Fixes Highlights</strong></p>
181181
<ul class="simple">
182+
<li>Fix selection of items (variables, test names, keywords) from Project Explorer and highlight at Text Editor.</li>
182183
<li>Fixed Tab spacing in Text Editor. When pressing tab the expected spaces were not written, causing failing steps.</li>
183184
<li>Changed Auto-Save to only save when user is not typing, and if code is in error show message in status bar.</li>
184185
<li>Applied STC_LEX colorization on Code Editor (external files editor).</li>
@@ -236,7 +237,7 @@ def set_content(self, html_win, content):
236237
<pre class="literal-block">python -m robotide.postinstall -install</pre>
237238
<p>or</p>
238239
<pre class="literal-block">ride_postinstall.py -install</pre>
239-
<p>RIDE {VERSION} was released on 16/July/2026.</p>
240+
<p>RIDE {VERSION} was released on 22/July/2026.</p>
240241
<br/>
241242
<!--
242243
<h3>Celebrate the bank holiday, 1st December, Restoration of the Independence of Portugal (from Spain in 1640)!!</h3>

src/robotide/editor/texteditor.py

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -560,29 +560,28 @@ def on_tree_selection(self, message):
560560
# print(f"DEBUG: texteditor.py TextEditorPlugin on_tree_selection ENTER {message=} type={type(message.item)}")
561561
self._editor.store_position()
562562
# self.jump = True
563-
if self.is_focused():
564-
next_datafile_controller = message.item and message.item.datafile_controller
565-
if self._editor.datafile_controller == message.item.datafile_controller == next_datafile_controller:
566-
# print(f"DEBUG: OnTreeSelection Same FILE item type={type(message.item)}\n"
567-
# f"value of {self._save_flag=}")
568-
self._editor.locate_tree_item(message.item)
569-
self.jump = True
570-
return
571-
if self._editor.dirty and not self._apply_txt_changes_to_model(auto=False):
572-
if self._editor.datafile_controller != next_datafile_controller:
573-
self.tree.select_controller_node(self._editor.datafile_controller)
574-
self._editor.set_editor_caret_position()
575-
return
576-
if next_datafile_controller:
577-
self.jump = True
578-
self._open_data_for_controller(next_datafile_controller)
579-
# print(f"DEBUG: OnTreeSelection OTHER FILE item type={type(message.item)}\n"
580-
# f"value of {self._save_flag=}")
581-
wx.CallAfter(self._editor.locate_tree_item, message.item)
582-
self._set_read_only(message)
563+
next_datafile_controller = message.item and message.item.datafile_controller
564+
if self._editor.datafile_controller == message.item.datafile_controller == next_datafile_controller:
565+
# print(f"DEBUG: OnTreeSelection Same FILE item type={type(message.item)}\n"
566+
# f"value of {self._save_flag=}")
567+
position = self._editor.locate_tree_item(message.item)
568+
self._editor.store_position()
569+
wx.CallAfter(self._editor.source_editor.SetSelection, position[0], position[1])
570+
self.jump = True
571+
return
572+
if self._editor.dirty and not self._apply_txt_changes_to_model(auto=False):
573+
if self._editor.datafile_controller != next_datafile_controller:
574+
self.tree.select_controller_node(self._editor.datafile_controller)
583575
self._editor.set_editor_caret_position()
584-
else:
585-
self._editor.GetFocus(None)
576+
return
577+
if next_datafile_controller:
578+
self.jump = True
579+
self._open_data_for_controller(next_datafile_controller)
580+
# print(f"DEBUG: OnTreeSelection OTHER FILE item type={type(message.item)}\n"
581+
# f"value of {self._save_flag=}")
582+
wx.CallAfter(self._editor.locate_tree_item, message.item)
583+
self._set_read_only(message)
584+
self._editor.set_editor_caret_position()
586585

587586
def _set_read_only(self, message):
588587
if not isinstance(message, bool):
@@ -1293,7 +1292,7 @@ def locate_tree_item(self, item):
12931292
name_to_locate = r'^'+item.name+r'.*$'
12941293
position = self.source_editor.FindText(section_start, search_end, name_to_locate, STC_FIND_REGEXP)
12951294
# print(f"DEBUG: TextEditor locate_tree_item name_to_locate={name_to_locate} position={position}\n"
1296-
# f"curpos={self._position} {self.is_saving=}")
1295+
# f"curpos={self._position}")
12971296
if position[0] != -1:
12981297
# DEBUG: Make colours configurable?
12991298
self.source_editor.SetSelBackground(True, Colour('orange'))
@@ -1304,6 +1303,7 @@ def locate_tree_item(self, item):
13041303
self.source_editor.SetCurrentPos(position[1])
13051304
self.source_editor.SetAnchor(position[0])
13061305
self.source_editor.SetSelection(position[0], position[1])
1306+
self.source_editor.SetCurrentPos(position[1])
13071307
self.source_editor.SetFocusFromKbd()
13081308
self.source_editor_parent.SetFocus()
13091309
self.source_editor.Update()
@@ -1313,10 +1313,13 @@ def locate_tree_item(self, item):
13131313
self.source_editor.LineScrollUp()
13141314
self.source_editor.SetCurrentPos(1)
13151315
self.source_editor.SetAnchor(0)
1316-
self.source_editor.SetSelection(0, self.source_editor.GetLineEndPosition(0))
1316+
position = (0, self.source_editor.GetLineEndPosition(0))
1317+
self.source_editor.SetSelection(position[0], position[1])
1318+
self.source_editor.SetCurrentPos(position[1])
13171319
self.source_editor.SetFocusFromKbd()
13181320
self.source_editor_parent.SetFocus()
13191321
self.source_editor.Update()
1322+
return position[0], position[1]
13201323

13211324
def words_cache(self, doc_size: int):
13221325
if doc_size != self.doc_size: # DEBUG The initial idea was to not update words list if no changes in doc
@@ -2923,7 +2926,8 @@ def on_update_ui(self, evt):
29232926
self.BraceBadLight(brace_at_caret)
29242927
else:
29252928
self.BraceHighlight(brace_at_caret, brace_opposite)
2926-
self.stylizer.stylize()
2929+
if self.GetLength() > 1: # Was calling stylize before loading document
2930+
self.stylizer.stylize()
29272931

29282932
def _show_keyword_details(self, value, coords=None):
29292933
"""
@@ -2984,7 +2988,7 @@ def SetUpEditor(self, tab_size=4, tab_markers=True, m_bg='', m_fg='', caret_fg:
29842988
self.SetIndentationGuides(tab_markers) # Show indent guides
29852989
self.SetBackSpaceUnIndents(True) # Backspace unindents rather than delete 1 space
29862990
# self.SetTabIndents(True) # Tab key indents
2987-
# self.SetTabWidth(tab_size) # Proscribed tab size for wx
2991+
self.SetTabWidth(tab_size) # Proscribed tab size for wx
29882992
self.SetUseTabs(False) # Use spaces rather than tabs, or TabTimmy will complain!
29892993
# White space
29902994
self.SetViewWhiteSpace(self.visible_spaces) # View white space

src/robotide/lib/compat/pygments/robotframework.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,10 @@ def __init__(self, template_setter=None, new_lang=None):
315315
pass
316316
else:
317317
self.new_lang = new_lang
318-
if self.new_lang is None:
318+
if self.new_lang is None or isinstance(self.new_lang, list) :
319319
self.new_lang = Language.from_name('En')
320-
# print(f"DEBUG: robotframework.py Setting self.new_lang={self.new_lang}\n")
320+
# print(f"DEBUG: robotframework.py Setting self.new_lang={self.new_lang}\n"
321+
# f"type of self.new_lang={type(self.new_lang)} ")
321322
self.normalized_settings = normalize_dict(self.new_lang.settings)
322323
self._keyword_settings = (get_key_by_value(self.normalized_settings,'suitesetup'),
323324
get_key_by_value(self.normalized_settings, 'suiteprecondition'),

src/robotide/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#
1616
# Automatically generated by `tasks.py`.
1717

18-
VERSION = 'v2.2.5dev2'
18+
VERSION = 'v2.2.5dev3'

0 commit comments

Comments
 (0)