Skip to content

Commit 8002a7b

Browse files
committed
Small improvements after last merge.
1 parent c1bc565 commit 8002a7b

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

PluginCore/PluginCore/Controls/CompletionList.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static public void SelectItem(String name)
124124
}
125125

126126
/// <summary>
127-
/// Require that completion items are explicitly inserted (Enter, Tab, mouse-click)
127+
/// Require that completion items are explicitely inserted (Enter, Tab, mouse-click)
128128
/// </summary>
129129
public static void DisableAutoInsertion()
130130
{

PluginCore/PluginCore/Controls/CompletionListControl.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ public int SmartMatch(string label, string word, int len)
731731
{
732732
if (label.StartsWith(word, StringComparison.OrdinalIgnoreCase))
733733
{
734-
if (label.StartsWith(word)) return 1;
734+
if (label.StartsWithOrdinal(word)) return 1;
735735
else return 5;
736736
}
737737
return 0;
@@ -751,15 +751,15 @@ public int SmartMatch(string label, string word, int len)
751751
int p2;
752752
if (firstUpper) // try case sensitive search
753753
{
754-
p2 = label.IndexOf(word);
754+
p2 = label.IndexOfOrdinal(word);
755755
if (p2 >= 0)
756756
{
757-
int p3 = label.LastIndexOf("." + word); // in qualified type name
757+
int p3 = label.LastIndexOfOrdinal("." + word); // in qualified type name
758758
if (p3 > 0)
759759
{
760760
if (p3 == label.LastIndexOf('.'))
761761
{
762-
if (label.EndsWith("." + word)) return 1;
762+
if (label.EndsWithOrdinal("." + word)) return 1;
763763
else return 3;
764764
}
765765
else return 4;
@@ -829,7 +829,7 @@ public int IsAbbreviation(string label, string word)
829829
}
830830
else
831831
{
832-
p2 = label.IndexOf("." + c);
832+
p2 = label.IndexOfOrdinal("." + c);
833833
if (p2 >= 0) { score = 2; p2++; }
834834
else
835835
{
@@ -844,7 +844,7 @@ public int IsAbbreviation(string label, string word)
844844
{
845845
p = p2;
846846
c = word[i++];
847-
if (char.IsUpper(c)) p2 = label.IndexOf(c.ToString(), p + 1);
847+
if (char.IsUpper(c)) p2 = label.IndexOfOrdinal(c.ToString(), p + 1);
848848
else p2 = label.IndexOf(c.ToString(), p + 1, StringComparison.OrdinalIgnoreCase);
849849
if (p2 < 0) return 0;
850850

@@ -858,7 +858,7 @@ public int IsAbbreviation(string label, string word)
858858
}
859859
if (dist == len - 1)
860860
{
861-
if (label == word || label.EndsWith("." + word)) return 1;
861+
if (label == word || label.EndsWithOrdinal("." + word)) return 1;
862862
return score;
863863
}
864864
else return score + 2;
@@ -895,9 +895,9 @@ public bool ReplaceText(string tail, char trigger)
895895
{
896896
if (word != null && tail.Length > 0)
897897
{
898-
if (replace.StartsWith(word, StringComparison.OrdinalIgnoreCase) && replace.IndexOf(tail) >= word.Length)
898+
if (replace.StartsWith(word, StringComparison.OrdinalIgnoreCase) && replace.IndexOfOrdinal(tail) >= word.Length)
899899
{
900-
replace = replace.Substring(0, replace.IndexOf(tail));
900+
replace = replace.Substring(0, replace.IndexOfOrdinal(tail));
901901
}
902902
}
903903
host.BeginUndoAction();

PluginCore/ScintillaNet/ScintillaControl.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
using System;
2-
using System.Collections;
32
using System.Collections.Generic;
43
using System.ComponentModel;
54
using System.Drawing;
65
using System.Drawing.Printing;
76
using System.IO;
87
using System.Runtime.InteropServices;
98
using System.Text;
10-
using System.Drawing;
119
using System.Windows.Forms;
1210
using ScintillaNet.Configuration;
1311
using PluginCore.FRService;

0 commit comments

Comments
 (0)