mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2026-10-02 16:03:50 +02:00
Handle dashes at the beginning of commands
This commit is contained in:
1 parent
48a21bf79e
commit
c9a51e0c4c
4 files changed
+8
-3
No files matched your search
@@ -51,5 +51,10 @@ describe 'a special character in the buffer' do
|
|||||||
session.send_string('echo "^A')
|
session.send_string('echo "^A')
|
||||||
wait_for { session.content }.to eq('echo "^A"')
|
wait_for { session.content }.to eq('echo "^A"')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
with_history('-foo() {}') do
|
||||||
|
session.send_string('-')
|
||||||
|
wait_for { session.content }.to eq('-foo() {}')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -26,7 +26,7 @@ class TerminalSession
|
|||||||
end
|
end
|
||||||
|
|
||||||
def send_string(str)
|
def send_string(str)
|
||||||
tmux_command("send-keys -t 0 -l '#{str.gsub("'", "\\'")}'")
|
tmux_command("send-keys -t 0 -l -- '#{str.gsub("'", "\\'")}'")
|
||||||
|
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-1
@@ -55,7 +55,7 @@ _zsh_autosuggest_async_response() {
|
|||||||
local suggestion
|
local suggestion
|
||||||
|
|
||||||
zpty -rt $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME suggestion '*'$'\0' 2>/dev/null
|
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() {
|
_zsh_autosuggest_async_pty_create() {
|
||||||
|
|||||||
@@ -550,7 +550,7 @@ _zsh_autosuggest_async_response() {
|
|||||||
local suggestion
|
local suggestion
|
||||||
|
|
||||||
zpty -rt $ZSH_AUTOSUGGEST_ASYNC_PTY_NAME suggestion '*'$'\0' 2>/dev/null
|
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() {
|
_zsh_autosuggest_async_pty_create() {
|
||||||
|
|||||||
Reference in new issue
Block a user