Repository: microsoft/terminal
File: src/buffer/out/search.h (C/C++)

Code before:
           const std::wstring_view str,
           const Direction dir,
           const Sensitivity sensitivity);

    Search(Microsoft::Console::Render::IRenderData& uiaData,
           const std::wstring_view str,
           const Direction dir,
           const Sensitivity sensitivity,
           const til::point anchor);

    bool FindNext();
    void Select() const;
    void Color(const TextAttribute attr) const;

    std::pair<til::point, til::point> GetFoundLocation() const noexcept;

private:
    wchar_t _ApplySensitivity(const wchar_t wch) const noexcept;
    bool _FindNeedleInHaystackAt(const til::point pos, til::point& start, til::point& end) const;
    bool _CompareChars(const std::wstring_view one, const std::wstring_view two) const noexcept;
    void _UpdateNextPosition();

    void _IncrementCoord(til::point& coord) const noexcept;
    void _DecrementCoord(til::point& coord) const noexcept;

    static til::point s_GetInitialAnchor(const Microsoft::Console::Render::IRenderData& uiaData, const Direction dir);

    static std::vector<std::vector<wchar_t>> s_CreateNeedleFromString(const std::wstring_view wstr);

    bool _reachedEnd = false;
    til::point _coordNext;
    til::point _coordSelStart;
    til::point _coordSelEnd;

    const til::point _coordAnchor;
    const std::vector<std::vector<wchar_t>> _needle;
    const Direction _direction;
    const Sensitivity _sensitivity;
    Microsoft::Console::Render::IRenderData& _uiaData;

#ifdef UNIT_TESTING
    friend class SearchTests;
#endif
};


Review comment (suggestion):
```suggestion
    static til::point s_GetInitialAnchor(const Microsoft::Console::Render::IRenderData& renderData, const Direction dir);
```

Code after:
           const std::wstring_view str,
           const Direction dir,
           const Sensitivity sensitivity);

    Search(Microsoft::Console::Render::IRenderData& renderData,
           const std::wstring_view str,
           const Direction dir,
           const Sensitivity sensitivity,
           const til::point anchor);

    bool FindNext();
    void Select() const;
    void Color(const TextAttribute attr) const;

    std::pair<til::point, til::point> GetFoundLocation() const noexcept;

private:
    wchar_t _ApplySensitivity(const wchar_t wch) const noexcept;
    bool _FindNeedleInHaystackAt(const til::point pos, til::point& start, til::point& end) const;
    bool _CompareChars(const std::wstring_view one, const std::wstring_view two) const noexcept;
    void _UpdateNextPosition();

    void _IncrementCoord(til::point& coord) const noexcept;
    void _DecrementCoord(til::point& coord) const noexcept;

    static til::point s_GetInitialAnchor(const Microsoft::Console::Render::IRenderData& renderData, const Direction dir);

    static std::vector<std::wstring> s_CreateNeedleFromString(const std::wstring_view wstr);

    bool _reachedEnd = false;
    til::point _coordNext;
    til::point _coordSelStart;
    til::point _coordSelEnd;

    const til::point _coordAnchor;
    const std::vector<std::wstring> _needle;
    const Direction _direction;
    const Sensitivity _sensitivity;
    Microsoft::Console::Render::IRenderData& _renderData;

#ifdef UNIT_TESTING
    friend class SearchTests;
#endif
};