Wilfred / ag.el

An Emacs frontend to The Silver Searcher
http://agel.readthedocs.org/en/latest/
525 stars 61 forks source link

Fix incorrect point placement in minibuffer when prefixed. #160

Open Raphus-cucullatus opened 5 years ago

Raphus-cucullatus commented 5 years ago

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.

Raphus-cucullatus commented 5 years ago

This pull request tries to fix #159.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 18.773% when pulling 6fa9541f0303de6ae7492e278304d9584993372b on Raphus-cucullatus:fix_incorrect_point_placement into bd81d68466e44301505629454dfc689b6c17d94b on Wilfred:master.