jtroo / kanata

Improve keyboard comfort and usability with advanced customization
GNU Lesser General Public License v3.0
2.16k stars 111 forks source link

Bug: kanata crashes randomly when typing a sequence in the latest build #449

Closed lelazsq closed 1 year ago

lelazsq commented 1 year ago

Describe the bug when i type a sequence, i get this error: thread '' panicked at 'internal error: entered unreachable code: subtrie should have a key', src\trie.rs:56:25 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace error: process didn't exit successfully: target\release\kanata.exe --cfg c:/users/rizq/documents/doffed-kanata.kbd (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)

Relevant kanata configs here's my config (though this bug should appear with any config that has sequences):

(defcfg
  sequence-input-mode visible-backspaced
  sequence-timeout 500
  danger-enable-cmd yes
  delegate-to-first-layer yes
)

(defsrc
  esc   1     2     3     4     5     6     7     8     9     0     -     =     bspc
  tab   q     w     e     r     t     y     u     i     o     p     [     ]     \
  caps  a     s     d     f     g     h     j     k     l     ;     '     ret
  lsft  z     x     c     v     b     n     m     ,     .     /     rsft
  lctl  lmet  lalt              spc               ralt  rmet
)

;; defines variables, t for tap-hold/tap-dance, d for one-shot
(defvar t 150 d 500 max 65535 half 32769)

;; main layer
(deflayer maya
  @grl  1     2     3     4     5     6     7     8     9     0     [     ]     @numnf
  tab   b     l     d     g     q     j     f     o     u     @pcb  ;     =     \
  @bnav n     @chr  @cht  @chs  @chv  k     h     a     e     i     @oss  ret
  @oss  @chx  @chm  @chc  @chw  z     p     y     '     /     @cms  @dsht
  @mods lmet  @rsym             @sseq             ralt  rmet
)

(deflayer qwerty
  @esl  1     2     3     4     5     6     7     8     9     0     -     =     bspc
  tab   q     w     e     r     t     y     u     i     o     p     [     ]     \
  caps  a     s     d     f     g     h     j     k     l     ;     '     ret 
  lsft  z     x     c     v     b     n     m     ,     .     /     rsft
  lctl  lmet  lalt              spc               ralt  rmet
)

(deflayer mouse
  _      _     _     _     _     _     _     _     _     _     _     _     _     _
  _      b     mrgt  d     mlft  q     mmid  mlft  @mwu  mrgt  _     _     _     _
  C-bspc n     r     t     s     v     _     @mlft @mdn  @mup  @mrgt _     _
  _      C-w   m     c     w     z     @my   mbtp  @mwd  mftp  _     _ 
  @grd   _     _                 @slw              _     _
)

(deflayer slow_mouse
  _      _     _     _     _     _     _     _      _     _     _      _     _     _
  _      _     _     _     _     _     mmid  mlft   @mwu  mrgt  _      _     _     _
  C-bspc _     _     _     _     _     @mos  @smlf  @smdn @smup @smrg  _     _
  _      _     _     _     _     _     @my   mbtp   @mwd  mftp  _      _ 
  _      _     _                 _                  _     _
)

(deflayer grid_mouse
  _     _     _     _     _     _     _     _     _     _     _     _     _     _
  _     _     _     _     _     _     _     @r1c1 @r1c2 @r1c3 @r1c4 _     _     _
  _     _     _     _     _     _     @mos  @r2c1 @r2c2 @r2c3 @r2c4 _     _
  _     _     _     _     _     _     @my   @r3c1 @r3c2 @r3c3 @r3c4 _ 
  _     _     _                 _                 _     _
)

;; sym layer, prob wiil add aliases for shifted keys
(deflayer sym
  _     _     _     _     _     _     _     _     _     _     _     _     _     _
  _     4     2     3     1     5     6     0     8     9     7     S-,   _     _
  `     S-4   +     S-9   S-0   S-`   \     -     =     S--   S-8   S-.   _
  S-\   S-3   S-[   S-]   S-1   S-2   S-7   [     ]     S-5   S-6   _ 
  lmet  _     _                 _                 _     _
)

