New commands for moving to the top, middle and bottom of buffer

This commit is contained in:
bptato
2020-08-31 18:02:07 +02:00
parent 14aae92000
commit 9916eadf24
5 changed files with 55 additions and 10 deletions
+3
View File
@@ -12,6 +12,9 @@ CLOSE_TAB Schließe Reiter
CLOSE_TAB_MOUSE Schließe Reiter bei Mauszeiger CLOSE_TAB_MOUSE Schließe Reiter bei Mauszeiger
COMMAND Rufe w3m Funktion(en) auf COMMAND Rufe w3m Funktion(en) auf
COOKIE Cookie-Liste ansehen COOKIE Cookie-Liste ansehen
CURSOR_TOP Cursor auf die höchste Zeile bewegen
CURSOR_MIDDLE Cursor auf die mittlere Zeile bewegen
CURSOR_BOTTOM Cursor auf die unterste Zeile bewegen
DEFAULT_CHARSET Ändere die Voreinstellung für die Zeichenkodierung DEFAULT_CHARSET Ändere die Voreinstellung für die Zeichenkodierung
DEFINE_KEY Definiere eine Verbindung zwischen einer Tastenkombination und einem Kommando DEFINE_KEY Definiere eine Verbindung zwischen einer Tastenkombination und einem Kommando
DELETE_PREVBUF Lösche vorherigen Puffer (hauptsächlich für lokale CGI-Skripte) DELETE_PREVBUF Lösche vorherigen Puffer (hauptsächlich für lokale CGI-Skripte)
+3
View File
@@ -12,6 +12,9 @@ CLOSE_TAB Close tab
CLOSE_TAB_MOUSE Close tab at mouse pointer CLOSE_TAB_MOUSE Close tab at mouse pointer
COMMAND Invoke w3m function(s) COMMAND Invoke w3m function(s)
COOKIE View cookie list COOKIE View cookie list
CURSOR_TOP Move cursor to the top line on the screen
CURSOR_MIDDLE Move cursor to the middle line on the screen
CURSOR_BOTTOM Move cursor to the bottom line on the screen
DEFAULT_CHARSET Change the default character encoding DEFAULT_CHARSET Change the default character encoding
DEFINE_KEY Define a binding between a key stroke combination and a command DEFINE_KEY Define a binding between a key stroke combination and a command
DELETE_PREVBUF Delete previous buffer (mainly for local CGI-scripts) DELETE_PREVBUF Delete previous buffer (mainly for local CGI-scripts)
+36
View File
@@ -6893,3 +6893,39 @@ DEFUN(redoPos, REDO, "Cancel the last undo")
for (i = 0; i < PREC_NUM && b->next; i++, b = b->next) ; for (i = 0; i < PREC_NUM && b->next; i++, b = b->next) ;
resetPos(b); resetPos(b);
} }
DEFUN(cursorTop, CURSOR_TOP, "Move cursor to the top of the screen")
{
int offsety;
if (Currentbuf->firstLine == NULL)
return;
Currentbuf->currentLine = lineSkip(Currentbuf,
Currentbuf->topLine, 0,
FALSE);
arrangeLine(Currentbuf);
displayBuffer(Currentbuf, B_NORMAL);
}
DEFUN(cursorMiddle, CURSOR_MIDDLE, "Move cursor to the middle of the screen")
{
int offsety;
if (Currentbuf->firstLine == NULL)
return;
offsety = (Currentbuf->LINES - 1) / 2;
Currentbuf->currentLine = currentLineSkip(Currentbuf, Currentbuf->topLine,
offsety, FALSE);
arrangeLine(Currentbuf);
displayBuffer(Currentbuf, B_NORMAL);
}
DEFUN(cursorBottom, CURSOR_BOTTOM, "Move cursor to the bottom of the screen")
{
int offsety;
if (Currentbuf->firstLine == NULL)
return;
offsety = Currentbuf->LINES - 1;
Currentbuf->currentLine = currentLineSkip(Currentbuf, Currentbuf->topLine,
offsety, FALSE);
arrangeLine(Currentbuf);
displayBuffer(Currentbuf, B_NORMAL);
}
+3
View File
@@ -156,6 +156,9 @@ extern Anchor *list_menu(Buffer *buf);
#endif #endif
extern void undoPos(void); extern void undoPos(void);
extern void redoPos(void); extern void redoPos(void);
extern void cursorTop(void);
extern void cursorMiddle(void);
extern void cursorBottom(void);
extern int currentLn(Buffer *buf); extern int currentLn(Buffer *buf);
extern void tmpClearBuffer(Buffer *buf); extern void tmpClearBuffer(Buffer *buf);
+1 -1
View File
@@ -140,7 +140,7 @@ print "<P><A HREF=\"$keymap\">$head</A>\n";
goLine goLineF goLineL movRW movLW goLine goLineF goLineL movRW movLW
topA lastA nextA prevA movlistMn topA lastA nextA prevA movlistMn
nextR nextL nextD nextU nextRD nextLU nextR nextL nextD nextU nextRD nextLU
undoPos redoPos")); undoPos redoPos cursorTop"));
&show_keymap('Hyperlink Operations', &show_keymap('Hyperlink Operations',
split(" ", "followA tabA svA followI svI submitForm split(" ", "followA tabA svA followI svI submitForm