Author: mkrueger
Date: 2007-08-28 10:27:49 -0400 (Tue, 28 Aug 2007)
New Revision: 84953

Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/ChangeLog
   
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionListWindow.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/ICompletionWidget.cs
Log:
* MonoDevelop.Projects.Gui.Completion/CompletionListWindow.cs,
  MonoDevelop.Projects.Gui.Completion/ICompletionWidget.cs: Fixed
  82207: Incorrect autocomplete insertion.

Modified: trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/ChangeLog       
2007-08-28 13:57:11 UTC (rev 84952)
+++ trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/ChangeLog       
2007-08-28 14:27:49 UTC (rev 84953)
@@ -1,3 +1,9 @@
+2007-08-28  Mike Krüger <[EMAIL PROTECTED]> 
+
+       * MonoDevelop.Projects.Gui.Completion/CompletionListWindow.cs,
+         MonoDevelop.Projects.Gui.Completion/ICompletionWidget.cs: Fixed 82207:
+         Incorrect autocomplete insertion.
+
 2007-08-16  Mike Krüger <[EMAIL PROTECTED]> 
 
        * MonoDevelop.Projects.Gui.Completion/ListWindow.cs: Fixed 80813:Code

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionListWindow.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionListWindow.cs
     2007-08-28 13:57:11 UTC (rev 84952)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/CompletionListWindow.cs
     2007-08-28 14:27:49 UTC (rev 84953)
@@ -63,10 +63,11 @@
                                        text = provider.DefaultCompletionString;
                                        if (text != null && text.Length > 0)
                                                wnd.SelectEntry (text);
+                                       wnd.initialWordLength = 
wnd.completionWidget.SelectedLength;
                                        return;
                                }
                                
-                               wnd.initialWordLength = text.Length;
+                               wnd.initialWordLength = text.Length + 
wnd.completionWidget.SelectedLength;
                                wnd.PartialWord = text; 
                                //if there is only one matching result we take 
it by default
                                if (wnd.IsUniqueMatch && !wnd.IsChanging)
@@ -87,7 +88,7 @@
                                mutableProvider.CompletionDataChanged -= 
OnCompletionDataChanged;
                        }
                        
-                       initialWordLength = 0;
+                       //initialWordLength = 0;
                        this.provider = provider;
                        this.completionContext = completionContext;
                        this.closedDelegate = closedDelegate;
@@ -185,6 +186,7 @@
                void UpdateWord ()
                {
                        string word = wnd.CompleteWord;
+                       
                        if (word != null) {
                                if (wnd.Selection != -1) {
                                        IActionCompletionData ac = 
completionData [wnd.Selection] as IActionCompletionData;
@@ -195,6 +197,7 @@
                                }
                                int replaceLen = 
completionContext.TriggerWordLength + wnd.PartialWord.Length - 
initialWordLength;
                                string pword = completionWidget.GetText 
(completionContext.TriggerOffset, completionContext.TriggerOffset + replaceLen);
+                               
                                completionWidget.SetCompletionText 
(completionContext, pword, word);
                        }
                }

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/ICompletionWidget.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/ICompletionWidget.cs
        2007-08-28 13:57:11 UTC (rev 84952)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Completion/ICompletionWidget.cs
        2007-08-28 14:27:49 UTC (rev 84953)
@@ -8,6 +8,7 @@
        public interface ICompletionWidget
        {
                int TextLength { get; }
+               int SelectedLength { get; }
                string GetText (int startOffset, int endOffset);
                char GetChar (int offset);
                Gtk.Style GtkStyle { get; }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to