Skip to content

Renaming a variable changes all instances except those made on read #1183

Closed
@LeonardoMor

Description

@LeonardoMor

Code editor

Neovim

Platform

Linux

Version

5.4.0

What steps will reproduce the bug?

Any code where a variable is set and then potentially reset by the read command. For example, on this snippet:

CASE="$2"

# Check for arguments, if we didn't receive them, ask for them
if [[ -z $CASE ]]; then
	read -rp "Enter case number (must be 8-10 numerals): " CASE
fi
TARGETDIR="/srdata/$CASE"

Renaming CASE will change it everywhere except for the instance on read -rp "Enter case number (must be 8-10 numerals): " CASE.

How often does it reproduce? Is there a required condition?

Can be reproduced all the time.

What is the expected behavior?

The variable should be renamed everywhere.

What do you see instead?

Rename skips instances of the variable used with the read command.

Additional information

There are other instances of variables being used without the usual $. For example, you can omit the $ inside arithmetic $((...)). I have not tested if these instances are also skipped by the rename.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions