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

Force modified state in Text Editor for mouse Cut and Paste #2828

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
15 changes: 11 additions & 4 deletions src/robotide/editor/texteditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from time import time

import wx
from wx import stc, Colour
from wx import stc, Colour, MenuEvent
from wx.adv import HyperlinkCtrl, EVT_HYPERLINK
from multiprocessing import shared_memory
from .popupwindow import HtmlPopupWindow
Expand Down Expand Up @@ -86,7 +86,7 @@ def obtain_language(existing, content):
# print(f"DEBUG: textedit.py validate_and_update obtain_language={doc_lang}")
if doc_lang is not None:
try:
mlang = Language.from_name(doc_lang.replace('_','-'))
mlang = Language.from_name(doc_lang.replace('_', '-'))
except ValueError as e:
raise e
set_lang[0] = get_rf_lang_code(mlang.code) # .code.replace('-','_')
Expand Down Expand Up @@ -543,8 +543,8 @@ def _txt_data(self, data):
language=self._doc_language)
text = output.getvalue()
# if self._reformat: # DEBUG: This is a good place to call Tidy
# text = self.collapse_blanks(text) # This breaks formatting in Templated tests
# print(f"DEBUG: textedit.py DataFileWrapper content _txt_data = {text=} language={self._doc_language}")
# text = self.collapse_blanks(text) # This breaks formatting in Templated tests
# print(f"DEBUG: textedit.py DataFileWrapper content _txt_data = {text=} language={self._doc_language}")
return text

""" DEBUG: This is no longer used
Expand Down Expand Up @@ -1204,8 +1204,15 @@ def _create_editor_text_control(self, text=None, language=None):
self.source_editor.Bind(wx.EVT_MOTION, self.on_mouse_motion)
self.source_editor.Bind(wx.EVT_KILL_FOCUS, self.LeaveFocus)
self.source_editor.Bind(wx.EVT_SET_FOCUS, self.GetFocus)
self.source_editor.Bind(wx.EVT_MENU, self.on_menu)
# DEBUG: Add here binding for keyword help

def on_menu(self, event):
m_id=event.GetId()
if m_id in (12, 14): # Cut and Paste
self.mark_file_dirty(True) # DEBUG: Forcing dirty, even if it may not be
event.Skip()

def LeaveFocus(self, event):
__ = event
self.source_editor.hide_kw_doc()
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.1dev57'
VERSION = 'v2.1dev58'
Loading