mirror of
https://github.com/IlanCosman/tide.git
synced 2025-01-03 18:14:01 +03:00
use string matching in context item
This commit is contained in:
parent
d7f5041617
commit
96cecaafd9
@ -9,6 +9,6 @@ function _tide_item_context
|
||||
return
|
||||
end
|
||||
|
||||
test "$tide_context_hostname_parts" = 0 && _tide_print_item context $USER ||
|
||||
h=(string split . $hostname) _tide_print_item context $USER@(string join . $h[..$tide_context_hostname_parts])
|
||||
string match -qr "^(?<h>(\.?[^\.]*){0,$tide_context_hostname_parts})" @$hostname
|
||||
_tide_print_item context $USER$h
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user