summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-04-06 00:53:32 +0000
committersabetts <sabetts>2003-04-06 00:53:32 +0000
commit7dad9dd35ea39dbe3faa727cc0c0d074a5ea1abe (patch)
tree1267064b648379f58939484267b2c63f6c78c9da /src/actions.c
parent934c250042e1e5b9f51d0c8b401437057febfbe3 (diff)
downloadratpoison-7dad9dd35ea39dbe3faa727cc0c0d074a5ea1abe.zip
* src/window.c (get_window_list): if window_list_style is STYLE_COLUMN then
the end of the mark is the length of the buffer minus the start of the mark. * src/main.c (init_defaults): init window_list_style to STYLE_ROW. * src/data.h (struct rp_defaults): new member, window_list_style. * src/bar.c (bar_y): new argument, height. All callers updated. (bar_y): use height in calculations. (update_window_names): print a column of windows if defaults.window_list_style is in column mode. (count_lines): new function (max_line_length): likewise (pos_in_line): likewise (line_beginning): likewise (marked_wrapped_message): likewise * src/actions.c (user_commands): new commands 'verbexec' and 'defwinliststyle'. Move @end take to after the def* commands. (cmd_verbexec): new function. Added prototype. (cmd_defwinliststyle): likewise
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/actions.c b/src/actions.c
index 456abc1..352818c 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -115,7 +115,7 @@ static user_command user_commands[] =
{"defbgcolor", cmd_defbgcolor, arg_STRING},
{"defbarpadding", cmd_defbarpadding, arg_STRING},
{"defresizeunit", cmd_defresizeunit, arg_STRING},
- {"defwrapwinlist", cmd_defwrapwinlist, arg_STRING},
+ {"defwinliststyle", cmd_defwinliststyle, arg_STRING},
/*@end (tag required for genrpbindings) */
/* Commands to help debug ratpoison. */
@@ -3119,16 +3119,29 @@ cmd_verbexec (int interactive, void *data)
}
char *
-cmd_defwrapwinlist (int interactive, void *data)
+cmd_defwinliststyle (int interactive, void *data)
{
if (data == NULL && !interactive)
- return xsprintf ("%d", defaults.wrap_window_list);
+ return xsprintf ("%s", defaults.window_list_style ? "column":"row");
- if (data == NULL
- || sscanf (data, "%d", &defaults.wrap_window_list) < 1)
+ if (data == NULL)
{
message (" defwrapwinlist: One argument required ");
+ return NULL;
}
-
+
+ if (!strcmp ("column", data))
+ {
+ defaults.window_list_style = STYLE_COLUMN;
+ }
+ else if (!strcmp ("row", data))
+ {
+ defaults.window_list_style = STYLE_ROW;
+ }
+ else
+ {
+ message (" defwrapwinlist: Bad argument ");
+ }
+
return NULL;
}