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