Skip to content

Unexpected syntax highlighting after & #113

@alexr00

Description

@alexr00

The code with a problem is:

# Make sure the computer is connected to power if the battery is under 30%
if pmset -g ps | grep -q "Battery Power" && [[ $(pmset -g ps | grep -Eo "\d+%" | cut -d% -f1) -lt 30 ]]; then
	addLog "Battery is below 30%, waiting for AC power..."
	/usr/local/bin/dialog --commandfile "/var/tmp/macSetupBattery.log" \
		--icon caution --iconsize 64 --centericon --title none \
		--message "Please connect your laptop to a power source to continue" \
		--messagefont "size=16" --messageposition center --messagealignment center \
		--button1text none --width 500 --height 175 --quitkey X --ontop --position center &
	until pmset -g ps | grep -q "AC Power"; do
		sleep 2
	done
	addLog -nested "AC power detected"
	echo "quit:" > /var/tmp/macSetupBattery.log
	updateDialog "show:"
fi

It looks like:

Image

It should look like:

The whole of until should have the same scopes.

Originally from @anewhouse in microsoft/vscode#271984

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions