Permalink
Browse files

Use a default value when asking for a file to ignore

  • Loading branch information...
1 parent 224a906 commit c5a6cdc55260d0dcfff8b21628f102d68124181e @vanicat vanicat committed Sep 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 magit.el
View
@@ -5281,7 +5281,7 @@ A list of predefined values with wildcards is derived from the filename FILE."
(extension-in-dir (concat (file-name-directory file) extension))
(filename (file-name-nondirectory file))
(completions (list extension extension-in-dir filename file)))
- (magit-completing-read "File to ignore: " completions)))
+ (magit-completing-read "File to ignore: " completions () () () () file)))
(defun magit-ignore-file (file &optional edit-ignore-string local)
"Add FILE to the list of files to ignore.

1 comment on commit c5a6cdc

@dudebout
Member

We should make the default value extension (which is what happens with ido when no default value is specified, the first element of completions is taken). If I type i file is added. If I type C-u i I do not want file to be added so it should not be the default value. In my workflow, the most common use case for C-u i is to put the extension in the .gitignore. We could work on making the ordering an option for the user.

Please sign in to comment.