(deflayer nav
  _     _     _     _     _     _     _     _     _     _     _     _     _     _
  _     _     _     _     _     _     esc   ret   pgup  home  _     _     _     _
  _     lmet  lalt  lsft  lctl  @dr   ins   lft   down  up    rght  _     _
  _     _     _     tab   @dp   _     prnt  del   pgdn  end   _     _ 
  _     _     _                 _                 _     _
)

;; homerow mods
(deflayer mods

  _     _     _     _     _     _     _     _     _     _     _     _     _     _
  _     _     _     _     _     _     _     _     _     _     _     _     _     _
  _     @metn @altr @sftt @ctls _     _     @ctlh @sfta @alte @meti _     _
  _     _     _     _     _     _     _     _     _     _     _     _ 
  _     _     _                 bspc              _     _
)

(deflayer cub1

  _      _     _     _     _     _     _     _     _     _     _     _     _     _
  _      @z'   @B    @L'   @l'   @x    @u    @r    @R    @B'   @z    _     _     _
  C-bspc @y'   @D    @L    @U'   @F'   @F    @U    @R'   @D'   @y    _     _
  @f'    @S'   @M'   @l    @my   @u'   @x'   @r'   @M    @S    @f    _ 
  _      _     _                 @cub2             _     _
)

(deflayer cub2

  _     _     _     _     _     _     _     _     _     _     _     _     _     _
  _     _     _     _     _     _     _     _     _     _     _     _     _     _
  _     _     @d    _     _     _     _     _     _     @d'   _     _     _
  _     _     _     _     _     _     _     _     _     _     _     _ 
  _     _     _                 _                 _     _
)

