Skip to content

Commit

Permalink
Add comment to explain confusing code in D63397157/D63397156
Browse files Browse the repository at this point in the history
Summary: Address review comments by adding comments to explain some confusing code.

Reviewed By: JakobDegen

Differential Revision: D63640756

fbshipit-source-id: 553c3c24f1c3f38ae64805df8d4be82195a113e7
  • Loading branch information
ben-- authored and facebook-github-bot committed Sep 30, 2024
1 parent d4adc79 commit 51fb602
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ __buck2_fix()
local cur="${COMP_WORDS[COMP_CWORD]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"
local pprev="${COMP_WORDS[COMP_CWORD-2]}"
# Bash treats `:` as a separate word, so we have to do some work to
# recover a partial target name
if [[ $cur = : ]]; then
if [[ "${COMP_LINE:0:$COMP_POINT}" =~ .*$prev: ]]; then
cur="$prev:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ __buck2_fix()
local cur="${words[CURRENT]}"
local prev="${words[CURRENT-1]}"
local pprev="${words[CURRENT-2]}"
# Zsh treats `:` as a separate word, so we have to do some work to
# recover a partial target name

if [[ $cur = : ]]; then
if [[ "${BUFFER:0:$CURRENT}" =~ .*$prev: ]]; then
cur="$prev:"
Expand Down

0 comments on commit 51fb602

Please sign in to comment.