changeset 49614:1da4c425c852

(ido-define-mode-map): Undo last change (duplicates part of 2003-02-04 change). Remap `viper' delete commands only in file or dir mode.
author Kim F. Storm <storm@cua.dk>
date Wed, 05 Feb 2003 22:04:02 +0000
parents a58ef66df9f7
children 0ddc2f13992e
files lisp/ido.el
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ido.el	Wed Feb 05 22:03:09 2003 +0000
+++ b/lisp/ido.el	Wed Feb 05 22:04:02 2003 +0000
@@ -1324,8 +1324,6 @@
       (define-key map [(meta down)] 'ido-next-work-directory)
       (define-key map [backspace] 'ido-delete-backward-updir)
       (define-key map "\d"        'ido-delete-backward-updir)
-      (define-key map [remap viper-backward-char] 'ido-delete-backward-updir)
-      (define-key map [remap viper-del-backward-char-in-insert] 'ido-delete-backward-updir)
       (define-key map [(meta backspace)] 'ido-delete-backward-word-updir)
       (define-key map [(control backspace)] 'ido-up-directory)
       (define-key map [(meta ?b)] 'ido-next-work-file)
@@ -1355,10 +1353,11 @@
       )
 
     (when (if (boundp 'viper-mode) viper-mode)
-      (define-key map [remap viper-backward-char] 'ido-delete-backward-updir)
-      (define-key map [remap viper-del-backward-char-in-insert] 'ido-delete-backward-updir)
-      (define-key map [remap viper-delete-backward-word] 'ido-delete-backward-word-updir)
-      (define-key map [remap viper-intercept-ESC-key] 'ignore))
+      (define-key map [remap viper-intercept-ESC-key] 'ignore)
+      (when (memq ido-cur-item '(file dir))
+	(define-key map [remap viper-backward-char] 'ido-delete-backward-updir)
+	(define-key map [remap viper-del-backward-char-in-insert] 'ido-delete-backward-updir)
+	(define-key map [remap viper-delete-backward-word] 'ido-delete-backward-word-updir)))
 
     (setq ido-mode-map map)
     (run-hooks 'ido-define-mode-map-hook)))