From 3069dbb8ec9c287c2ff6b3a1c8bfde83af81c11b Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Fri, 28 Jan 2005 00:16:16 +0000 Subject: Add keybindings for del-word-left and del-word-right. M EditorWindow.py M NEWS.txt M config-keys.def M configHandler.py --- Lib/idlelib/EditorWindow.py | 10 ++++++++++ Lib/idlelib/NEWS.txt | 9 ++++++++- Lib/idlelib/config-keys.def | 6 ++++++ Lib/idlelib/configHandler.py | 4 +++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 0f14662..31f400c 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -141,6 +141,8 @@ class EditorWindow(object): text.bind("<>",self.change_indentwidth_event) text.bind("", self.move_at_edge_if_selection(0)) text.bind("", self.move_at_edge_if_selection(1)) + text.bind("<>", self.del_word_left) + text.bind("<>", self.del_word_right) if flist: flist.inversedict[self] = key @@ -386,6 +388,14 @@ class EditorWindow(object): pass return move_at_edge + def del_word_left(self, event): + self.text.event_generate('') + return "break" + + def del_word_right(self, event): + self.text.event_generate('') + return "break" + def find_event(self, event): SearchDialog.find(self.text) return "break" diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 1f64ee9..fd01d33 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,17 +3,24 @@ What's New in IDLE 1.2a0? *Release date: XX-XXX-2005* +- Add keybindings for del-word-left and del-word-right. + - Discourage using an indent width other than 8 when using tabs to indent Python code. - Restore use of EditorWindow.set_indentation_params(), was dead code since - Autoindent was merged into EditorWindow. + Autoindent was merged into EditorWindow. This allows IDLE to conform to the + indentation width of a loaded file. (But it still will not switch to tabs + even if the file uses tabs.) Any change in indent width is local to that + window. - Add Tabnanny check before Run/F5, not just when Checking module. - If an extension can't be loaded, print warning and skip it instead of erroring out. +- Improve error handling when .idlerc can't be created (warn and exit). + - The GUI was hanging if the shell window was closed while a raw_input() was pending. Restored the quit() of the readline() mainloop(). http://mail.python.org/pipermail/idle-dev/2004-December/002307.html diff --git a/Lib/idlelib/config-keys.def b/Lib/idlelib/config-keys.def index 05b0cf4..0653746 100644 --- a/Lib/idlelib/config-keys.def +++ b/Lib/idlelib/config-keys.def @@ -55,6 +55,8 @@ tabify-region= untabify-region= toggle-tabs= change-indentwidth= +del-word-left= +del-word-right= [IDLE Classic Unix] copy= @@ -104,6 +106,8 @@ tabify-region= untabify-region= toggle-tabs= change-indentwidth= +del-word-left= +del-word-right= [IDLE Classic Mac] copy= @@ -153,3 +157,5 @@ tabify-region= untabify-region= toggle-tabs= change-indentwidth= +del-word-left= +del-word-right= diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py index ea913c7..191a87c 100644 --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/configHandler.py @@ -579,7 +579,9 @@ class IdleConf: '<>': [''], '<>': [''], '<>': [''], - '<>': [''] + '<>': [''], + '<>': [''], + '<>': [''] } if keySetName: for event in keyBindings.keys(): -- cgit v0.12