.B :q[uit]!
Close the browser independent from an running download.
.TP
+.B :reg[ister]
+Display the contents of all registers.
+.RS
+.PP
+.PD 0
+Registers:
+.TP
+.BR \[char34]a " - " \[char34]z
+26 named registers "a to "z. Vimb fills these registers only when you say so.
+.TP
+.B \[char34]%
+Contains the curent opened URI.
+.TP
+.B \[char34]:
+Contains the most recent executed ex command.
+.TP
+.B \[char34]/
+Contains the most recent search-pattern.
+.TP
+.B \[char34];
+Contains the last hinted URL. This can be used in `x-hint-command' to get the
+URL of the hint.
+.PD
+.RE
+.TP
.BI :e[val] " javascript"
Runs the given \fIjavascript\fP in the current page and display the evaluated
value.
.TP
.B CTRL\-Z
Enter the pass-through mode.
-.SH REGISTERS
-There are different types of registers.
-.TP
-.BR \[char34]a " - " \[char34]z
-26 named registers "a to "z. Vimb fills these registers only when you say so.
-.TP
-.B \[char34]%
-Contains the curent opened URI.
-.TP
-.B \[char34]:
-Contains the most recent executed ex command.
-.TP
-.B \[char34]/
-Contains the most recent search-pattern.
-.TP
-.B \[char34];
-Contains the last hinted URL. This can be used in `x-hint-command' to get the
-URL of the hint.
.SH COMPLETIONS
The completions are triggered by pressing `<Tab>` or `<shift-tab>` in the
activated inputbox. Depending of the current inserted content different
EX_QUNSHIFT,
#endif
EX_QUIT,
+ EX_REG,
EX_SAVE,
EX_SCA,
EX_SCD,
#ifdef FEATURE_QUEUE
static gboolean ex_queue(const ExArg *arg);
#endif
+static gboolean ex_register(const ExArg *arg);
static gboolean ex_quit(const ExArg *arg);
static gboolean ex_save(const ExArg *arg);
static gboolean ex_set(const ExArg *arg);
{"qpop", EX_QPOP, ex_queue, EX_FLAG_NONE},
{"qpush", EX_QPUSH, ex_queue, EX_FLAG_RHS},
#endif
+ {"register", EX_REG, ex_register, EX_FLAG_NONE},
{"save", EX_SAVE, ex_save, EX_FLAG_RHS|EX_FLAG_EXP},
{"set", EX_SET, ex_set, EX_FLAG_RHS},
{"shellcmd", EX_SHELLCMD, ex_shellcmd, EX_FLAG_RHS|EX_FLAG_EXP|EX_FLAG_BANG},
}
#endif
+/**
+ * Show the contents of the registers :reg.
+ */
+static gboolean ex_register(const ExArg *arg)
+{
+ int idx;
+ char *reg;
+ const char *regchars = VB_REG_CHARS;
+ GString *str = g_string_new("-- Register --");
+
+ for (idx = 0; idx < VB_REG_SIZE; idx++) {
+ /* show only filled registers */
+ if (vb.state.reg[idx]) {
+ /* replace all newlines */
+ reg = util_str_replace("\n", "^J", vb.state.reg[idx]);
+ g_string_append_printf(str, "\n\"%c %s", regchars[idx], reg);
+ g_free(reg);
+ }
+ }
+
+ vb_echo(VB_MSG_NORMAL, false, "%s", str->str);
+ g_string_free(str, true);
+
+ return true;
+}
+
static gboolean ex_quit(const ExArg *arg)
{
vb_quit(arg->bang);