mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(edit_indent_width, edit_insert_indent): move to wordproc.c and make static.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
ca26181f5d
commit
c466b18f67
@ -285,8 +285,6 @@ void book_mark_restore (WEdit * edit, int color);
|
|||||||
|
|
||||||
gboolean edit_line_is_blank (WEdit * edit, long line);
|
gboolean edit_line_is_blank (WEdit * edit, long line);
|
||||||
gboolean is_break_char (char c);
|
gboolean is_break_char (char c);
|
||||||
long edit_indent_width (const WEdit * edit, off_t p);
|
|
||||||
void edit_insert_indent (WEdit * edit, int indent);
|
|
||||||
void edit_options_dialog (WDialog * h);
|
void edit_options_dialog (WDialog * h);
|
||||||
void edit_syntax_dialog (WEdit * edit);
|
void edit_syntax_dialog (WEdit * edit);
|
||||||
void edit_mail_dialog (WEdit * edit);
|
void edit_mail_dialog (WEdit * edit);
|
||||||
|
@ -3196,37 +3196,6 @@ edit_delete_line (WEdit * edit)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
long
|
|
||||||
edit_indent_width (const WEdit * edit, off_t p)
|
|
||||||
{
|
|
||||||
off_t q = p;
|
|
||||||
|
|
||||||
/* move to the end of the leading whitespace of the line */
|
|
||||||
while (strchr ("\t ", edit_buffer_get_byte (&edit->buffer, q)) && q < edit->last_byte - 1)
|
|
||||||
q++;
|
|
||||||
/* count the number of columns of indentation */
|
|
||||||
return (long) edit_move_forward3 (edit, p, 0, q);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
void
|
|
||||||
edit_insert_indent (WEdit * edit, int indent)
|
|
||||||
{
|
|
||||||
if (!option_fill_tabs_with_spaces)
|
|
||||||
{
|
|
||||||
while (indent >= TAB_SIZE)
|
|
||||||
{
|
|
||||||
edit_insert (edit, '\t');
|
|
||||||
indent -= TAB_SIZE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (indent-- > 0)
|
|
||||||
edit_insert (edit, ' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
edit_push_key_press (WEdit * edit)
|
edit_push_key_press (WEdit * edit)
|
||||||
{
|
{
|
||||||
|
@ -354,6 +354,37 @@ replace_at (WEdit * edit, long q, int c)
|
|||||||
edit_insert_ahead (edit, c);
|
edit_insert_ahead (edit, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
static long
|
||||||
|
edit_indent_width (const WEdit * edit, off_t p)
|
||||||
|
{
|
||||||
|
off_t q = p;
|
||||||
|
|
||||||
|
/* move to the end of the leading whitespace of the line */
|
||||||
|
while (strchr ("\t ", edit_buffer_get_byte (&edit->buffer, q)) != NULL
|
||||||
|
&& q < edit->last_byte - 1)
|
||||||
|
q++;
|
||||||
|
/* count the number of columns of indentation */
|
||||||
|
return (long) edit_move_forward3 (edit, p, 0, q);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
static void
|
||||||
|
edit_insert_indent (WEdit * edit, long indent)
|
||||||
|
{
|
||||||
|
if (!option_fill_tabs_with_spaces)
|
||||||
|
while (indent >= TAB_SIZE)
|
||||||
|
{
|
||||||
|
edit_insert (edit, '\t');
|
||||||
|
indent -= TAB_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (indent-- > 0)
|
||||||
|
edit_insert (edit, ' ');
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
/** replaces a block of text */
|
/** replaces a block of text */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user