(defalias
  ;; multi-function keys
  grl (tap-hold $t $t grv (layer-toggle layouts))
  esl (tap-hold $t $t esc (layer-toggle layouts))
  rsym (tap-hold $t $t rpt (layer-toggle sym))
  bnav (tap-hold $t $t C-bspc (layer-toggle nav))
  mods (layer-toggle mods)
  oss (one-shot $d lsft)
  sseq (multi spc sldr) ;; used for emoji and cmini sequences
  dsht (tap-dance $t (- (cmd powershell shutdown /s /t 0)))
  numnf (tap-dance $t ((cmd-output-keys powershell.exe "if ($([console]::NumberLock) -match 'True') { echo '()' } else { echo '(nlck)' }") (cmd-output-keys powershell.exe "if ($([console]::NumberLock) -match 'True') { echo '(nlck)' } else { echo '()' }")))
  cms (tap-dance $t (, (layer-switch mouse)))
  mos (layer-switch mouse)
  pcb (tap-dance $t (. (layer-switch cub1)))

  ;; layouts
  my (layer-switch maya)
  tp (layer-switch l0)
  qwr (layer-switch qwerty)

  ;; consonant hand chord definitions
  chr (chord cc r)
  chs (chord cc s)
  chc (chord cc c)
  chw (chord cc w)
  cht (chord cc t)
  chv (chord cc v)
  chm (chord cc m)
  chx (chord cc x)

  ;; dynamic macros
  dr (dynamic-macro-record 0)
  dp (dynamic-macro-play 0)

  ;; taipo chords
  ph (chord l0 ph)
  rh (chord l0 rh)
  mh (chord l0 mh)
  ih (chord l0 ih)

  pu (chord l0 pu)
  ru (chord l0 ru)
  mu (chord l0 mu)
  iu (chord l0 iu)

  ph1 (chord l1 ph1)
  rh1 (chord l1 rh1)
  mh1 (chord l1 mh1)
  ih1 (chord l1 ih1)

  pu1 (chord l1 pu1)
  ru1 (chord l1 ru1)
  mu1 (chord l1 mu1)
  iu1 (chord l1 iu1)

  ph2 (chord l2 ph2)
  rh2 (chord l2 rh2)
  mh2 (chord l2 mh2)
  ih2 (chord l2 ih2)

  pu2 (chord l2 pu2)
  ru2 (chord l2 ru2)
  mu2 (chord l2 mu2)
  iu2 (chord l2 iu2)

  ;; taipo layers
  l0 (layer-toggle l0)
  l1 (layer-toggle l1)
  l2 (layer-toggle l2)

  ;; homerow mods
  metn (tap-hold $t $t n (one-shot $d lmet))
  altr (tap-hold $t $t r (one-shot $d lalt))
  sftt (tap-hold $t $t t (one-shot $d lsft))
  ctls (tap-hold $t $t s (one-shot $d lctl))

  ctlh (tap-hold $t $t h (one-shot $d rctl))
  sfta (tap-hold $t $t a (one-shot $d rsft))
  alte (tap-hold $t $t e (one-shot $d lalt))
  meti (tap-hold $t $t i (one-shot $d lmet))

  ;; mouse movement
  mwu (mwheel-up 50 120)
  mwd (mwheel-down 50 120)
  mup (movemouse-accel-up 1 1000 1 5)
  mlft (movemouse-accel-left 1 1000 1 5)
  mdn (movemouse-accel-down 1 1000 1 5)
  mrgt (movemouse-accel-right 1 1000 1 5)

  smup (movemouse-up 3 1)
  smlf (movemouse-left 3 1)
  smdn (movemouse-down 3 1)
  smrg (movemouse-right 3 1)

  r1c1 (tap-dance $t ((setmouse 8192 10923) (setmouse 1 1)))
  r1c2 (tap-dance $t ((setmouse 24576 10923) (setmouse 24576 1)))
  r1c3 (tap-dance $t ((setmouse 40960 10923) (setmouse 40960 1)))
  r1c4 (tap-dance $t ((setmouse 57344 10923) (setmouse $max 1)))
  r2c1 (setmouse 8192 $half)
  r2c2 (tap-dance $t ((setmouse 24576 $half) (setmouse $half $half)))
  r2c3 (setmouse 40960 $half)
  r2c4 (setmouse 57344 $half)
  r3c1 (tap-dance $t ((setmouse 8192 54615) (setmouse 1 $max)))
  r3c2 (tap-dance $t ((setmouse 24576 54615) (setmouse 24576 $max)))
  r3c3 (tap-dance $t ((setmouse 40960 54615) (setmouse 40960 $max)))
  r3c4 (tap-dance $t ((setmouse 57344 54615) (setmouse $max $max)))

  ;; mouse layers
  slw (layer-toggle slow_mouse)
  grd (layer-toggle grid_mouse)

  ;; taipo fn for typing f keys
  fn (macro sldr 10 f24)

  ;; cubing moves
  R (tap-dance $t ((macro S-r spc) (macro S-r kp2 spc)))
  R' (tap-dance $t ((macro S-r ' spc) (macro S-r kp2 ' spc)))
  U (tap-dance $t ((macro S-u spc) (macro S-u kp2 spc)))
  U' (tap-dance $t ((macro S-u ' spc) (macro S-u kp2 ' spc)))
  F (tap-dance $t ((macro S-f spc) (macro S-f kp2 spc)))
  F' (tap-dance $t ((macro S-f ' spc) (macro S-f kp2 ' spc)))
  L (tap-dance $t ((macro S-l spc) (macro S-l kp2 spc)))
  L' (tap-dance $t ((macro S-l ' spc) (macro S-l kp2 ' spc)))
  D (tap-dance $t ((macro S-d spc) (macro S-d kp2 spc)))
  D' (tap-dance $t ((macro S-d ' spc) (macro S-d kp2 ' spc)))
  B (tap-dance $t ((macro S-b spc) (macro S-b kp2 spc)))
  B' (tap-dance $t ((macro S-b ' spc) (macro S-b kp2 ' spc)))

  r (tap-dance $t ((macro r spc) (macro r kp2 spc)))
  r' (tap-dance $t ((macro r ' spc) (macro r kp2 ' spc)))
  u (tap-dance $t ((macro u spc) (macro u kp2 spc)))
  u' (tap-dance $t ((macro u ' spc) (macro u kp2 ' spc)))
  l (tap-dance $t ((macro l spc) (macro l kp2 spc)))
  l' (tap-dance $t ((macro l ' spc) (macro l kp2 ' spc)))
  f (tap-dance $t ((macro f spc) (macro f kp2 spc)))
  f' (tap-dance $t ((macro f ' spc) (macro f kp2 ' spc)))
  d (tap-dance $t ((macro d spc) (macro d kp2 spc)))
  d' (tap-dance $t ((macro d ' spc) (macro d kp2 ' spc)))

  M (tap-dance $t ((macro S-m spc) (macro S-m kp2 spc)))
  M' (tap-dance $t ((macro S-m ' spc) (macro S-m kp2 ' spc)))
  S (tap-dance $t ((macro S-s spc) (macro S-s kp2 spc)))
  S' (tap-dance $t ((macro S-s ' spc) (macro S-s kp2 ' spc)))

  y (tap-dance $t ((macro y spc) (macro y kp2 spc)))
  y' (tap-dance $t ((macro y ' spc) (macro y kp2 spc)))
  x (tap-dance $t ((macro x spc) (macro x kp2 spc)))
  x' (tap-dance $t ((macro x ' spc) (macro x kp2 spc)))
  z (tap-dance $t ((macro z spc) (macro z kp2 spc)))
  z' (tap-dance $t ((macro z ' spc) (macro z kp2 spc)))

  cub2 (layer-toggle cub2)
)

