GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fixed the bug: Pull requests(#1) · DebugST/STTextBox@61524d5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • ST.Library.UI.STTextBox/Implementation/StyleMonitor
    • SelectionStyleMonitor.cs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎ST.Library.UI.STTextBox/Implementation/StyleMonitor/SelectionStyleMonitor.cs‎

Copy file name to clipboardExpand all lines: ST.Library.UI.STTextBox/Implementation/StyleMonitor/SelectionStyleMonitor.cs
+15-18Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,23 @@ public void OnSelectionChanged(TextManager textManager, int nStart, int nLen) {
4444
});
4545

4646
// https://github.com/DebugST/STTextBox/pull/1
47-
//if ("* . ? + $ ^ [ ] ( ) { } | \\ /".Split(' ').Contains(strKey)) {
48-
// strKey = "\\" + strKey;
49-
//}
47+
// if ("* . ? + $ ^ [ ] ( ) { } | \\ /".Split(' ').Contains(strKey)) {
48+
// strKey = "\\" + strKey;
49+
// }
5050
strKey = m_reg_reg.Replace(strKey, @"\$1");
51-
if (!string.IsNullOrEmpty(strKey)) {
52-
string strText = textManager.GetText();
53-
List<TextStyleRange> lst = new List<TextStyleRange>();
54-
if ("* . ? + $ ^ [ ] ( ) { } | \\ /".Split(' ').Contains(strKey))
55-
{
56-
strKey = "\\" + strKey;
57-
}
58-
foreach (Match m in Regex.Matches(strText, "\\b" + strKey + "\\b")) { // * . ? + $ ^ [ ] ( ) { } | \ /
59-
lst.Add(new TextStyleRange() {
60-
Index = m.Index,
61-
Length = m.Length,
62-
Style = this.Style
63-
});
64-
}
65-
m_lst = TextStyleMonitor.FillDefaultStyle(lst, strText.Length, TextStyle.Empty);
51+
if (string.IsNullOrEmpty(strKey)) {
52+
return;
53+
}
54+
string strText = textManager.GetText();
55+
List<TextStyleRange> lst = new List<TextStyleRange>();
56+
foreach (Match m in Regex.Matches(strText, "\\b" + strKey + "\\b")) {
57+
lst.Add(new TextStyleRange() {
58+
Index = m.Index,
59+
Length = m.Length,
60+
Style = this.Style
61+
});
6662
}
63+
m_lst = TextStyleMonitor.FillDefaultStyle(lst, strText.Length, TextStyle.Empty);
6764
}
6865

6966
public void OnTextChanged(TextManager textManager, List<TextHistoryRecord> thrs) {

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.