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

Fix not overwriting selected text in Text Editor #2853

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.1dev68**) with:
(3.8 <= python <= 3.12) Install current development version (**2.1dev69**) 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 @@ -325,7 +325,7 @@ def set_content(self, html_win, content):
<pre class="literal-block">
python -m robotide.postinstall -install
</pre>
<p>RIDE {VERSION} was released on 15/August/2024.</p>
<p>RIDE {VERSION} was released on 16/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
17 changes: 9 additions & 8 deletions src/robotide/editor/texteditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def on_data_changed(self, message):
# Workaround for remarked dirty with Ctrl-S
if self.is_focused() and self._save_flag == 0 and isinstance(message, RideSaving):
self._save_flag = 1
RideBeforeSaving().publish()
if self.is_focused() and self._save_flag == 1 and isinstance(message, RideDataDirtyCleared):
self._save_flag = 2
if self.is_focused() and self._save_flag == 2 and isinstance(message, RideSaved):
Expand All @@ -235,7 +236,7 @@ def on_data_changed(self, message):
# if self.is_focused() and self._save_flag == 3 and isinstance(message, RideDataChangedToDirty):
# self._save_flag = 4
# wx.CallAfter(self._editor.mark_file_dirty, False)
if self.is_focused() and isinstance(message, RideBeforeSaving):
if isinstance(message, RideBeforeSaving):
self._editor.is_saving = False
# Reset counter for Workaround for remarked dirty with Ctrl-S
self._save_flag = 0
Expand Down Expand Up @@ -1242,20 +1243,20 @@ def on_editor_key(self, event):
keycode = event.GetKeyCode()
keyvalue = event.GetUnicodeKey()
# print(f"DEBUG: TextEditor key up focused={self.is_focused()} modify {self.source_editor.GetModify()}")
if keycode == wx.WXK_DELETE: # DEBUG on Windows we only get here, single Text Editor
if keycode in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]:
self.mark_file_dirty(self.source_editor.GetModify())
return
if keyvalue == wx.WXK_NONE and keycode in [wx.WXK_CONTROL, wx.WXK_RAW_CONTROL]:
self.source_editor.hide_kw_doc()
elif keycode == wx.WXK_DELETE or (keyvalue != wx.WXK_NONE and keycode > keyvalue):
# DEBUG on Windows we only get here, single Text Editor
selected = self.source_editor.GetSelection()
if selected[0] == selected[1]:
pos = self.source_editor.GetInsertionPoint()
if pos != self.source_editor.GetLastPosition():
self.source_editor.DeleteRange(selected[0], 1)
else:
self.source_editor.DeleteRange(selected[0], selected[1] - selected[0])
self.mark_file_dirty(self.source_editor.GetModify())
if keycode in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]:
self.mark_file_dirty(self.source_editor.GetModify())
return
if keyvalue == wx.WXK_NONE and keycode in [wx.WXK_CONTROL, wx.WXK_RAW_CONTROL]:
self.source_editor.hide_kw_doc()
if self.is_focused(): # DEBUG and keycode != wx.WXK_CONTROL and keyvalue >= ord(' ') and self.dirty:
self.mark_file_dirty(self.source_editor.GetModify())
event.Skip()
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.1dev68'
VERSION = 'v2.1dev69'
Loading