Skip to content

Commit 8d7bae0

Browse files
Add options to make visible spaces and newlines in Text Editor.
1 parent eedf25c commit 8d7bae0

File tree

8 files changed

+28
-15
lines changed

8 files changed

+28
-15
lines changed

CHANGELOG.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni
88

99
== https://github.com/robotframework/RIDE[Unreleased]
1010

11+
=== Fixed
12+
- Fixed exception seen in console when selecting Tools->Library Finder... on a clean install.
13+
1114
=== Changed
1215
- Changed isbinary to be internal library, instead of being dependency.
1316

src/robotide/application/releasenotes.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def set_content(self, html_win, content):
150150
151151
<p><a class="reference external" href="https://github.com/robotframework/RIDE/">RIDE (Robot Framework IDE)</a>
152152
{VERSION} is a new release with some enhancements and bug fixes. The reference for valid arguments is
153-
<a class="reference external" href="https://robotframework.org/">Robot Framework</a> current version, 7.4.1. However,
153+
<a class="reference external" href="https://robotframework.org/">Robot Framework</a> current version, 7.4.2. However,
154154
internal library code is originally based on version 3.1.2, but adapted for new versions.</p>
155155
<ul class="simple">
156156
<li>This version supports Python 3.9 up to 3.14.</li>
@@ -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>Fixed exception seen in console when selecting Tools->Library Finder... on a clean install.</li>
182183
<li>The Test Suites Explorer can be visible or hidden with F12 (View->View Test Suites Explorer). Pane can be made
183184
floating or docked, by dragging or by double-clicking its top bar.</li>
184185
<li>In File Explorer opening non-text files is done by the operating system registered app.</li>
@@ -192,7 +193,7 @@ def set_content(self, html_win, content):
192193
</ul>
193194
<!-- <p>We hope to implement or complete features and make fixes on next major version 2.1 (in mid Autumm of 2024).</p>
194195
-->
195-
<p><strong>The minimal wxPython version is, 4.0.7, and RIDE supports the current version, 4.2.4, which we recommend.
196+
<p><strong>The minimal wxPython version is, 4.0.7, and RIDE supports the current version, 4.2.5, which we recommend.
196197
</strong></p>
197198
<p><em>Linux users are advised to install first wxPython from .whl package at</em> <a class="reference external"
198199
href="https://extras.wxpython.org/wxPython4/extras/linux/gtk3/">wxPython.org</a>, or by using the system package
@@ -243,7 +244,7 @@ def set_content(self, html_win, content):
243244
<pre class="literal-block">python -m robotide.postinstall -install</pre>
244245
<p>or</p>
245246
<pre class="literal-block">ride_postinstall.py -install</pre>
246-
<p>RIDE {VERSION} was released on 11/January/2026.</p>
247+
<p>RIDE {VERSION} was released on 28/March/2026.</p>
247248
<br/>
248249
<!--
249250
<h3>Celebrate the bank holiday, 1st December, Restoration of the Independence of Portugal (from Spain in 1640)!!</h3>

src/robotide/editor/customsourceeditor.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
class SourceCodeEditor(PythonSTC):
4141
def __init__(self, parent, options, style=wx.BORDER_NONE):
4242
PythonSTC.__init__(self, parent, -1, options, style=style)
43-
self.SetUpEditor()
43+
self.SetUpEditor(options)
4444

4545
# Some methods to make it compatible with how the wxTextCtrl is used
4646
def SetValue(self, value):
@@ -90,7 +90,7 @@ def SelectLine(self, line):
9090
end = self.GetLineEndPosition(line)
9191
self.SetSelection(start, end)
9292

