From fc53a80395d569d94bd98e3aa3cdc3baf7baea4d Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 1 Oct 2014 23:41:06 +0100 Subject: [PATCH] Small refactor --- src/selectors.cc | 30 +++++++++++++++--------------- 1 file 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();