Skip to content

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

Merged
merged 1 commit into from Sep 19, 2012

3 participants

@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.

@miezuit miezuit Fix completion if word-to-complete contains colon (:)
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.
f2428e5
@jaz303
Owner
jaz303 commented Sep 19, 2012

Great, thank you for the fix.

@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
Something went wrong with that request. Please try again.