Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix completion if word-to-complete contains colon (:) #9

Merged
merged 1 commit into from
Sep 19, 2012

Conversation

raducu
Copy link
Contributor

@raducu raducu commented Sep 19, 2012

The recommended way to handle colons in completion words
is by using the helper methods:

  • _get_comp_words_by_ref with the -n : option
    gets the word-to-complete without considering a colon as a word break
  • __ltrim_colon_completions
    removes colon containing prefix from COMPREPLY items
    (a workaround for http://tiswww.case.edu/php/chet/bash/FAQ - E13)

Using the helper methods also simplifies the script and
ensures that we get the same behavior on any environment.

Tested on Ubuntu 12.04, Red Hat 5 and 6.

The recommended way to handle colons in completion words
is by using the helper methods:
 * _get_comp_words_by_ref with the -n : option
      gets the word-to-complete without considering a colon as a word break
 * __ltrim_colon_completions
      removes colon containing prefix from COMPREPLY items
      (a workaround for http://tiswww.case.edu/php/chet/bash/FAQ - E13)

Using the helper methods also simplifies the script and
ensures that we get the same behavior on any environment.
@jaz303
Copy link
Owner

jaz303 commented Sep 19, 2012

Great, thank you for the fix.

jaz303 added a commit that referenced this pull request Sep 19, 2012
Fix completion if word-to-complete contains colon (:)
@jaz303 jaz303 merged commit 605e0a3 into jaz303:master Sep 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants