@@ -135,6 +135,11 @@ deleteLeftWord (TextZipper lb b a la) =
135135 (l:ls) -> deleteLeftWord $ TextZipper ls l a la
136136 else TextZipper lb (T.dropWhileEnd (not . isSpace) b') a la
137137
138+-- | Insert up to n spaces to get to the next logical column that is a multiple of n
139+tab :: Int -> TextZipper -> TextZipper
140+tab n z@(TextZipper _ b _ _) =
141+ insert (T.replicate (fromEnum $ n - (T.length b `mod` n)) " ") z
142+
138143-- | The plain text contents of the zipper
139144value :: TextZipper -> Text
140145value (TextZipper lb b a la) = T.intercalate "\n" $ mconcat [ reverse lb