equal
deleted
inserted
replaced
271 |
271 |
272 def OnKeyPressed(self, event): |
272 def OnKeyPressed(self, event): |
273 if self.CallTipActive(): |
273 if self.CallTipActive(): |
274 self.CallTipCancel() |
274 self.CallTipCancel() |
275 key = event.GetKeyCode() |
275 key = event.GetKeyCode() |
276 |
276 caret = self.GetSelection()[0] |
277 if (self.GetLineState(self.LineFromPosition(self.GetSelection()[0])) and |
277 print (key in [wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE], |
278 key not in NAVIGATION_KEYS): |
278 self.GetLineState(self.LineFromPosition(min(len(self.GetText()), caret + 1)))) |
|
279 |
|
280 if (self.GetLineState(self.LineFromPosition(caret)) and |
|
281 key not in NAVIGATION_KEYS or |
|
282 key == wx.WXK_BACK and |
|
283 self.GetLineState(self.LineFromPosition(max(0, caret - 1))) or |
|
284 key in [wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE] and |
|
285 self.GetLineState(self.LineFromPosition(min(len(self.GetText()), caret + 1)))): |
279 return |
286 return |
280 |
287 |
281 elif key == 32 and event.ControlDown(): |
288 elif key == 32 and event.ControlDown(): |
282 pos = self.GetCurrentPos() |
289 pos = self.GetCurrentPos() |
283 |
290 |