diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index 1f1b99a8..234c0ddd 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -141,6 +141,7 @@ - canvas: do not insert explicit newlines on line folding if possible (reported by banoris) `#D1745` 02b9da6 dc3827b - edit (`ble-bind -x`): preserve multiline prompts on execution of `bind -x` commands (requested by SuperSandro2000) `#D1755` 7d05a28 - util (`ble/util/buffer`): hide cursor in rendering `#D1758` 0000000 +- complete (`action:file`): always suffix `/` to complete symlinked directory names (reported by SuperSandro2000) `#D1759` 0000000 ## Fixes diff --git a/lib/core-complete.sh b/lib/core-complete.sh index c2ecd794..26d077e0 100644 --- a/lib/core-complete.sh +++ b/lib/core-complete.sh @@ -1172,7 +1172,7 @@ function ble/complete/action/complete.addtail { } function ble/complete/action/complete.mark-directory { [[ :$comp_type: == *:markdir:* && $CAND != */ ]] && - [[ :$comp_type: == *:marksymdir:* || ! -h $CAND ]] && + [[ ! -h $CAND || ( $insert == "$COMPS" || :$comp_type: == *:marksymdir:* ) ]] && ble/complete/action/complete.addtail / } function ble/complete/action/complete.close-quotation { diff --git a/note.txt b/note.txt index f1c26d5f..0eea3873 100644 --- a/note.txt +++ b/note.txt @@ -5946,6 +5946,18 @@ bash_tips 2022-02-02 + * complete: / が symlink に対して付加されたり付加されなかったりする (reported by SuperSandro2000) [#D1759] + https://github.com/akinomyoga/ble.sh/issues/171#issuecomment-1021326168 + + bash-completion なしでも再現する → これは分かった。bind -v で + mark-symlinked-directories が off になっているのが原因だった。元の bash だ + とこれが off になっていたとしても2回 TAB を押したら結局 / を挿入する様だ。 + →もう少し調べてみると ins が空の時には mark-symlinked-directories がなくて + も / を挿入するという事らしい。 + + うーん。元の bash と同じ振る舞いになる様に調整する事にした。これの判定は手 + 持ちの情報で既にできたのでその様にした。 + * term: wt で 描画中のカーソル移動が気になる [#D1758] flush する時か、或いは描画シーケンス自体にカーソル消去・表示のコードを埋め