Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Diff/File List pane got exception ArgumentOutOfRangeException InvalidArgument Value of -1 is not valid for index #2759

Closed
vsevolodp opened this issue Mar 31, 2015 · 9 comments

Comments

@vsevolodp
Copy link

File names become moved right for some reason. After that I get exception when moving mouse to clear region on left of file names.
Unfortunately I can not find pattern when moving occurs.

Exception: System.ArgumentOutOfRangeException
Message: InvalidArgument=Value of '-1' is not valid for 'index'.
         Parameter name: index
Target Site: ListViewSubItem get_Item(Int32) @ System.Windows.Forms.ListViewItem+ListViewSubItemCollection
Source: System.Windows.Forms
Stack Trace:
   at System.Windows.Forms.ListViewItem.ListViewSubItemCollection.get_Item(Int32 index)
   at System.Windows.Forms.ListView.HitTest(Int32 x, Int32 y)
   at System.Windows.Forms.ListView.HitTest(Point point)
   at GitUI.FileStatusList.FileStatusListView_MouseMove(Object sender, MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseMove(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ListView.WndProc(Message& m)
   at GitUI.UserControls.ExListView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
ParamName: index
HResult: -2146233086

gitextensions_error_1
gitextensions_error_2
gitextensions_error_3

@kimitop
Copy link

kimitop commented Jul 29, 2016

In revision grid,choose a commit which difffile list shows the scrollbar to click,drag the scroll to the right end. Then choose another commit which difffile list shows no scrollbar. Then the difffile list will be strange begin with lots of whitespace. Then move the mouse to the whitespace place will occur the bug.

@jbialobr jbialobr added this to the 2.49 milestone Jul 29, 2016
@danlyons-softek
Copy link

I still get these semi-frequently in 2.49:
diff_list_exception

I have the Periodic background fetch set to run once a minute and automatically refresh the view, which causes the diff list to re-populate. Occasionally, when it reloads the list, it will have a large amount of whitespace on the left side and explode on mouse-over as kimitop explains above.

I usually leave the view on the diff tab, so I cannot say for sure if it still happens to the file list.

@vbjay
Copy link
Contributor

vbjay commented Jan 12, 2017 via email

@jbialobr
Copy link
Member

jbialobr commented Mar 3, 2017

@danlyons-softek Can you provide the callstack for your exception?

@vsevolodp
Copy link
Author

Just saw same exception as @danlyons-softek mentioned above. All versions are same.

Second tab content

Exception: System.ArgumentOutOfRangeException
Message: InvalidArgument=Value of '-1' is not valid for 'index'.
    Parameter name: index
Target Site: ListViewSubItem get_Item(Int32) @ System.Windows.Forms.ListViewItem+ListViewSubItemCollection
Source: System.Windows.Forms
Stack Trace
   at System.Windows.Forms.ListViewItem.ListViewSubItemCollection.get_Item(Int32 index)
   at System.Windows.Forms.ListView.HitTest(Int32 x, Int32 y)
   at System.Windows.Forms.ListView.HitTest(Point point)
   at GitUI.FileStatusList.FileStatusListView_MouseMove(Object sender, MouseEventArgs e)
   at System.Windows.Forms.Control.OnMouseMove(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseMove(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ListView.WndProc(Message& m)
   at GitUI.UserControls.ExListView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
ParamName: index
HResult: -2146233086

@vsevolodp
Copy link
Author

How to reproduce

  1. Select commit, go to Diff tab, make sure there is no horisontal scroll bar, resize left pane to show scroll bar
    image

  2. Scroll to most right
    image

  3. Go to File tree tab
    image

  4. Go back to Diff tab and rezise it to make wider than content
    image

@danlyons-softek
Copy link

danlyons-softek commented Mar 8, 2017

The reproduction is actually even simpler: you can skip step 3:

  1. Shrink the diff list until a scroll bar appears
  2. Scroll all the way to the right
  3. Expand the diff list past the point where the scroll bar disappears

At this point, there will be a gap to the left of the diff list.

Note that I also get the same stack trace:
at System.Windows.Forms.ListViewItem.ListViewSubItemCollection.get_Item(Int32 index)
at System.Windows.Forms.ListView.HitTest(Int32 x, Int32 y)
at System.Windows.Forms.ListView.HitTest(Point point)
at GitUI.FileStatusList.FileStatusListView_MouseMove(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ListView.WndProc(Message& m)
at GitUI.UserControls.ExListView.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

@vsevolodp
Copy link
Author

And this is reproducable on 12546ca

@KindDragon KindDragon reopened this Apr 8, 2017
@jbialobr jbialobr modified the milestones: 2.50, 2.49 Apr 13, 2017
@jbialobr
Copy link
Member

Fixed in a434093.
I do not know how to prevent listview from being missaligned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants