Skip to content

Commit 48a77ad

Browse files
committed
add _ZL_CLINK_PROMPT_PRIORITY set clink prompt register priority.
1 parent 72c3676 commit 48a77ad

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ z -b foo # cd to the parent directory starting with foo
142142
- set `$_ZL_MATCH_MODE` to 1 to enable enhanced matching.
143143
- set `$_ZL_NO_CHECK` to 1 to disable path validation, use `z --purge` to clean
144144
- set `$_ZL_HYPHEN` to 1 to treat hyphon (-) as a normal character not a lua regexp keyword.
145+
- set `$_ZL_CLINK_PROMPT_PRIORITY` change clink prompt register priority (default 99).
145146

146147
## Aging
147148

z.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,7 @@ end
20592059
-----------------------------------------------------------------------
20602060
function z_clink_init()
20612061
local once = os.environ("_ZL_ADD_ONCE", false)
2062+
local _zl_clink_prompt_priority = os.environ('_ZL_CLINK_PROMPT_PRIORITY', 99)
20622063
local previous = ''
20632064
function z_add_to_database()
20642065
pwd = clink.get_cwd()
@@ -2070,7 +2071,7 @@ function z_clink_init()
20702071
end
20712072
z_add(clink.get_cwd())
20722073
end
2073-
clink.prompt.register_filter(z_add_to_database, 99)
2074+
clink.prompt.register_filter(z_add_to_database, _zl_clink_prompt_priority)
20742075
function z_match_completion(word)
20752076
local M = z_match({word}, Z_METHOD, Z_SUBDIR)
20762077
for _, item in pairs(M) do

0 commit comments

Comments
 (0)