@kecan0406/ttheme 1.0.35 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kecan0406/ttheme",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "ttheme": "bin/ttheme.js"
@@ -1,8 +1,10 @@
1
1
  #!/bin/zsh -f
2
2
 
3
- source ${0:A:h}/ttheme.zsh
3
+ config=${XDG_CONFIG_HOME:-$HOME/.config}/ttheme/config.zsh
4
+ [[ -r $config ]] && source $config
4
5
 
5
6
  if [[ ${TTHEME_TAB_PALETTE:-off} != off ]]; then
7
+ source ${0:A:h}/ttheme.zsh
6
8
  __tt_next
7
9
  __tt_apply "$REPLY"
8
10
  export TTHEME_SPEC=$REPLY
package/shell/ttheme.zsh CHANGED
@@ -31,6 +31,7 @@ __tt_gone() {
31
31
  for hook in precmd:__tt_fresh precmd:__tt_precmd precmd:__tt_unmux preexec:__tt_preexec preexec:__tt_mux chpwd:__tt_chpwd; do
32
32
  add-zsh-hook -d ${hook%%:*} ${hook#*:}
33
33
  done
34
+ (( $+functions[add-zle-hook-widget] )) && add-zle-hook-widget -d line-init __tt_focus_on
34
35
  unfunction ttheme
35
36
  }
36
37
 
@@ -243,10 +244,9 @@ __tt_sync() {
243
244
  __tt_shown "$REPLY" && __tt_reload
244
245
  }
245
246
 
246
- __tt_precmd() {
247
- printf '\e[?1004h'
248
- __tt_sync
249
- }
247
+ __tt_precmd() { __tt_sync }
248
+
249
+ __tt_focus_on() { printf '\e[?1004h' }
250
250
 
251
251
  __tt_preexec() { printf '\e[?1004l' }
252
252
 
@@ -282,6 +282,9 @@ __tt_bind_focus() {
282
282
  local k
283
283
  zle -N __tt_focus
284
284
  zle -N __tt_blur
285
+ zle -N __tt_focus_on
286
+ autoload -Uz add-zle-hook-widget
287
+ add-zle-hook-widget line-init __tt_focus_on
285
288
  for k in emacs viins vicmd; do
286
289
  bindkey -M $k '^[[I' __tt_focus
287
290
  bindkey -M $k '^[[O' __tt_blur