Browse Source

bim: fix two minor bugs

K. Lange 2 years ago
parent
commit
3b3907183f
1 changed files with 11 additions and 4 deletions
  1. 11 4
      apps/bim.c

+ 11 - 4
apps/bim.c

@@ -7801,10 +7801,6 @@ void big_word_left(void) {
 	do {
 		col_no--;
 		if (col_no == 0) {
-			col_no = 1;
-			break;
-		}
-		if (col_no == 1) {
 			env->col_no = 1;
 			env->line_no = line_no;
 			set_preferred_column();
@@ -8265,6 +8261,7 @@ void find_character(int type, int c) {
 			if (env->lines[env->line_no-1]->text[i-1].codepoint == c) {
 				env->col_no = i - !!(type == 't');
 				place_cursor_actual();
+				set_preferred_column();
 				return;
 			}
 		}
@@ -8273,6 +8270,7 @@ void find_character(int type, int c) {
 			if (env->lines[env->line_no-1]->text[i-1].codepoint == c) {
 				env->col_no = i + !!(type == 'T');
 				place_cursor_actual();
+				set_preferred_column();
 				return;
 			}
 		}
@@ -9936,6 +9934,15 @@ void normal_mode(void) {
 									}
 								}
 							}
+							if (global_config.yank_is_full_lines) {
+								env->col_no = 1;
+								for (int i = 0; i < env->lines[env->line_no-1]->actual; ++i) {
+									if (!is_whitespace(env->lines[env->line_no-1]->text[i].codepoint)) {
+										env->col_no = i + 1;
+										break;
+									}
+								}
+							}
 							set_history_break();
 							set_modified();
 							redraw_all();