<commit_before>#include <string>

#include "configuration.hh"

namespace vick {

int from_visual(const std::string& cont, int x) {
    if(cont.size() == 0) return 0;
    int count = 0,
        til = 0;
    int numTab = 0;
    for(unsigned int i = 0; i < cont.length(); i++) {
        unsigned int len;
        if(cont[i] == '\t') {
            len = TAB_SIZE - 1 - til;
            til = 0;
            numTab++;
        } else {
            len = 1;
            til++;
            til %= TAB_SIZE;
        }
        count += len;
        if(count > x - numTab) return i;
    }
    return -1;
}

int to_visual(const std::string& cont, int x) {
    int til = 0,
        xx = -1;
    for(std::string::const_iterator i = cont.begin();
                i <= cont.begin() + x; ++i) {
        if(*i == '\t') {
            xx += TAB_SIZE - til;
            til = 0;<commit_msg>Use ``size_t`` for array types<commit_after>#include <string>

#include "configuration.hh"

namespace vick {

int from_visual(const std::string& cont, int x) {
    if(cont.size() == 0) return 0;
    int count = 0,
        til = 0;
    int numTab = 0;
    for(size_t i = 0; i < cont.length(); i++) {
        size_t len;
        if(cont[i] == '\t') {
            len = TAB_SIZE - 1 - til;
            til = 0;
            numTab++;
        } else {
            len = 1;
            til++;
            til %= TAB_SIZE;
        }
        count += len;
        if(count > x - numTab) return i;
    }
    return -1;
}

int to_visual(const std::string& cont, int x) {
    int til = 0,
        xx = -1;
    for(std::string::const_iterator i = cont.begin();
                i <= cont.begin() + x; ++i) {
        if(*i == '\t') {
            xx += TAB_SIZE - til;
            til = 0;
{'fraction_non_alphanumeric': 0.1572002294893861, 'fraction_numerical': 0.01491681009753299, 'mean_word_length': 1.4667609618104667, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1593091', 'n_tokens_mistral': 629, 'n_tokens_neox': 589, 'n_words': 167}