diff options
Diffstat (limited to 'jterm.hs')
-rw-r--r-- | jterm.hs | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -474,11 +474,10 @@ handleEvent display win bgcolour fgcolour linecolour selcolour font event = do | otherwise = p (cs, ce) = cursor b c' - | cs <= e && ce > e = (s + l, ce) - | cs < s && ce >= s = (cs, s) - | cs >= s && ce <= e = (s + l, s + l) - | ce < s = (cs, ce) - | otherwise = (cs + l + s - e, ce + l + s - e) + | e <= cs = (cs + l + s - e, ce + l + s - e) + | ce <= s = (cs, ce) + | ce <= e && cs >= s = (s + l, s + l) + | otherwise = (min cs ce, ce + s - e) put $ b {content = doedit s e (content b) ins, cursor = c', ptycursor = if movepty then s + l else p'} where doedit s e rp ins = |