* edit.c: First part of the position saving code.

(edit_move_to_column): New function.
This commit is contained in:
Pavel Roskin 2002-11-30 00:35:07 +00:00
parent 085f43fc8d
commit 527cb0c64c
3 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2002-11-29 Pavel Roskin <proski@gnu.org>
* edit.c: First part of the position saving code.
(edit_move_to_column): New function.
2002-11-29 Andrew V. Samoilov <sav@bcs.zp.ua> 2002-11-29 Andrew V. Samoilov <sav@bcs.zp.ua>
* editoptions.c (edit_options_dialog): Use g_free() to release * editoptions.c (edit_options_dialog): Use g_free() to release

View File

@ -49,6 +49,7 @@ int option_return_does_auto_indent = 1;
int option_backspace_through_tabs = 0; int option_backspace_through_tabs = 0;
int option_fake_half_tabs = 1; int option_fake_half_tabs = 1;
int option_save_mode = 0; int option_save_mode = 0;
int option_save_position = 1;
int option_backup_ext_int = -1; int option_backup_ext_int = -1;
int option_max_undo = 32768; int option_max_undo = 32768;
@ -1509,6 +1510,19 @@ void edit_move_to_line (WEdit * e, long line)
edit_scroll_screen_over_cursor (e); edit_scroll_screen_over_cursor (e);
} }
/* move cursor to column 'column' */
void
edit_move_to_column (WEdit *e, long column)
{
long p; /* new cursor position */
p = min (edit_bol (e, e->curs1) + column, edit_eol (e, e->curs1));
edit_cursor_move (e, p - e->curs1);
e->search_start = e->curs1;
e->prev_col = edit_get_col (e);
edit_scroll_screen_over_cursor (e);
}
/* scroll window so that first visible line is 'line' */ /* scroll window so that first visible line is 'line' */
void edit_move_display (WEdit * e, long line) void edit_move_display (WEdit * e, long line)
{ {

View File

@ -249,6 +249,7 @@ int edit_printf (WEdit * e, const char *fmt, ...)
__attribute__ ((format (printf, 2, 3))); __attribute__ ((format (printf, 2, 3)));
int edit_print_string (WEdit * e, const char *s); int edit_print_string (WEdit * e, const char *s);
void edit_move_to_line (WEdit * e, long line); void edit_move_to_line (WEdit * e, long line);
void edit_move_to_column (WEdit * e, long column);
void edit_move_display (WEdit * e, long line); void edit_move_display (WEdit * e, long line);
void edit_word_wrap (WEdit * edit); void edit_word_wrap (WEdit * edit);
unsigned char *edit_get_block (WEdit * edit, long start, long finish, int *l); unsigned char *edit_get_block (WEdit * edit, long start, long finish, int *l);
@ -349,6 +350,7 @@ extern int option_return_does_auto_indent;
extern int option_backspace_through_tabs; extern int option_backspace_through_tabs;
extern int option_fake_half_tabs; extern int option_fake_half_tabs;
extern int option_save_mode; extern int option_save_mode;
extern int option_save_position;
extern int option_backup_ext_int; extern int option_backup_ext_int;
extern int option_max_undo; extern int option_max_undo;
extern int option_syntax_highlighting; extern int option_syntax_highlighting;