Skip to content

Pre-command-word redirection as unknown-token #712

Closed
@danielshahaf

Description

@danielshahaf
% git checkout 0.7.1
% tests/generate.zsh '<$fn cat' main redirection-from-param $'touch file\nlocal fn=$PWD/file' 
Set copyright year to 2020? y
touch file
local fn=$PWD/file

BUFFER=$'<$fn cat'

expected_region_highlight=(
  '1 1 redirection' # <
  '2 4 path' # $fn
  '6 8 default' # cat
)
% git checkout upstream
% tests/generate.zsh '<$fn cat' main redirection-from-param $'touch file\nlocal fn=$PWD/file' 
Set copyright year to 2020? y
touch file
local fn=$PWD/file

BUFFER=$'<$fn cat'

expected_region_highlight=(
  '1 1 redirection' # <
  '2 4 unknown-token' # $fn
  '6 8 default' # cat
)

It works fine if the command is changed to cat <$fn or if a chmod +x file is run. Something should probably be checking $in_redirection in addition to :start:.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions