Browse Source

Handle dashes at the beginning of commands

pull/221/head
Eric Freese 7 years ago
parent
commit
c9a51e0c4c
4 changed files with 8 additions and 3 deletions
  1. +5
    -0
      spec/special_characters_spec.rb
  2. +1
    -1
      spec/terminal_session.rb
  3. +1
    -1
      src/async.zsh
  4. +1
    -1
      zsh-autosuggestions.zsh

+ 5
- 0
spec/special_characters_spec.rb View File

@ -51,5 +51,10 @@ describe 'a special character in the buffer' do
session.send_string('echo "^A')
wait_for { session.content }.to eq('echo "^A"')
end
with_history('-foo() {}') do
session.send_string('-')
wait_for { session.content }.to eq('-foo() {}')
end
end
end

+ 1
- 1
spec/terminal_session.rb View File

@ -26,7 +26,7 @@ class TerminalSession
end
def send_string(str)
tmux_command("send-keys -t 0 -l '#{str.gsub("'", "\\'")}'")
tmux_command("send-keys -t 0 -l -- '#{str.gsub("'", "\\'")}'")
self
end

+ 1
- 1
src/async.zsh View File

@ -55,7 +55,7 @@ _zsh_autosuggest_async_response() {
local suggestion
zpty -rt $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME suggestion '*'$'\0' 2>/dev/null
zle autosuggest-suggest "${suggestion%%$'\0'##}"
zle autosuggest-suggest -- "${suggestion%%$'\0'##}"
}
_zsh_autosuggest_async_pty_create() {

+ 1
- 1
zsh-autosuggestions.zsh View File

@ -550,7 +550,7 @@ _zsh_autosuggest_async_response() {
local suggestion
zpty -rt $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME suggestion '*'$'\0' 2>/dev/null
zle autosuggest-suggest "${suggestion%%$'\0'##}"
zle autosuggest-suggest -- "${suggestion%%$'\0'##}"
}
_zsh_autosuggest_async_pty_create() {

Loading…
Cancel
Save