todotxt / todo.txt-cli

☑️ A simple and extensible shell script for managing your todo.txt file.
http://todotxt.org
GNU General Public License v3.0
5.56k stars 713 forks source link

tab completion for replace fills in wrong text #245

Closed prof7bit closed 6 years ago

prof7bit commented 6 years ago

Do you want to request a feature or report a bug? bug

What is the current behavior? If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Suppose I have this as line 4 in my todo.txt (B) foo +bar @baz

if I now type on the bash prompt: t replace 4

it will complete the line like this: t replace 4 # (B) foo

It has added a # sign, it has added the (B) which would later be duplicated in the text and most annoyingly it has removed the +bar and the @baz. If I now press enter then it will drop me to an empty input prompt wich makes the previous tab completion rather pointless and if I remove the # and the (B) before pressing enter I will have deleted the +bar and the @baz from the line without even noticing.

So with this broken behavior there is absolutely no way to edit an existing line, the only option is to open the full txt file in a real editor, find the line manually and edit it.

What is the expected behavior? it should complete the line like this t replace 4 foo +bar @baz

So I could just edit the text directly within the bash prompt and press enter.

Which versions todo.sh are you using? TODO.TXT Command Line Interface v2.10

Which Operating System are you using? Kubuntu 17.10

Which version of bash are you using? GNU bash, Version 4.4.12(1)-release (x86_64-pc-linux-gnu)