Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37787581
en ru br
Репозитории ALT
S:4.8.30-alt3
5.1: 4.8.11-alt0.M51.1
4.1: 4.6.2-alt7.pre1
4.0: 4.6.1r-alt9
3.0: 4.6.1r-alt3
www.altlinux.org/Changes

Группа :: Работа с файлами
Пакет: mc

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: mc-4.8.30-savannah-edit-homekey.patch
Скачать


diff -uNrbbwp mc-4.8.30/src/editor/edit.c mc-4.8.30-new/src/editor/edit.c
--- mc-4.8.30/src/editor/edit.c	2023-08-13 18:52:25.000000000 +0000
+++ mc-4.8.30-new/src/editor/edit.c	2023-09-08 19:10:24.686942062 +0000
@@ -835,6 +835,26 @@ edit_end_page (WEdit * edit)
     edit_move_down (edit, WIDGET (edit)->rect.lines - edit->curs_row - 1, FALSE);
 }
 
+/* returns index of first char on line or the first nonspace char */
+long edit_bol_var (WEdit * edit, long current)
+{
+    long tmp;
+    int b;
+    
+    if (current < 0)
+	return 0;
+	
+    if (edit_get_byte (edit, current - 1) != '\n')	/* not at BOL */
+	return edit_bol (edit, current);
+
+    if (edit_get_byte (edit, current) == '\n')		/* on an empty line */
+	return current;
+
+    for (tmp = current; (b = edit_get_byte (edit, tmp)) != '\n'; tmp++)
+	if (b != ' ' && b != '\t')
+	    return tmp;
+    return current;
+}
 
 /* --------------------------------------------------------------------------------------------- */
 /** goto beginning of text */
@@ -874,7 +894,8 @@ edit_move_to_bottom (WEdit * edit)
 static void
 edit_cursor_to_bol (WEdit * edit)
 {
-    edit_cursor_move (edit, edit_buffer_get_current_bol (&edit->buffer) - edit->buffer.curs1);
+    edit_cursor_move (edit, edit_bol_var (edit, edit->curs1) - edit->curs1);
+//    edit_cursor_move (edit, edit_buffer_get_current_bol (&edit->buffer) - edit->buffer.curs1);
     edit->search_start = edit->buffer.curs1;
     edit->prev_col = edit_get_col (edit);
     edit->over_col = 0;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin