Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
kicad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
KiCad
KiCad Source Code
kicad
Commits
0dddb274
Commit
0dddb274
authored
1 year ago
by
Jeff Young
Browse files
Options
Downloads
Patches
Plain Diff
Include underscore in word chars.
Fixes
#14779
parent
cbcaaa00
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#993645339
passed
1 year ago
Stage: build
Stage: test
Stage: report
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/eda_item.cpp
+16
-4
16 additions, 4 deletions
common/eda_item.cpp
with
16 additions
and
4 deletions
common/eda_item.cpp
+
16
−
4
View file @
0dddb274
...
...
@@ -114,6 +114,12 @@ wxString EDA_ITEM::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
}
bool
isWordChar
(
const
wxUniChar
&
c
)
{
return
wxIsalnum
(
c
)
||
c
==
'_'
;
}
bool
EDA_ITEM
::
Matches
(
const
wxString
&
aText
,
const
EDA_SEARCH_DATA
&
aSearchData
)
const
{
wxString
text
=
aText
;
...
...
@@ -129,6 +135,12 @@ bool EDA_ITEM::Matches( const wxString& aText, const EDA_SEARCH_DATA& aSearchDat
searchText
.
MakeUpper
();
}
auto
isWordChar
=
[](
const
wxUniChar
&
c
)
{
return
wxIsalnum
(
c
)
||
c
==
'_'
;
};
if
(
aSearchData
.
matchMode
==
EDA_SEARCH_MATCH_MODE
::
PERMISSIVE
)
{
EDA_COMBINED_MATCHER
matcher
(
searchText
,
CTX_SEARCH
);
...
...
@@ -149,8 +161,8 @@ bool EDA_ITEM::Matches( const wxString& aText, const EDA_SEARCH_DATA& aSearchDat
ii
=
next
;
next
+=
searchText
.
length
();
bool
startOK
=
(
ii
==
0
||
!
wxIsalnum
(
text
.
GetChar
(
ii
-
1
)
)
);
bool
endOK
=
(
next
==
(
int
)
text
.
length
()
||
!
wxIsalnum
(
text
.
GetChar
(
next
)
)
);
bool
startOK
=
(
ii
==
0
||
!
isWordChar
(
text
.
GetChar
(
ii
-
1
)
)
);
bool
endOK
=
(
next
==
(
int
)
text
.
length
()
||
!
isWordChar
(
text
.
GetChar
(
next
)
)
);
if
(
startOK
&&
endOK
)
return
true
;
...
...
@@ -207,8 +219,8 @@ bool EDA_ITEM::Replace( const EDA_SEARCH_DATA& aSearchData, wxString& aText )
if
(
aSearchData
.
matchMode
==
EDA_SEARCH_MATCH_MODE
::
WHOLEWORD
)
{
startOK
=
(
ii
==
0
||
!
wxIsalnum
(
text
.
GetChar
(
ii
-
1
)
)
);
endOK
=
(
next
==
(
int
)
text
.
length
()
||
!
wxIsalnum
(
text
.
GetChar
(
next
)
)
);
startOK
=
(
ii
==
0
||
!
isWordChar
(
text
.
GetChar
(
ii
-
1
)
)
);
endOK
=
(
next
==
(
int
)
text
.
length
()
||
!
isWordChar
(
text
.
GetChar
(
next
)
)
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Jeff Young
@jeffyoung
mentioned in commit
4d46e0ce
·
1 year ago
mentioned in commit
4d46e0ce
mentioned in commit 4d46e0ceb73f9ab3820477e6cf43e8042da0dbc5
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment