Open fritzophrenic opened 8 years ago
Confirmed this works (mostly) as intended on Windows 7: the max size of the edit box keeps growing as I type. Sometimes I can type or paste faster than the box grows, and I need to try a second time, but it keeps growing to fit more data so it always works the second time. So this seems to be another Linux issue. I'll see if any exceptions get raised next time I poke around on my Ubuntu system.
No exception when trying to exceed the character limit. However, after pasting enough text to exceed the limit, and then typing CTRL
+SHIFT
+HOME
to try selecting all text in the dialog, I get:
System.IndexOutOfRangeException: Array index is out of range.
at System.Windows.Forms.Document.Invalidate (System.Windows.Forms.Line start, Int32 start_pos, System.Windows.Forms.Line end, Int32 end_pos) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Document.SetSelectionToCaret (Boolean start) [0x00000] in <filename unknown>:0
at System.Windows.Forms.TextBoxBase.ProcessKey (Keys keyData) [0x00000] in <filename unknown>:0
at System.Windows.Forms.TextBoxBase.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
at System.Windows.Forms.TextBox.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0
So something odd is going on. After repeating a few times, cancelling the dialog, and trying again, I got a fatal exception:
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at System.Windows.Forms.XplatUIX11.DestroyOffscreenDrawable (System.Object offscreen_drawable) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUI.DestroyOffscreenDrawable (System.Object offscreen_drawable) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control+DoubleBuffer.Dispose () [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.DisposeBackBuffer () [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.OnSizeChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.UpdateBounds (Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.UpdateBounds (Int32 x, Int32 y, Int32 width, Int32 height) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.SetBoundsCoreInternal (Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.SetBoundsCore (Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStrip.SetBoundsCore (Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.SetBoundsInternal (Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:SetBoundsInternal (int,int,int,int,System.Windows.Forms.BoundsSpecified)
at System.Windows.Forms.Layout.DefaultLayout.LayoutDockedChildren (System.Windows.Forms.Control parent, System.Windows.Forms.Control[] controls) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Layout.DefaultLayout.Layout (System.Object container, System.Windows.Forms.LayoutEventArgs args) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.OnLayout (System.Windows.Forms.LayoutEventArgs levent) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ScrollableControl.OnLayout (System.Windows.Forms.LayoutEventArgs levent) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ContainerControl.OnLayout (System.Windows.Forms.LayoutEventArgs e) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Form.OnLayout (System.Windows.Forms.LayoutEventArgs levent) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.PerformLayout (System.Windows.Forms.Control affectedControl, System.String affectedProperty) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.PerformLayout () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:PerformLayout ()
at System.Windows.Forms.Control.OnLayout (System.Windows.Forms.LayoutEventArgs levent) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ScrollableControl.OnLayout (System.Windows.Forms.LayoutEventArgs levent) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStrip.OnLayout (System.Windows.Forms.LayoutEventArgs e) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.PerformLayout (System.Windows.Forms.Control affectedControl, System.String affectedProperty) [0x00000] in <filename unknown>:0
at System.Windows.Forms.Control.PerformLayout () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:PerformLayout ()
at System.Windows.Forms.ToolStripItem.OnParentChanged (System.Windows.Forms.ToolStrip oldParent, System.Windows.Forms.ToolStrip newParent) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripItem.set_Parent (System.Windows.Forms.ToolStrip value) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.ToolStripItem:set_Parent (System.Windows.Forms.ToolStrip)
at System.Windows.Forms.ToolStripItemCollection.Remove (System.Windows.Forms.ToolStripItem value) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripItem.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripDropDownItem.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
at System.ComponentModel.Component.Finalize () [0x00000] in <filename unknown>:0
I'm sorry, I've been swamped at work for a while (and will probably stay like that for a couple of months still, probably until mid summer)
Thanks for all the details... All of my linux machines are headless, so it's going to be hard for me to help out debugging this... until I find some time to install X and Mono on one of them...
Maybe we should launch a discussion about replacing the textbox with another control that will handle a large number of word/char better...
I'm sorry, I've been swamped at work for a while (and will probably stay like that for a couple of months still, probably until mid summer)
Probably me too, for now. Plus I've got another few projects that need my attention. :-)
At least the generation and display portions work. So I can copy config files from Windows or edit them by hand, and the plugin is usable after that.
Thanks for all the details... All of my linux machines are headless, so it's going to be hard for me to help out debugging this... until I find some time to install X and Mono on one of them...
My guess is a more recent mono will improve things, although maybe not fix them entirely. Mine is a little old.
Maybe we should launch a discussion about replacing the textbox with another control that will handle a large number of word/char better...
If you know of one, not a bad idea. I don't have any experience there, however.
Intercepting paste operations to resize the box first would be great, if it will work cross platform. Not sure if any mechanism allows that in current control.
According to this http://stackoverflow.com/questions/4845040/make-multiline-textbox-hold-more-text-c-winform RichText might work, not sure how it would react under mono...
Tested using latest KeePass Portable (2.34) and this issue still exists. Still need to test upgrading mono.
Also occurs with mono 4.6.1.3.
I thought this was fixed (maybe it's just another Linux thing) but if you type up to the max size of the edit box for editing a custom word list, the edit box stops accepting new characters.
The intent was that the box would expand to fit more characters as you approach the size limit.
Best case would be to allow pasting text of any size, but at the very least, we should expand as the user types.