Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made staging of multiple files more robust

Previously via egg-status-buffer-stage-untracked-file you'd be able to
stage multiple files from a selected area, which would contain their
names. But if for example the following files where listed:

  aabc.txt
  xyz.txt

and you selected text from 'b' in the first line to 'z' in the second
line, the file names passed to git-add(1) would be: 'bc.txt' & 'xy'.

Now, this is no longer the case, the whole lines would be selected
and the area processed, so that 'aabc.txt' & 'xyz.txt' would be passed
to git-add(1).
  • Loading branch information...
commit 2fc98314144fdda6a69d20d504bb6f8f617c21f2 1 parent cecf3f6
@dotemacs authored
Showing with 15 additions and 5 deletions.
  1. +15 −5 egg.el
View
20 egg.el
@@ -2523,13 +2523,23 @@ untracked files"
(mapc #'(lambda (file)
(egg-sync-0 "add" file)
(setq files (concat files file " ")))
- (split-string
- (buffer-substring-no-properties (point) (mark)) "\n" t))
+ (progn
+ (if (< (point) (mark))
+ (progn
+ (goto-char (line-beginning-position))
+ (exchange-point-and-mark)
+ (goto-char (line-end-position)))
+ (progn
+ (goto-char (line-end-position))
+ (exchange-point-and-mark)
+ (goto-char (line-beginning-position))))
+ (split-string
+ (buffer-substring-no-properties (point) (mark)) "\n" t)))
(deactivate-mark)
- (message "new files added: %s" files))
+ (unless (string= files "")
+ (message "new files added: %s" files)))
;; act only on single files
- (let ((file (buffer-substring-no-properties
- (line-beginning-position) (line-end-position))))
+ (let ((file (ffap-file-at-point)))
(when (egg-sync-do-file file egg-git-command nil nil
(list "add" "--" file))
(message "new file %s added" file)))))
Please sign in to comment.
Something went wrong with that request. Please try again.