Skip to content

Commit b1e53be

Browse files
committed
fix autocompletion when notes directory is not the default one
1 parent 673d39e commit b1e53be

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

_notes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ __notes_cmd ()
3131

3232
_notes ()
3333
{
34+
# Look for configuration file at ~/.config/notes/config and use it
35+
if [ -f ~/.config/notes/config ]; then
36+
. ~/.config/notes/config
37+
fi
38+
3439
local configured_dir=${NOTES_DIRECTORY%/}
3540
local note_dir="${configured_dir:-$HOME/notes}"
3641

notes.bash_completion

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22

33
_notes_complete_notes() {
4+
# Look for configuration file at ~/.config/notes/config and use it
5+
if [ -f ~/.config/notes/config ]; then
6+
. ~/.config/notes/config
7+
fi
8+
49
local configured_dir=${NOTES_DIRECTORY%/} # Remove trailing slashes
510
local notes_dir="${configured_dir:-$HOME/notes}"
611
local OLD_IFS="$IFS"

0 commit comments

Comments
 (0)