Improve aspell dictionary completion: don't hardcode data-dir, get canonical dicts from 'aspell dicts'.
This commit is contained in:
parent
566c6083c2
commit
08d3738d56
2
CHANGES
2
CHANGES
@ -17,6 +17,8 @@ bash-completion (1.x)
|
||||
* Parse top level mplayer and friends option completions from -list-options.
|
||||
* Fix dir-only completion for make to include only dirs, not files.
|
||||
* Remove unused variable RELEASE.
|
||||
* Improve aspell dictionary completion: don't hardcode data-dir, get
|
||||
canonical dicts from "aspell dicts".
|
||||
|
||||
[ Todd Zullinger ]
|
||||
* Make yum complete on filenames after install, deplist, update and upgrade
|
||||
|
@ -6784,10 +6784,14 @@ have aspell && {
|
||||
_aspell_dictionary()
|
||||
{
|
||||
local datadir
|
||||
datadir=/usr/lib/aspell
|
||||
COMPREPLY=( $( command ls $datadir/*.@(multi|alias) ) )
|
||||
COMPREPLY=( ${COMPREPLY[@]%.@(multi|alias)} )
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]#$datadir/}' -- $cur ) )
|
||||
datadir=$( aspell config data-dir 2>/dev/null || echo /usr/lib/aspell )
|
||||
# First, get aliases (dicts dump does not list them)
|
||||
COMPREPLY=( $( command ls $datadir/*.alias 2>/dev/null ) )
|
||||
COMPREPLY=( ${COMPREPLY[@]%.alias} )
|
||||
COMPREPLY=( ${COMPREPLY[@]#$datadir/} )
|
||||
# Then, add the canonical dicts
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( aspell dicts 2>/dev/null ) )
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
|
||||
}
|
||||
|
||||
_aspell()
|
||||
|
Loading…
x
Reference in New Issue
Block a user