93-
def SetUpEditor(self):
93+
def SetUpEditor(self, eoptions: dict):
9494
"""
9595
This method carries out the work of setting up the Code editor.
9696
It's seperate so as not to clutter up the init code.
@@ -122,13 +122,13 @@ def SetUpEditor(self):
122122
self.SetTabWidth(4) # Proscribed tab size for wx
123123
self.SetUseTabs(False) # Use spaces rather than tabs, or TabTimmy will complain!
124124
# White space
125-
self.SetViewWhiteSpace(False) # Don't view white space
125+
self.SetViewWhiteSpace(eoptions['visible spaces']) # Don't view white space
126126

127127
# EOL: Since we are loading/saving ourselves, and the
128128
# strings will always have \n's in them, set the STC to
129129
# edit them that way.
130130
self.SetEOLMode(wx.stc.STC_EOL_LF)
131-
self.SetViewEOL(False)
131+
self.SetViewEOL(eoptions['visible EOL'])
132132

133133
# No right-edge mode indicator
134134
self.SetEdgeMode(stc.STC_EDGE_NONE)
@@ -232,7 +232,8 @@ def __init__(self, parent, main_frame, filepath=None):
232232
self.parent = parent
233233
wx.Panel.__init__(self, parent, size=wx.Size(1, 1))
234234
self.mainFrame = main_frame
235-
self.editor = SourceCodeEditor(self, options={'tab markers':True, 'fold symbols':2})
235+
self.editor = SourceCodeEditor(self, options={'tab markers':True, 'fold symbols':2,
236+
'visible spaces':True, 'visible EOL':False})
236237
self.editor.RegisterModifiedEvent(self.on_code_modified)
237238
parent.SetName(f'Code Editor: {filepath}')
238239
"""

src/robotide/editor/pythoneditor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ def __init__(self, parent, idd, options: dict, pos=wx.DefaultPosition, size=wx.D
5959
self.SetProperty("tab.timmy.whinge.level", "1")
6060
self.SetMargins(2, 2)
6161

62-
self.SetViewWhiteSpace(False)
62+
self.visible_spaces = options['visible spaces']
63+
self.visible_EOL = options['visible EOL']
64+
self.SetViewWhiteSpace(self.visible_spaces)
65+
self.SetViewEOL(self.visible_EOL)
6366
self.SetEdgeMode(stc.STC_EDGE_BACKGROUND)
6467
self.SetEdgeColumn(78)
6568

src/robotide/editor/texteditor.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,8 +2641,11 @@ def __init__(self, parent, readonly=False, language=None, style=wx.BORDER_NONE):
26412641
self._settings = parent.source_editor_parent.app.settings
26422642
self.tab_markers = self._settings[PLUGIN_NAME].get('tab markers', True)
26432643
self.fold_symbols = self._settings[PLUGIN_NAME].get('fold symbols', 2)
2644-
PythonSTC.__init__(self, parent, -1, options={'tab markers':self.tab_markers, 'fold symbols':self.fold_symbols},
2645-
style=style)
2644+
self.visible_spaces = self._settings[PLUGIN_NAME].get('enable visible spaces', True)
2645+
self.visible_EOL = self._settings[PLUGIN_NAME].get('enable visible newlines', False)
2646+
PythonSTC.__init__(self, parent, -1, options={'tab markers':self.tab_markers, 'fold symbols':self.fold_symbols,
2647+
'visible spaces':self.visible_spaces,
2648+
'visible EOL':self.visible_EOL}, style=style)
26462649
self._information_popup = None
26472650
self._old_details = None
26482651
self.readonly = readonly
@@ -2976,13 +2979,13 @@ def SetUpEditor(self, tab_size=4, tab_markers=True, m_bg='', m_fg='', caret_fg:
29762979
self.SetTabWidth(tab_size) # Proscribed tab size for wx
29772980
self.SetUseTabs(False) # Use spaces rather than tabs, or TabTimmy will complain!
29782981
# White space
2979-
self.SetViewWhiteSpace(False) # Don't view white space
2982+
self.SetViewWhiteSpace(self.visible_spaces) # View white space
29802983

29812984
# EOL: Since we are loading/saving ourselves, and the
29822985
# strings will always have \n's in them, set the STC to
29832986
# edit them that way.
29842987
self.SetEOLMode(wx.stc.STC_EOL_LF)
2985-
self.SetViewEOL(False)
2988+
self.SetViewEOL(self.visible_EOL)
29862989

29872990
# No right-edge mode indicator
29882991
self.SetEdgeMode(stc.STC_EDGE_NONE)

src/robotide/preferences/settings.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ tc_kw_name = '#1A5FB4'
7171
variable = '#008080'
7272
background = '#F6F5F4'
7373
enable auto suggestions = True
74+
enable visible spaces = True
75+
enable visible newlines = False
7476

7577
[Grid]
7678
font size = 10

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.3dev3'
18+
VERSION = 'v2.2.3dev4'

0 commit comments

Comments
 (0)