Clean unnecessary jumping

This commit is contained in:
Matúš Púll 2025-04-07 21:08:59 +02:00
parent aa2f6e2260
commit b81f74c0b2

View file

@ -61,7 +61,6 @@ void print_line(int pos) {
clear_line(pos); clear_line(pos);
move(pos, 0); move(pos, 0);
adds(get_line(pos)); adds(get_line(pos));
move(row, col);
} }
// Print file content // Print file content
void print_file(int start = 0) { void print_file(int start = 0) {
@ -83,10 +82,8 @@ void print_file(int start = 0) {
// Jump to end of line // Jump to end of line
void jump_line_end() { void jump_line_end() {
int line_size = get_line(row).size(); int line_size = get_line(row).size();
if(col > line_size) { if(col > line_size)
col = line_size; col = line_size;
move(row, col);
}
} }
// Cursor movement // Cursor movement
void move_cursor(char ch) { void move_cursor(char ch) {
@ -149,6 +146,7 @@ int main(int argc, char* argv[]) {
// Main loop // Main loop
bool run = true; bool run = true;
while(run) { while(run) {
move(row, col);
char ch = getch(); char ch = getch();
switch(mode) { switch(mode) {
case normal: case normal: