Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Adding the original string from completion
- X-seq: zsh-workers 19279
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: Adding the original string from completion
- Date: Fri, 5 Dec 2003 16:52:35 +0000
- In-reply-to: <15582.1070624216@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <15582.1070624216@xxxxxxxxxxx>
On Dec 5, 12:36pm, Oliver Kiddle wrote:
}
} compadd "$expl[@]" -U -Q - "$PREFIX$SUFFIX"
}
} When called from _prefix, the result is that the suffix is lost.
}
} The fix is to change the line to:
}
} compadd "$expl[@]" -i "$IPREFIX" -I "$ISUFFIX" -U -Q - "$PREFIX$SUFFIX"
}
} Only problem is if _prefix's add-space style is set. It sticks an
} additional space at the beginning of ISUFFIX.
[...]
} This amounts to trusting $words[CURRENT] to be unchanged instead of
} $ISUFFIX. If we do this, I'm inclined to factor it out into an new
} _original function though. Anyone got any better ideas?
How about this:
Have functions _prefix and _original cooperate with each other. Before
changing $ISUFFIX, _prefix stores the original value in a local, perhaps
$_orig_isuf or some such. Then _original uses ${_orig_isuf:-$ISUFFIX}
when constructing the compadd command.
} There is also the option of only adding original strings at the end from
} _main_complete. Given certain styles and whether menu completion if
} enabled that is.
So then _original would work sort of like _all_matches ? That might be
a good way to go, but I'm not entirely certain.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author