;; consonant hand chords
(defchords cc 30
  (r              ) r
  (  s            ) s
  (    c          ) c
  (      w        ) w
  (        t      ) t
  (          v    ) v
  (            m  ) m
  (              x) x
  (r s            ) (macro r l)
  (r     w        ) (macro s c)
  (r     w t      ) (macro s c r)
  (r s     t      ) (macro r l d)
  (    c   t      ) (multi (one-shot 50 lctl) c)
  (        t v    ) (multi (one-shot 50 lctl) v)
  (    c       m  ) (macro m b)
  (            m x) (macro b l)
  (    c w     m  ) (macro s i d)
)

;; used for sequences
(deffakekeys
  ;; taipo f key sequences
  f1 f1
  f2 f2
  f3 f3
  f4 f4
  f5 f5
  f6 f6
  f7 f7
  f8 f8
  f9 f9
  f10 f10
  f11 f11
  f12 f12

  ;; emoji sequences
  dbl (macro S-; d o f b l u s h S-; spc)
  dnn (macro S-; d o f n i n i S-; spc)
  dtv (macro S-; d o f t e c t i v e S-; spc)
  dsm (macro S-; d o f s m i e S-; spc)
  dbn (macro S-; d o f b l a n k e e S-; spc)
  dxy (macro S-; o x e y S-; spc)
  dcb (macro S-; d o f c u b e S-; spc)
  dwi (macro S-; d o f w i t h i t S-; spc)
  dgn (macro S-; d o f g u n S-; spc)
  ddg (macro S-; d o f d g e S-; spc)
  dwn (macro S-; d o f S-w S-; spc)
  dqn (macro S-; d o f q u e e n S-; spc)
  dsi (macro S-; d o f i s s u e S-; spc)
  dkl (macro S-; d o f a k l S-; spc)
  dtr (macro S-; d o f t l d r S-; spc)
  djl (macro S-; d o f j a i l S-; spc)
  smd (macro S-; s m i e d o f S-; spc)
  dcn (macro S-; b u s h d o f S-; spc)
  dns (macro S-; d o f n i n i s S-; spc)
  dbr (macro S-; d o f b r i a n S-; spc)
  sbc (macro S-; S-s o b S-c a t S-; spc)
  ymc (macro S-; S-y u m S-c a t S-; spc)
  wgc (macro S-; S-w o a g S-c a t S-; spc)
  wrc (macro S-; S-w o r r i e d S-c a t S-; spc)
  mnc (macro S-; S-m e n a c e S-c a t S-; spc)
  hec (macro S-; h e a r t S-- e y e s S-- c a t S-; spc)
  blc (macro S-; S-f l u s h e d S-c a t S-; spc)
  htc (macro S-; S-h o t S-c a t S-; spc)
  cdc (macro S-; S-c o l d S-c a t S-; spc)
  pnc (macro S-; S-p e n s i v e S-c a t S-; spc)
  ywc (macro S-; S-y a w n i n g S-c a t S-; spc)
  csp (macro S-; c a t s p a i r S-; spc)
  pbg (macro S-; b u g S-; spc)
  rbg (macro S-; r a r e b u g S-; spc)
  bbg (macro S-; b u g g i g n S-; spc)
  wpy (macro S-; w o o p e r S-;)
  wpn (macro S-; w o o p e r n o S-;)
  dpt (macro S-; d o f p e t S-;)
  flc (macro S-; S-f l u s h e d S-c a t S-;)
  nsc (macro S-; S-n a u s e o u s S-c a t S-;)
  pld (macro S-; p l e a d i n g S-(r e a l) S-;)
  cbk (macro S-; c a t b o n k S-;)
  dbd (macro S-; d o f b l u s h t e c t i v e S-;)
  bls (macro S-; b l u s h d o f S-;)
  ;; cmini sequences
  add (macro S-1 c m i n i spc a d d spc S-ret grv grv grv S-ret grv grv grv C-lft C-lft C-lft C-lft)
  corpus (macro S-1 c m i n i spc c o r p u s spc)
  swap! (macro S-1 c m i n i spc s w a p S-1 spc)
  swap (macro S-1 c m i n i spc s w a p spc)
  examples (macro S-1 c m i n i spc e x a m p l e s spc)
  homerow (macro S-1 c m i n i spc h o m e r o w spc)
  like (macro S-1 c m i n i spc l i k e spc)
  likes (macro S-1 c m i n i spc l i k e s spc)
  list (macro S-1 c m i n i spc l i s t spc)
  remove (macro S-1 c m i n i spc r e m o v e spc)
  rename (macro S-1 c m i n i spc r e n a m e spc)
  search (macro S-1 c m i n i spc s e a r c h spc)
  sfbs (macro S-1 c m i n i spc s f b s spc)
  sfss (macro S-1 c m i n i spc s f s spc)
  stats (macro S-1 c m i n i spc s t a t s spc)
  unlike (macro S-1 c m i n i spc u n l i k e spc)
  view (macro S-1 c m i n i spc v i e w spc)
  names (macro S-1 c m i n i spc n a m e s S-ret grv grv grv S-ret grv grv grv)
  dofball (macro S-1 c m i n i spc d o f b a l l spc) 
  catball (macro S-1 c m i n i spc c a t b a l l spc)
  wooperball (macro S-1 c m i n i spc w o o p e r b a l l spc)
  8ball (macro S-1 c m i n i spc 8 b a l l spc)
  suggest (macro S-1 c m i n i spc s u g g e s t spc)
  pairings (macro S-1 c m i n i spc p a i r i n g s spc)
  freq (macro S-1 c m i n i spc f r e q spc)
  cmini (macro S-1 c m i n i spc)

  tnl (cmd powershell start-process wt.exe)
  lvt (macro c d spc l e v e l t y p e / c m d ret 100 g o spc r u n spc m a i n . g o ret)
  lyz (macro c d spc o x e y l y z e r ret 100 c a r g o spc r u n spc - - r e l e a s e ret)
)

