<commit_before>#include <ctype.h>

#include "common.h"

int inp1 = 0;
int inp2 = MAXINPUT-1;

void cur_lr(int);
void del_char(int);
void ins_char(char);
void ready_send(void);
int esccmp(char*, char*);

void
ins_char(char c)
{
	if (inp1 < inp2)
		input_bar[inp1++] = c;
}

void
del_char(int left)
{
	if (left && inp1 > 0)
		inp1--;
	else if (!left && inp2 < MAXINPUT-1)
		inp2++;
}

void
cur_lr(int left)
{
	if (left && inp1 > 0)
		input_bar[--inp2] = input_bar[--inp1];
	else if (!left && inp2 < MAXINPUT-1)
		input_bar[++inp1] = input_bar[++inp2];
}

int
esccmp(char *esc, char *inp)
{
	while (*esc++ == *inp++)
		if (*esc == '\0') return 1;<commit_msg>Fixed indexing bug on input cursor movement<commit_after>#include <ctype.h>

#include "common.h"

int inp1 = 0;
int inp2 = MAXINPUT-1;

void cur_lr(int);
void del_char(int);
void ins_char(char);
void ready_send(void);
int esccmp(char*, char*);

void
ins_char(char c)
{
	if (inp1 < inp2)
		input_bar[inp1++] = c;
}

void
del_char(int left)
{
	if (left && inp1 > 0)
		inp1--;
	else if (!left && inp2 < MAXINPUT-1)
		inp2++;
}

void
cur_lr(int left)
{
	if (left && inp1 > 0)
		input_bar[--inp2] = input_bar[--inp1];
	else if (!left && inp2 < MAXINPUT-1)
		input_bar[inp1++] = input_bar[inp2++];
}

int
esccmp(char *esc, char *inp)
{
	while (*esc++ == *inp++)
		if (*esc == '\0') return 1;
{'fraction_non_alphanumeric': 0.19402985074626866, 'fraction_numerical': 0.034328358208955224, 'mean_word_length': 3.9851301115241635, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '703956', 'n_tokens_mistral': 649, 'n_tokens_neox': 624, 'n_words': 149}