summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-10-01 23:41:06 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-10-01 23:41:06 +0100
commitfc53a80395d569d94bd98e3aa3cdc3baf7baea4d (patch)
tree47c5206c1425b1de7f1fbb8b8c5d8bfc648b9019 /src
parentcf01227e1ce29a6694d9efbf23175d8498e43638 (diff)
Small refactor
Diffstat (limited to 'src')
-rw-r--r--src/selectors.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/selectors.cc b/src/selectors.cc
index e8a3000b..38f25aab 100644
--- a/src/selectors.cc
+++ b/src/selectors.cc
@@ -363,21 +363,6 @@ Selection select_paragraph(const Buffer& buffer, const Selection& selection, Obj
: Selection{last.coord(), first.coord()};
}
-static CharCount get_indent(const String& str, int tabstop)
-{
- CharCount indent = 0;
- for (auto& c : str)
- {
- if (c == ' ')
- ++indent;
- else if (c =='\t')
- indent = (indent / tabstop + 1) * tabstop;
- else
- break;
- }
- return indent;
-}
-
Selection select_whitespaces(const Buffer& buffer, const Selection& selection, ObjectFlags flags)
{
auto is_whitespace = [&](char c) {
@@ -407,6 +392,21 @@ Selection select_whitespaces(const Buffer& buffer, const Selection& selection, O
: utf8_range(last, first);
}
+static CharCount get_indent(const String& str, int tabstop)
+{
+ CharCount indent = 0;
+ for (auto& c : str)
+ {
+ if (c == ' ')
+ ++indent;
+ else if (c =='\t')
+ indent = (indent / tabstop + 1) * tabstop;
+ else
+ break;
+ }
+ return indent;
+}
+
static bool is_only_whitespaces(const String& str)
{
auto it = str.begin();