;; where sequences are defined
(defseq
  f1 (f24 1)
  f2 (f24 2)
  f3 (f24 3)
  f4 (f24 4)
  f5 (f24 5)
  f6 (f24 6)
  f7 (f24 7)
  f8 (f24 8)
  f9 (f24 9)
  f10 (f24 0)
  f11 (f24 o 1)
  f12 (f24 o 2)

  dbl (d b l spc)
  dnn (d n n spc)
  dtv (d t v spc)
  dsm (d s m spc)
  dbn (d b n spc)
  dxy (d x y spc)
  dcb (d c b spc)
  dwi (d w i spc)
  dgn (d g n spc)
  ddg (d d g spc)
  dwn (d w n spc)
  dqn (d q n spc)
  dsi (d s i spc)
  dkl (d k l spc)
  dtr (d t r spc)
  djl (d j l spc)
  smd (s m d spc)
  dcn (d c n spc)
  dns (d n s spc)
  dbr (d b r spc)
  sbc (s b c spc)
  ymc (y m c spc)
  wgc (w g c spc)
  wrc (w r c spc)
  mnc (m n c spc)
  hec (h e c spc)
  blc (b l c spc)
  htc (h t c spc)
  cdc (c d c spc)
  pnc (p n c spc)
  ywc (y w c spc)
  csp (c s p spc)
  pbg (p b g spc)
  rbg (r b g spc)
  bbg (b b g spc)
  wpy (w p y spc)
  wpn (w p n spc)
  dpt (d p t spc)
  flc (f l c spc)
  nsc (n s c spc)
  pld (p l d spc)
  cbk (c b k spc)
  dbd (d b d spc)
  bls (b l s spc)

  add (, a spc)
  corpus (, c p spc)
  swap! (, s p spc)
  swap (, s spc)
  examples (, e spc)
  homerow (, h spc)
  like (, t spc)
  likes (, t s spc)
  list (, l spc)
  remove (, r spc)
  rename (, n spc)
  search (, f spc)
  sfbs (, f b spc)
  sfss (, f s spc)
  stats (, s t spc)
  unlike (, u t spc)
  view (, v spc)
  names (, n s spc)
  dofball (, d b spc)
  catball (, c b spc)
  wooperball (, w b spc)
  8ball (, e b spc)
  suggest (, g spc)
  pairings (, p spc)
  freq (, q spc)
  cmini (, c spc)

  tnl (t n l spc)
  lvt (l v t spc)
  lyz (l y z spc)
)

