Beispiel #1
0
void start_ex_cmd(char symbol, int state)
{
  log_msg("EXCMD", "start");
  ex.ex_state = state;
  ex.state_symbol = symbol;
  window_refresh();

  pos_T max = layout_size();
  ex.curpos = 0;
  ex.curofs = 0;
  ex.maxpos = max.col - 2;
  ex.state = 0;
  ex.col_text = opt_color(COMPL_TEXT);
  ex.col_symb = opt_color(BUF_TEXT);

  switch (state) {
    case EX_CMD_STATE:
      menu_start(ex.menu);
      break;
    case EX_REG_STATE:
      ex.lm = window_get_focus()->matches;
      regex_mk_pivot(ex.lm);
      break;
    case EX_FIL_STATE:
      ex.fil = window_get_focus()->filter;
      //swap exline with filter string
      break;
  }
  ex.line = calloc(max.col, sizeof(char*));
  ex.cmd.cmds = NULL;
  ex.cmd.line = NULL;
  hist_push(state);
  cmdline_build(&ex.cmd, ex.line);
}
Beispiel #2
0
Overlay* overlay_new()
{
  Overlay *ov = malloc(sizeof(Overlay));
  memset(ov, 0, sizeof(Overlay));
  ov->nc_st  = newwin(1,1,0,0);
  ov->nc_sep = newwin(1,1,0,0);

  ov->col_lbl   = opt_color(OVERLAY_ACTIVE);
  ov->col_text  = opt_color(OVERLAY_LINE);
  ov->col_ln    = opt_color(OVERLAY_LINE);
  ov->col_sep   = opt_color(OVERLAY_SEP);
  ov->col_arg   = opt_color(OVERLAY_ARGS);
  ov->col_bufno = opt_color(OVERLAY_BUFNO);
  ov->col_prog  = opt_color(OVERLAY_PROGRESS);
  ov->col_fil   = opt_color(OVERLAY_FILTER);

  sep_char  = get_opt_str("sepchar");

  ov->arg = strdup("         ");
  overlay_bufno(ov, 0);

  memset(ov->name,   ' ', SZ_LBL);
  memset(ov->lineno, ' ', SZ_LN);
  return ov;
}
Beispiel #3
0
void overlay_unfocus(Overlay *ov)
{
  ov->col_lbl = opt_color(OVERLAY_INACTIVE);
  ov->col_text = opt_color(OVERLAY_TEXTINACTIVE);
  overlay_refresh(ov);
}
Beispiel #4
0
void overlay_focus(Overlay *ov)
{
  ov->col_lbl = opt_color(OVERLAY_ACTIVE);
  ov->col_text = opt_color(OVERLAY_LINE);
  overlay_refresh(ov);
}