Skip to content

Commit

Permalink
Styling.
Browse files Browse the repository at this point in the history
  • Loading branch information
ethercrow committed Oct 1, 2014
1 parent d2a5586 commit ff62599
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions yi/src/library/Yi/Buffer/Region.hs
Expand Up @@ -128,11 +128,12 @@ inclusiveRegionB r =
-- a list of small regions form this block region.
blockifyRegion :: Region -> BufferM [Region]
blockifyRegion r = savingPointB $ do
[lowCol,highCol] <- sort <$> mapM colOf [regionStart r, regionEnd r]
[lowCol, highCol] <- sort <$> mapM colOf [regionStart r, regionEnd r]
startLine <- lineOf $ regionStart r
endLine <- lineOf $ regionEnd r
when (startLine > endLine) $ fail "blockifyRegion: impossible"
mapM (\line -> mkRegion <$> pointOfLineColB line lowCol <*> pointOfLineColB line (1 + highCol))
mapM (\line -> mkRegion <$> pointOfLineColB line lowCol
<*> pointOfLineColB line (1 + highCol))
[startLine..endLine]

-- | Joins lines in the region with a single space, skipping any empty
Expand Down
3 changes: 2 additions & 1 deletion yi/src/library/Yi/UI/Utils.hs
Expand Up @@ -80,7 +80,8 @@ paintStrokes f0 x0 lf@((pf,f):tf) lx@((px,x):tx) =
paintPicture :: a -> [[Span (Endo a)]] -> [(Point,a)]
paintPicture a = foldr (paintStrokes id a . strokePicture) []

attributesPictureB :: UIStyle -> Maybe SearchExp -> Region -> [[Span StyleName]] -> BufferM [(Point,Attributes)]
attributesPictureB :: UIStyle -> Maybe SearchExp -> Region -> [[Span StyleName]]
-> BufferM [(Point,Attributes)]
attributesPictureB sty mexp region extraLayers =
paintPicture (baseAttributes sty) <$>
fmap (fmap (fmap ($ sty))) <$>
Expand Down

0 comments on commit ff62599

Please sign in to comment.