;; taipo chords
(defchords l0 30
  (ih                     ) e
  (   mh                  ) t
  (      rh               ) o
  (         ph            ) a
  (            iu         ) i
  (               mu      ) n
  (                  ru   ) s
  (                     pu) r
  (ih mh                  ) h
  (      rh ph            ) l
  (            iu mu      ) y
  (                  ru pu) b
  (            iu       pu) g
  (   mh rh               ) u
  (ih       ph            ) d
  (               mu ru   ) p
  (ih    rh               ) c
  (   mh    ph            ) q
  (            iu    ru   ) f
  (               mu    pu) z
  (ih                ru   ) v
  (   mh                pu) x
  (      rh    iu         ) k
  (         ph    mu      ) j
  (      rh       mu      ) -
  (         ph iu         ) w
  (ih                   pu) m
  (   mh             ru   ) /
  (         ph       ru   ) '
  (      rh             pu) ;
  (   mh       iu         ) S-/
  (ih             mu      ) ,
  (ih          iu         ) (one-shot $t lsft)
  (   mh          mu      ) (one-shot $t lctl)
  (      rh          ru   ) (one-shot $t lalt)
  (         ph          pu) (one-shot $t lmet)
  (ih mh rh               ) (one-shot $t ret)
  (            iu mu ru   ) (one-shot $t tab)
)

(defchords l1 30
  (ih1                            ) S-e
  (    mh1                        ) S-t
  (        rh1                    ) S-o
  (            ph1                ) S-a
  (                iu1            ) S-i
  (                    mu1        ) S-n
  (                        ru1    ) S-s
  (                            pu1) S-r
  (ih1 mh1                        ) S-h
  (        rh1 ph1                ) S-l
  (                iu1 mu1        ) S-y
  (                        ru1 pu1) S-b
  (                iu1         pu1) S-g
  (    mh1 rh1                    ) S-u
  (ih1         ph1                ) S-d
  (                    mu1 ru1    ) S-p
  (ih1     rh1                    ) S-c
  (    mh1     ph1                ) S-q
  (                iu1     ru1    ) S-f
  (                    mu1     pu1) S-z
  (ih1                     ru1    ) S-v
  (    mh1                     pu1) S-x
  (        rh1     iu1            ) S-k
  (            ph1     mu1        ) S-j
  (        rh1         mu1        ) S--
  (            ph1 iu1            ) S-w
  (ih1                         pu1) S-m
  (    mh1                 ru1    ) \
  (            ph1         ru1    ) S-'
  (        rh1                 pu1) S-;
  (    mh1         iu1            ) S-1
  (ih1                 mu1        ) .
  (ih1             iu1            ) (one-shot $t lft)
  (    mh1             mu1        ) (one-shot $t down)
  (        rh1             ru1    ) (one-shot $t up)
  (            ph1             pu1) (one-shot $t rght)
  (ih1 mh1 rh1                    ) (one-shot $t esc)
  (                iu1 mu1 ru1    ) (one-shot $t del)
)

