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.58k stars 714 forks source link

Expanding projects inside quotes #284

Open pmust opened 5 years ago

pmust commented 5 years ago

Do you want to request a feature or report a bug? A feature, I think?

What is the current behavior? Currently Bash completion for projects does not work inside quotes. If you encase your task in quotes (you need this for single quotes to work and parentheses etc) then you can't complete your projects by using "+mypro<tab>". Without quotes this would be completed as +myproject (assuming you have this project).

What is the expected behavior? The project inside the quotes should be expanded just as it is without quotes.

Which versions todo.sh are you using?

Run todo.sh -V 2.11.0

Which Operating System are you using? Windows 10 with todo.sh in WSL.

Which version of bash are you using?

Run bash --version 4.3.48(1)

inkarkat commented 5 years ago

All supporting functions around Bash completion are tailored to single whole arguments. What you're suggesting would probably be difficult to implement (with custom word-splitting or parsing). If someone submits a simple patch, I would consider including this, but anything that doubles the current completion implementation in size would not be acceptable, especially as the test coverage of completion is not good yet.

Are you aware that you can freely mix quoted and unquoted parts in Bash? To have completion and quoted strings, you can do things like this:

todo.sh add "O'Brian wants to go to" @school "with me" +fut<Tab>

I personally have all +project and @context at the beginning of the task, and I only open a double quote after that for the actual task text.

pmust commented 5 years ago

Hmm I understand, unfortunate.

Actually I was not aware of this. That will probably help me, I just usually use my projects as "words" inside the sentence.

Thanks!

On Fri, Jun 14, 2019, 22:09 Ingo Karkat notifications@github.com wrote:

All supporting functions around Bash completion are tailored to single whole arguments. What you're suggesting would probably be difficult to implement (with custom word-splitting or parsing). If someone submits a simple patch, I would consider including this, but anything that doubles the current completion implementation in size would not be acceptable, especially as the test coverage of completion is not good yet.

Are you aware that you can freely mix quoted and unquoted parts in Bash? To have completion and quoted strings, you can do things like this:

todo.sh add "O'Brian wants to go to" @school "with me" +fut

I personally have all +project and @context at the beginning of the task, and I only open a double quote after that for the actual task text.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/todotxt/todo.txt-cli/issues/284?email_source=notifications&email_token=AGC5KFGWWEO5TTCYMH5RAOLP2PUF5A5CNFSM4HW7FJQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXXWRFI#issuecomment-502229141, or mute the thread https://github.com/notifications/unsubscribe-auth/AGC5KFGKQHO7HGFQEIT3NWTP2PUF5ANCNFSM4HW7FJQQ .