Commit 4be15f01 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

move do_(first|last)_line() to move.c

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1757 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 23 additions and 20 deletions
+23 -20
...@@ -76,6 +76,9 @@ CVS code - ...@@ -76,6 +76,9 @@ CVS code -
do_browser() do_browser()
- Call check_statblank() instead of blanking the statusbar - Call check_statblank() instead of blanking the statusbar
unconditionally, for consistency. (David Benbennick) unconditionally, for consistency. (David Benbennick)
- move.c:
do_first_line(), do_last_line()
- Move these functions here from winio.c. (DLR)
- nano.c: - nano.c:
do_toggle(), finish() do_toggle(), finish()
- Call blank_statusbar() and blank_bottombars() to blank out - Call blank_statusbar() and blank_bottombars() to blank out
......
...@@ -28,6 +28,24 @@ ...@@ -28,6 +28,24 @@
#include "proto.h" #include "proto.h"
#include "nano.h" #include "nano.h"
int do_first_line(void)
{
current = fileage;
placewewant = 0;
current_x = 0;
edit_update(current, TOP);
return 1;
}
int do_last_line(void)
{
current = filebot;
placewewant = 0;
current_x = 0;
edit_update(current, CENTER);
return 1;
}
int do_home(void) int do_home(void)
{ {
#ifndef NANO_SMALL #ifndef NANO_SMALL
......
...@@ -233,6 +233,8 @@ void thanks_for_all_the_fish(void); ...@@ -233,6 +233,8 @@ void thanks_for_all_the_fish(void);
#endif #endif
/* Public functions in move.c */ /* Public functions in move.c */
int do_first_line(void);
int do_last_line(void);
int do_home(void); int do_home(void);
int do_end(void); int do_end(void);
int do_page_up(void); int do_page_up(void);
...@@ -478,8 +480,6 @@ int get_escape_seq_abcd(int kbinput); ...@@ -478,8 +480,6 @@ int get_escape_seq_abcd(int kbinput);
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
int get_mouseinput(int *mouse_x, int *mouse_y, int shortcut); int get_mouseinput(int *mouse_x, int *mouse_y, int shortcut);
#endif #endif
int do_first_line(void);
int do_last_line(void);
size_t xplustabs(void); size_t xplustabs(void);
size_t actual_x(const char *str, size_t xplus); size_t actual_x(const char *str, size_t xplus);
size_t strnlenpt(const char *buf, size_t size); size_t strnlenpt(const char *buf, size_t size);
......
...@@ -1013,24 +1013,6 @@ int get_mouseinput(int *mouse_x, int *mouse_y, int allow_shortcuts) ...@@ -1013,24 +1013,6 @@ int get_mouseinput(int *mouse_x, int *mouse_y, int allow_shortcuts)
} }
#endif #endif
int do_first_line(void)
{
current = fileage;
placewewant = 0;
current_x = 0;
edit_update(current, TOP);
return 1;
}
int do_last_line(void)
{
current = filebot;
placewewant = 0;
current_x = 0;
edit_update(current, CENTER);
return 1;
}
/* Return the placewewant associated with current_x. That is, xplustabs /* Return the placewewant associated with current_x. That is, xplustabs
* is the zero-based column position of the cursor. Value is no smaller * is the zero-based column position of the cursor. Value is no smaller
* than current_x. */ * than current_x. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment