summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2014-03-07 15:16:56 +0100
committerportix <portix@gmx.net>2014-03-07 15:16:56 +0100
commitb29244c9848d29f8190abe03bd6818e6e84631a1 (patch)
treed916b287c9a5f2444cadb80dad3420f645641107
parentd298f72384a6b8f278d9baad20833f6cc3c85d71 (diff)
downloaddwb-b29244c9848d29f8190abe03bd6818e6e84631a1.zip
Adding optional arg to command mode
-rw-r--r--doc/dwbremote.19
-rw-r--r--src/commands.c11
-rw-r--r--src/commands.h1
-rw-r--r--src/config.h4
4 files changed, 20 insertions, 5 deletions
diff --git a/doc/dwbremote.1 b/doc/dwbremote.1
index 1eb497d5..adb4eb54 100644
--- a/doc/dwbremote.1
+++ b/doc/dwbremote.1
@@ -2,12 +2,12 @@
.\" Title: dwbremote
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 11/09/2013
+.\" Date: 03/07/2014
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DWBREMOTE" "1" "11/09/2013" "\ \&" "\ \&"
+.TH "DWBREMOTE" "1" "03/07/2014" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -393,6 +393,11 @@ Emitted when new tab is created, return format:
Number of the new tab
.RE
.RE
+.PP
+\fBquit\fR
+.RS 4
+Emitted when dwb is closed\&. The response will be empty
+.RE
.RE
.RE
.PP
diff --git a/src/commands.c b/src/commands.c
index a1247893..cd7c770e 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -604,6 +604,16 @@ commands_change_mode(KeyMap *km, Arg *a)
else
return dwb_change_mode(a->n);
}
+DwbStatus
+commands_command_mode(KeyMap *km, Arg *a)
+{
+ commands_change_mode(km, a);
+ if (a->p != NULL) {
+ entry_set_text(a->p);
+ entry_insert_text(" ");
+ }
+ return STATUS_OK;
+}
/* commands_save_session {{{*/
DwbStatus
commands_save_session(KeyMap *km, Arg *arg)
@@ -1201,4 +1211,3 @@ commands_entry_delete_active(KeyMap *km, Arg *arg)
return STATUS_OK;
}
-
diff --git a/src/commands.h b/src/commands.h
index 9f5b3a57..24c24e55 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -77,6 +77,7 @@ DwbStatus commands_reload_user_scripts(KeyMap *, Arg *);
DwbStatus commands_fullscreen(KeyMap *, Arg *);
DwbStatus commands_open_editor(KeyMap *, Arg *);
DwbStatus commands_change_mode(KeyMap *, Arg *);
+DwbStatus commands_command_mode(KeyMap *, Arg *);
DwbStatus commands_only(KeyMap *, Arg *);
DwbStatus commands_toggle_bars(KeyMap *, Arg *);
DwbStatus commands_presentation_mode(KeyMap *, Arg *);
diff --git a/src/config.h b/src/config.h
index f49a635b..97fa216b 100644
--- a/src/config.h
+++ b/src/config.h
@@ -343,8 +343,8 @@ static FunctionMap FMAP [] = {
(Func)commands_new_window_or_view, NULL, NEVER_SM,
{ .n = OPEN_NEW_WINDOW }, EP_NONE, { NULL }, },
- { { "command_mode", "Enter command mode", }, 0,
- (Func)commands_change_mode, NULL, POST_SM,
+ { { "command_mode", "Enter command mode", }, CP_COMMANDLINE | CP_HAS_MODE,
+ (Func)commands_command_mode, NULL, POST_SM,
{ .n = COMMAND_MODE, .b = false }, EP_NONE, { NULL }, },
{ { "find_backward", "Find backward ", }, CP_COMMANDLINE|CP_HAS_MODE | CP_NEEDS_ARG,