Permalink
Browse files

Default modeline now displays hex char code.

  • Loading branch information...
1 parent 92bb2ae commit bf0dafe20d58a4cf4dc0750daef2ba8c3452fef5 @mgajda mgajda committed Sep 18, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 yi/src/library/Yi/Buffer/Misc.hs
@@ -161,6 +161,8 @@ import {-# source #-} Yi.Keymap
import Yi.Interact as I
import Yi.Buffer.Basic
import Data.Time
+import Numeric(showHex)
+import Data.Char(ord)
#ifdef TESTING
-- TODO: make this compile.
@@ -447,18 +449,21 @@ getModeLine prefix = do
ln <- curLn
p <- pointB
s <- sizeB
+ curChar <-readB
ro <-getA readOnlyA
modeNm <- gets (withMode0 modeName)
unchanged <- gets isUnchangedBuffer
let pct = if pos == 1 then "Top" else getPercent p s
chg = if unchanged then "-" else "*"
roStr = if ro then "%" else chg
+ hexChar = "0x" ++ Numeric.showHex (Data.Char.ord curChar) ""
nm <- gets $ shortIdentString prefix
return $
roStr ++ chg ++ " "
++ nm ++
replicate 5 ' ' ++
+ hexChar ++ " " ++
"L" ++ show ln ++ " " ++ "C" ++ show col ++
" " ++ pct ++
" " ++ modeNm ++

0 comments on commit bf0dafe

Please sign in to comment.