Changeset 2a17b63
- Timestamp:
- Jan 7, 2010, 6:54:15 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 10557e6
- Parents:
- a999d9e
- git-author:
- Nelson Elhage <nelhage@mit.edu> (12/30/09 17:52:20)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (01/07/10 18:54:15)
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r6700c605 r2a17b63 2665 2665 owl_editwin_new_style(e, OWL_EDITWIN_STYLE_ONELINE, NULL); 2666 2666 2667 owl_ function_activate_keymap("recv");2667 owl_global_pop_context(&g); 2668 2668 } 2669 2669 … … 2723 2723 owl_history_reset(hist); 2724 2724 owl_global_set_typwin_inactive(&g); 2725 owl_global_pop_context(&g); 2725 2726 cmd = owl_strdup(owl_editwin_get_text(e)); 2726 2727 owl_editwin_fullclear(e); … … 2743 2744 2744 2745 owl_global_set_typwin_inactive(&g); 2746 owl_global_pop_context(&g); 2745 2747 owl_editwin_fullclear(e); 2746 2748 wnoutrefresh(owl_editwin_get_curswin(e)); … … 2760 2762 owl_editwin_fullclear(e); 2761 2763 owl_global_set_typwin_inactive(&g); 2764 owl_global_pop_context(&g); 2762 2765 owl_global_set_needrefresh(&g); 2763 2766 wnoutrefresh(owl_editwin_get_curswin(e)); … … 2781 2784 { 2782 2785 owl_popwin_close(owl_global_get_popwin(&g)); 2786 owl_global_pop_context(&g); 2783 2787 owl_viewwin_free(vw); 2784 2788 owl_global_set_needrefresh(&g); -
context.c
r3f8514b r2a17b63 52 52 return(ctx->mode & OWL_CTX_INTERACTIVE)?1:0; 53 53 } 54 55 void owl_context_set_startup(owl_context *ctx)56 {57 SET_MODE(ctx, OWL_CTX_STARTUP);58 }59 60 void owl_context_set_readconfig(owl_context *ctx)61 {62 SET_MODE(ctx, OWL_CTX_READCONFIG);63 }64 65 void owl_context_set_interactive(owl_context *ctx)66 {67 SET_MODE(ctx, OWL_CTX_INTERACTIVE);68 }69 70 void owl_context_set_popless(owl_context *ctx, owl_viewwin *vw)71 {72 ctx->data = vw;73 SET_ACTIVE(ctx, OWL_CTX_POPLESS);74 }75 76 void owl_context_set_recv(owl_context *ctx)77 {78 SET_ACTIVE(ctx, OWL_CTX_RECV);79 }80 81 void owl_context_set_editmulti(owl_context *ctx, owl_editwin *ew)82 {83 ctx->data = ew;84 SET_ACTIVE(ctx, OWL_CTX_EDITMULTI);85 }86 87 void owl_context_set_editline(owl_context *ctx, owl_editwin *ew)88 {89 ctx->data = ew;90 SET_ACTIVE(ctx, OWL_CTX_EDITLINE);91 }92 93 void owl_context_set_editresponse(owl_context *ctx, owl_editwin *ew)94 {95 ctx->data = ew;96 SET_ACTIVE(ctx, OWL_CTX_EDITRESPONSE);97 }98 -
functions.c
r8a2815b r2a17b63 301 301 owl_editwin_set_cbdata(owl_global_get_typwin(&g), data); 302 302 owl_global_set_buffercallback(&g, callback); 303 owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti"); 303 304 } 304 305 … … 1301 1302 1302 1303 owl_popwin_up(pw); 1304 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless"); 1303 1305 owl_viewwin_init_text(v, owl_popwin_get_curswin(pw), 1304 1306 owl_popwin_get_lines(pw), owl_popwin_get_cols(pw), … … 1318 1320 1319 1321 owl_popwin_up(pw); 1322 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless"); 1320 1323 owl_viewwin_init_fmtext(v, owl_popwin_get_curswin(pw), 1321 1324 owl_popwin_get_lines(pw), owl_popwin_get_cols(pw), … … 1940 1943 owl_editwin_redisplay(tw, 0); 1941 1944 1942 owl_context_set_editline(owl_global_get_context(&g), tw); 1943 owl_function_activate_keymap("editline"); 1945 owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline"); 1944 1946 } 1945 1947 … … 1957 1959 owl_editwin_redisplay(tw, 0); 1958 1960 1959 owl_context_set_editresponse(owl_global_get_context(&g), tw); 1960 owl_function_activate_keymap("editresponse"); 1961 owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editline"); 1961 1962 } 1962 1963 … … 1975 1976 owl_editwin_redisplay(tw, 0); 1976 1977 1977 owl_context_set_editresponse(owl_global_get_context(&g), tw); 1978 owl_function_activate_keymap("editresponse"); 1978 owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse"); 1979 1979 } 1980 1980 … … 2830 2830 if (direction==0) { 2831 2831 owl_list_append_element(fl, f); 2832 }2833 }2834 2835 void owl_function_activate_keymap(const char *keymap)2836 {2837 if (!owl_keyhandler_activate(owl_global_get_keyhandler(&g), keymap)) {2838 owl_function_error("Unable to activate keymap '%s'", keymap);2839 2832 } 2840 2833 } -
keys.c
r6aa4611 r2a17b63 312 312 BIND_CMD("C-c", "", "no effect in this mode"); 313 313 BIND_CMD("C-g", "", "no effect in this mode"); 314 315 316 /**********************/317 318 owl_function_activate_keymap("recv");319 320 314 } 321 315 -
owl.c
rb752f1e r2a17b63 538 538 /* Initialize perl */ 539 539 owl_function_debugmsg("startup: processing config file"); 540 owl_context_set_readconfig(owl_global_get_context(&g)); 540 541 owl_global_pop_context(&g); 542 owl_global_push_context(&g, OWL_CTX_READCONFIG, NULL, NULL); 543 541 544 perlerr=owl_perlconfig_initperl(opts.configfile, &argc, &argv, &env); 542 545 if (perlerr) { … … 612 615 613 616 owl_function_debugmsg("startup: setting context interactive"); 614 owl_context_set_interactive(owl_global_get_context(&g)); 617 618 owl_global_pop_context(&g); 619 owl_global_push_context(&g, OWL_CTX_READCONFIG|OWL_CTX_RECV, NULL, "recv"); 615 620 616 621 owl_select_add_timer(180, 180, owl_zephyr_buddycheck_timer, NULL, NULL); -
popexec.c
r18fdd5f9 r2a17b63 27 27 28 28 owl_popwin_up(pw); 29 owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless"); 29 30 owl_viewwin_init_text(v, owl_popwin_get_curswin(pw), 30 31 owl_popwin_get_lines(pw), owl_popwin_get_cols(pw), -
select.c
rb752f1e r2a17b63 261 261 { 262 262 int ret; 263 owl_popwin *pw;264 owl_editwin *tw;265 263 266 264 owl_global_set_lastinputtime(&g, time(NULL)); 267 pw=owl_global_get_popwin(&g);268 tw=owl_global_get_typwin(&g);269 270 owl_global_set_lastinputtime(&g, time(NULL));271 /* find and activate the current keymap.272 * TODO: this should really get fixed by activating273 * keymaps as we switch between windows...274 */275 if (pw && owl_popwin_is_active(pw) && owl_global_get_viewwin(&g)) {276 owl_context_set_popless(owl_global_get_context(&g),277 owl_global_get_viewwin(&g));278 owl_function_activate_keymap("popless");279 } else if (owl_global_is_typwin_active(&g)280 && owl_editwin_get_style(tw)==OWL_EDITWIN_STYLE_ONELINE) {281 /*282 owl_context_set_editline(owl_global_get_context(&g), tw);283 owl_function_activate_keymap("editline");284 */285 } else if (owl_global_is_typwin_active(&g)286 && owl_editwin_get_style(tw)==OWL_EDITWIN_STYLE_MULTILINE) {287 owl_context_set_editmulti(owl_global_get_context(&g), tw);288 owl_function_activate_keymap("editmulti");289 } else {290 owl_context_set_recv(owl_global_get_context(&g));291 owl_function_activate_keymap("recv");292 }293 /* now actually handle the keypress */294 265 ret = owl_keyhandler_process(owl_global_get_keyhandler(&g), j); 295 266 if (ret!=0 && ret!=1) {
Note: See TracChangeset
for help on using the changeset viewer.