aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index a696cb7e0..1557ce75e 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -106,15 +106,7 @@ constexpr bool IsLastStep(const DocModification &mh) noexcept {
&& ((mh.modificationType & finalMask) == finalMask);
}
-}
-
-Timer::Timer() noexcept :
- ticking(false), ticksToWait(0), tickerID{} {}
-
-Idler::Idler() noexcept :
- state(false), idlerID(nullptr) {}
-
-static constexpr bool IsAllSpacesOrTabs(std::string_view sv) noexcept {
+constexpr bool IsAllSpacesOrTabs(std::string_view sv) noexcept {
for (const char ch : sv) {
// This is safe because IsSpaceOrTab() will return false for null terminators
if (!IsSpaceOrTab(ch))
@@ -123,6 +115,14 @@ static constexpr bool IsAllSpacesOrTabs(std::string_view sv) noexcept {
return true;
}
+}
+
+Timer::Timer() noexcept :
+ ticking(false), ticksToWait(0), tickerID{} {}
+
+Idler::Idler() noexcept :
+ state(false), idlerID(nullptr) {}
+
Editor::Editor() : durationWrapOneByte(0.000001, 0.00000001, 0.00001) {
ctrlID = 0;
@@ -4402,7 +4402,9 @@ void Editor::GoToLine(Sci::Line lineNo) {
EnsureCaretVisible();
}
-static bool Close(Point pt1, Point pt2, Point threshold) noexcept {
+namespace {
+
+bool Close(Point pt1, Point pt2, Point threshold) noexcept {
const Point ptDifference = pt2 - pt1;
if (std::abs(ptDifference.x) > threshold.x)
return false;
@@ -4411,6 +4413,12 @@ static bool Close(Point pt1, Point pt2, Point threshold) noexcept {
return true;
}
+constexpr bool AllowVirtualSpace(VirtualSpace virtualSpaceOptions, bool rectangular) noexcept {
+ return FlagSet(virtualSpaceOptions, (rectangular ? VirtualSpace::RectangularSelection : VirtualSpace::UserAccessible));
+}
+
+}
+
std::string Editor::RangeText(Sci::Position start, Sci::Position end) const {
if (start < end) {
const Sci::Position len = end - start;
@@ -4756,10 +4764,6 @@ void Editor::MouseLeave() {
}
}
-static constexpr bool AllowVirtualSpace(VirtualSpace virtualSpaceOptions, bool rectangular) noexcept {
- return FlagSet(virtualSpaceOptions, (rectangular ? VirtualSpace::RectangularSelection : VirtualSpace::UserAccessible));
-}
-
void Editor::ButtonDownWithModifiers(Point pt, unsigned int curTime, KeyMod modifiers) {
SetHoverIndicatorPoint(pt);
//Platform::DebugPrintf("ButtonDown %d %d = %d alt=%d %d\n", curTime, lastClickTime, curTime - lastClickTime, alt, inDragDrop);