Skip to content

Commit

Permalink
Merge pull request #42 from ardagnir/0.8.1
Browse files Browse the repository at this point in the history
0.8.1
  • Loading branch information
ardagnir authored Dec 3, 2016
2 parents 4da353c + 8a71279 commit 3aaa153
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ This should include libreadline. If it doesn't, you need to build bash to use th

Control-C usually sends a SIGNINT signal that is handled by zsh, readline, or the program that calls readline. For other keys:

- In readline, chars marked as rl_delete (usually Control-D), rl_newline (usually return), rl_complete (usually tab), and rl_clear_screen (usually Control-L) are sent to readline. All other keys are sent to vim.
- In readline, chars marked as rl_delete (usually Control-D), rl_newline (usually return), rl_complete (usually tab), and rl_clear_screen (usually Control-L) are sent to readline. All other keys are sent to vim. This means that if you use readline's built-in vi-mode, Control-L and Control-D probably won't be sent to the shell.
- In zsh, Athame is hardcoded to send tab, Control-D, carriage return, new line, and Control-L to zsh. All other keys are sent to vim. This behavior will likely change in the future.

####I got the error "Couldn't load vim path"
Expand Down
10 changes: 6 additions & 4 deletions athame_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -976,10 +976,12 @@ static int athame_get_vim_info_inner()
}
if (command)
{
setenv("ATHAME_VIM_COMMAND", command, 1);
strcpy(athame_command, command);
command_cursor = cmd_pos;
// Don't record a change because the highlight for incsearch might not have changed yet.
if(strcmp(athame_command, command) !=0 || command_cursor != cmd_pos) {
setenv("ATHAME_VIM_COMMAND", command, 1);
strcpy(athame_command, command);
command_cursor = cmd_pos;
changed =1;
}
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion athamerc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set textwidth=0 "Don't try to wrap text
startinsert "Start in insert mode. Most shell vi-modes do this.

" These make arrows more shell like. Feel free to comment them out:
if has("patch928")
if v:version>=800 || has("patch928")
" These maps can segfault in earlier vim versions.
inoremap <Up> <Up><ESC>A
inoremap <Down> <Down><ESC>A
Expand Down
14 changes: 12 additions & 2 deletions readline.patch
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,21 @@ diff -ru a/readline.c b/readline.c
/* Restore the original of this history line, iff the line that we
are editing was originally in the history, AND the line has changed. */
entry = current_history ();
@@ -561,7 +566,14 @@
@@ -561,7 +566,16 @@
}

RL_SETSTATE(RL_STATE_READCMD);
- c = rl_read_key ();
+ if (athame_enabled())
+ int use_athame = athame_enabled();
+ if (use_athame)
+ {
+ c = athame_loop(fileno(rl_instream));
+ }
+ else {
+ c = rl_read_key();
+ athame_after_bypass();
+ }
+ if (!use_athame || c) {
RL_UNSETSTATE(RL_STATE_READCMD);

/* look at input.c:rl_getc() for the circumstances under which this will
Expand All @@ -162,6 +164,14 @@ diff -ru a/readline.c b/readline.c
RL_CHECK_SIGNALS ();

/* If there was no change in _rl_last_command_was_kill, then no kill
@@ -608,6 +623,7 @@
if (rl_pending_input == 0 && lk == _rl_last_command_was_kill)
_rl_last_command_was_kill = 0;

+}
_rl_internal_char_cleanup ();

#if defined (READLINE_CALLBACKS)
diff -ru a/shlib/Makefile.in b/shlib/Makefile.in
--- a/shlib/Makefile.in 2015-07-15 00:03:32.898231038 -0400
+++ b/shlib/Makefile.in 2015-07-14 23:37:04.674826478 -0400
Expand Down
2 changes: 2 additions & 0 deletions test/shell/expected5
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
good
yay
6 changes: 6 additions & 0 deletions test/shell/inst5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
input=0
read -e input
good
echo $input > out5
read -en3 input
yayecho $input >> out5

0 comments on commit 3aaa153

Please sign in to comment.