<commit_before>#include <map>
#include <ncurses.h>
#include <string>
#include <typeinfo>
#include <vector>

#include "configuration.hh"
#include "file_contents.hh"
#include "key_listeners.hh"
#include "show_message.hh"
#include "hooks.hh"
#include "inter_space.hh"

namespace vick {

void loop()
{
    add_listeners();

    while (true) {
        char ch = getch();
        bool b = get_contents()(ch);
        bool show = false;
        get_contents().refreshmaxyx();
        if (get_contents().refresh) {
            print_contents(get_contents());
            if (not showing_message)
                show = true;
            else
                hook_show_message();
        }
        if (not b) {
            show_message(std::string("Didn't recognize key press: '")
                          + ch + '\'');
            showing_message = false;
        } // else if (show) {
        //     int vis_y,vis_x;
        //     getyx(stdscr,vis_y,vis_x);
        //     show_message(  "y:" + std::to_string(get_contents().y) + ','
        //                  + " x:" + std::to_string(get_contents().x) + ','
        //                  + " vis_y:" + std::to_string(vis_y) + ','
        //                  + " vis_x:" + std::to_string(vis_x) + ','
        //                  + " y_offset:" + std::to_string(get_contents().y_offset)
        //                  );
        //     showing_message = false;
        // }
    }
}

}
<commit_msg>Add `const` to more variables<commit_after>#include <map>
#include <ncurses.h>
#include <string>
#include <typeinfo>
#include <vector>

#include "configuration.hh"
#include "file_contents.hh"
#include "key_listeners.hh"
#include "show_message.hh"
#include "hooks.hh"
#include "inter_space.hh"

namespace vick {

void loop()
{
    add_listeners();

    while (true) {
        const char ch = getch();
        const bool b = get_contents()(ch);
        bool show = false;
        get_contents().refreshmaxyx();
        if (get_contents().refresh) {
            print_contents(get_contents());
            if (not showing_message)
                show = true;
            else
                hook_show_message();
        }
        if (not b) {
            show_message(std::string("Didn't recognize key press: '")
                          + ch + '\'');
            showing_message = false;
        } // else if (show) {
        //     int vis_y,vis_x;
        //     getyx(stdscr,vis_y,vis_x);
        //     show_message(  "y:" + std::to_string(get_contents().y) + ','
        //                  + " x:" + std::to_string(get_contents().x) + ','
        //                  + " vis_y:" + std::to_string(vis_y) + ','
        //                  + " vis_x:" + std::to_string(vis_x) + ','
        //                  + " y_offset:" + std::to_string(get_contents().y_offset)
        //                  );
        //     showing_message = false;
        // }
    }
}

}

{'fraction_non_alphanumeric': 0.15495867768595042, 'fraction_numerical': 0.0, 'mean_word_length': 1.6289592760180995, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4361510', 'n_tokens_mistral': 935, 'n_tokens_neox': 916, 'n_words': 162}