(defchords l2 30
  (ih2                            ) S-9
  (    mh2                        ) [
  (        rh2                    ) S-[
  (            ph2                ) S-,
  (                iu2            ) S-0
  (                    mu2        ) ]
  (                        ru2    ) S-]
  (                            pu2) S-.
  (ih2 mh2                        ) 0
  (        rh2 ph2                ) 4
  (                iu2 mu2        ) 5
  (                        ru2 pu2) 9
  (                iu2         pu2) S-3
  (    mh2 rh2                    ) 2
  (ih2         ph2                ) S-2
  (                    mu2 ru2    ) 7
  (ih2     rh2                    ) 1
  (    mh2     ph2                ) 3
  (                iu2     ru2    ) 6
  (                    mu2     pu2) 8
  (ih2                     ru2    ) S-8
  (    mh2                     pu2) S-6
  (        rh2     iu2            ) +
  (            ph2     mu2        ) =
  (        rh2         mu2        ) S-5
  (            ph2 iu2            ) S-7
  (ih2                         pu2) S-4
  (    mh2                 ru2    ) S-\
  (            ph2         ru2    ) `
  (ih2                 mu2        ) S-`
  (ih2             iu2            ) (one-shot $t pgdn)
  (    mh2             mu2        ) (one-shot $t end)
  (        rh2             ru2    ) (one-shot $t home)
  (            ph2             pu2) (one-shot $t pgup)
  (ih2 mh2 rh2                    ) (one-shot $t ralt)
  (                iu2 mu2 ru2    ) @fn
)

;; layouts layer
(deflayer layouts
  _     @qwr  @my   lrld  _     _     _     _     _     _     _     _     _     _
  _     @tp   _     _     _     _     _     _     _     _     _     _     _     _
  _     _     _     _     _     _     _     _     _     _     _     _     _
  _     _     _     _     _     _     _     _     _     _     _     _ 
  _     _     _                 _                 _     _
)

;; taipo layers, hidden at the bottom because they look ugly
(deflayer l0
  @grl  _     _     _     _     _     _     _     _     _     _     _     _     _
  _     @pu   @ru   @mu   @iu   _     _     _     _     @iu   @mu   @ru   @pu   @pu
  _     @ph   @rh   @mh   @ih   _     _     _     _     @ih   @mh   @rh   @ph
  _     _     _     _     _     _     _     _     _     _     _     _ 
  @l2   _     @l1               _                 _     _
)

(deflayer l1
  @grl  _     _     _     _     _     _     _     _     _     _     _     _     _
  _     @pu1  @ru1  @mu1  @iu1  _     _     _     _     @iu1  @mu1  @ru1  @pu1  @pu1
  _     @ph1  @rh1  @mh1  @ih1  _     _     _     _     @ih1  @mh1  @rh1  @ph1
  _     _     _     _     _     _     _     _     _     _     _     _ 
  @l2   _     _                 _                 _     _
)

(deflayer l2
  @grl  _     _     _     _     _     _     _     _     _     _     _     _     _
  _     @pu2  @ru2  @mu2  @iu2  _     _     _     _     @iu2  @mu2  @ru2  @pu2  @pu2
  _     @ph2  @rh2  @mh2  @ih2  _     _     _     _     @ih2  @mh2  @rh2  @ph2
  _     _     _     _     _     _     _     _     _     _     _     _ 
  _     _     @l1               _                 _     _
)

To reproduce use the config above, press space (starts sequence leader) then type ,q.

Expected behavior !cmini freq to be outputted.

Operating system Windows 11

Additional context kanata sometimes crashes randomly without typing a sequence but I can't find a way to replicate it.

jtroo commented 1 year ago

Thanks for the bug report!

jtroo commented 1 year ago

Ah interesting, it's hitting this statement marked unreachable:

https://github.com/jtroo/kanata/blob/e681f0928e9fe2cc7fbec7ae93b077f0f5549aab/src/trie.rs#L56

Haven't had a chance to look into it more yet.

jtroo commented 1 year ago

Should hopefully be fixed in the linked PR!

jtroo commented 1 year ago

Reopening just for confirmation.

lelazsq commented 1 year ago

it works! thank you.