IIRC, magit-stage-item only looks at the region when the cursor is
inside a diff hunk, and it assumes you're trying to stage some of the
lines in the hunk without staging the whole thing.

Seeing all the files in the magit-section structure is a red herring.
The sections form a tree with pointers to parents and children, so if
you print one out you'll actually see every section in the buffer.

On Saturday, July 2, 2011,  <[email protected]> wrote:
&gt; I am seeing the same problem. I am on Windows, Emacs version
23.3.1. The problem is the same whether or not transient-mark-mode is
on.
&gt; I did it is a bit of poking around to see what the problem might
be. Within the body of magit-stage-item, item is correctly bound to a
data structure containing all the files present in the region:
&gt; [cl-struct-magit-section [cl-struct-magit-section
[cl-struct-magit-section nil status 1 3393 ([cl-struct-magit-section
#2 untracked 145 1981 ... nil nil nil nil] [cl-struct-magit-section #2
stashes 1982 2143 ... nil nil nil nil] #1 [cl-struct-magit-section #2
unpushed 2487 3392 ... nil nil nil nil]) nil nil nil nil] unstaged
2144 2486 ([cl-struct-magit-section #1
&quot;collects/drracket/private/debug.rkt&quot; 2153 2199 nil t diff
... t] [cl-struct-magit-section #1
&quot;collects/drracket/private/rep.rkt&quot; 2199 2243 nil t diff ...
t] [cl-struct-magit-section #1
&quot;collects/lang/htdp-langs.rkt&quot; 2243 2282 nil t diff ... t]
[cl-struct-magit-section #1
&quot;collects/lang/private/teach.rkt&quot; 2282 2324 nil t diff ...
t] [cl-struct-magit-section #1
&quot;collects/scribblings/htdp-langs/beginner-abbr.scrbl&quot; 2324
2386 nil t diff ... t] [cl-struct-magit-section #1
&quot;collects/scribblings/htdp-langs/prim-ops.rkt&quot; 2386 2441 nil
t diff ... t] #0) nil nil nil nil]
&quot;collects/syntax/colored-errors.rkt&quot; 2441 2486 nil t diff
(modified &quot;collects/syntax/colored-errors.rkt&quot; nil) t]
&gt; but (magit-diff-item-file item) in magit-stage-item returns a single file.
&gt; I would be happy to help find the necessary conditions to
reproduce the bug on the developer's machines.

-- 

-PJ

Reply via email to