Skip to content

Commit

Permalink
Merge pull request #44 from ardagnir/0.8.3
Browse files Browse the repository at this point in the history
0.8.3
  • Loading branch information
ardagnir authored Jan 21, 2017
2 parents 36f89f3 + 938f15c commit c75f907
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions athame_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,11 @@ static int athame_remote_expr(char* expr, int block)
if(selected > 0)
{
char error[80];
if(selected == 2 || read(stdout_to_readline[0], &error, 1) < 1) {
if(selected == 2 || read(stdout_to_readline[0], error, 1) < 1) {
char* prefix = "Clientserver error: ";
int prelen = strlen(prefix);
strcpy(error, prefix);
error[read(stderr_to_readline[0], &error+prelen, 80-prelen) + prelen] = '\0';
error[read(stderr_to_readline[0], error+prelen, 80-prelen) + prelen] = '\0';
athame_set_failure(error);
return -1;
}
Expand Down Expand Up @@ -790,15 +790,17 @@ static char* athame_get_mode_text(char* mode)
}
}

static void athame_set_mode(char* mode)
static int athame_set_mode(char* mode)
{
if (strcmp(athame_mode, mode) != 0)
{
char* mode_string = athame_get_mode_text(mode);
strcpy(athame_mode, mode);
setenv("ATHAME_VIM_MODE", mode_string, 1);
ap_redraw_prompt();
return 1;
}
return 0;
}

static void athame_bottom_mode()
Expand Down Expand Up @@ -967,7 +969,7 @@ static int athame_get_vim_info_inner()
{
if (mode[0] == 'c')
{
athame_set_mode("c");
changed |= athame_set_mode("c");
char* command = athame_tok(&buffer_loc, '\n');
int cmd_pos = 0;
if (mode[1] == ',')
Expand All @@ -994,7 +996,7 @@ static int athame_get_vim_info_inner()
// Don't do work if we're quitting.
return 0;
}
athame_set_mode(mode);
changed |= athame_set_mode(mode);
}
char* location = athame_tok(&buffer_loc, '\n');
if(location)
Expand Down

0 comments on commit c75f907

Please sign in to comment.