Users can prefix an ag-command to pass additional arguments. If so,
all the arguments will be prompted in the minibuffer for user editing
and point is adjusted to the position for user's input.
However, the calculation of the point position does not take the
backslash (after shell-quote-argument) into account, nor the
variable-length of the `:files' argument.
This commit fixes this issue by searching for " -- " and place the
cursor before it rather than subtracting a fixed value.
Coverage remained the same at 18.773% when pulling 6fa9541f0303de6ae7492e278304d9584993372b on Raphus-cucullatus:fix_incorrect_point_placement into bd81d68466e44301505629454dfc689b6c17d94b on Wilfred:master.
Users can prefix an ag-command to pass additional arguments. If so, all the arguments will be prompted in the minibuffer for user editing and point is adjusted to the position for user's input.
However, the calculation of the point position does not take the backslash (after shell-quote-argument) into account, nor the variable-length of the `:files' argument.
This commit fixes this issue by searching for " -- " and place the cursor before it rather than subtracting a fixed value.