MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / FindHotstring

Method FindHotstring

source/hotkey.cpp:2549–2563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2547
2548
2549Hotstring *Hotstring::FindHotstring(LPTSTR aHotstring, bool aCaseSensitive, bool aDetectWhenInsideWord, HotkeyCriterion *aHotCriterion)
2550{
2551 for (UINT u = 0; u < sHotstringCount; ++u)
2552 {
2553 Hotstring &hs = *shs[u];
2554 // hs.mEndCharRequired is not checked because although it affects the conditions for activating
2555 // the hotstring, ::abbrev:: and :*:abbrev:: cannot co-exist (the latter would always take over).
2556 if ( hs.mHotCriterion == aHotCriterion // Same #HotIf criterion.
2557 && hs.mCaseSensitive == aCaseSensitive // ::BTW:: and :C:BTW:: can co-exist.
2558 && hs.mDetectWhenInsideWord == aDetectWhenInsideWord // :?:ion:: and ::ion:: can co-exist.
2559 && (aCaseSensitive ? !_tcscmp(hs.mString, aHotstring) : !lstrcmpi(hs.mString, aHotstring)) ) // :C:BTW:: and :C:btw:: can co-exist, but not ::BTW:: and ::btw::.
2560 return &hs;
2561 }
2562 return NULL;
2563}
2564
2565
2566

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected