diff --git a/src/Yi/Lexer/common.hsinc b/src/Yi/Lexer/common.hsinc
--- a/src/Yi/Lexer/common.hsinc
+++ b/src/Yi/Lexer/common.hsinc
@@ -36,7 +36,11 @@
           Nothing -> (AlexEOF, lookahead)
           Just _  -> (AlexError input', lookahead)
       (AlexLastSkip input'' len, _, lookahead) -> (AlexSkip input'' len, lookahead)
+#if MIN_TOOL_VERSION_alex(3,2,0)
+      (AlexLastAcc k input'' len, _, lookahead) -> (AlexToken input'' len (alex_actions ! k), lookahead)
+#else
       (AlexLastAcc k input'' len, _, lookahead) -> (AlexToken input'' len k, lookahead)
+#endif
 
 
 -- Same as alex_scan_tkn, but also return the length of lookahead.
diff --git a/yi-misc-modes.cabal b/yi-misc-modes.cabal
--- a/yi-misc-modes.cabal
+++ b/yi-misc-modes.cabal
@@ -3,7 +3,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           yi-misc-modes
-version:        0.13.4
+version:        0.13.5
 synopsis:       Yi editor miscellaneous modes
 category:       Yi
 homepage:       https://github.com/yi-editor/yi#readme
@@ -38,6 +38,8 @@
     , yi-core
     , yi-language
     , yi-rope
+  build-tools:
+      alex >= 3.0.3 && < 3.2.0 || >= 3.2.1
   exposed-modules:
       Yi.Config.Default.MiscModes
       Yi.Modes
