Commit Graph

495 Commits

Author SHA1 Message Date
Jonathan Daugherty
62f5ea36e8
Merge pull request #215 from hapytex/hlint/remove-unused-pragmas
Remove unused LANGUAGE pragmas
2021-02-18 07:30:49 -08:00
Jonathan Daugherty
b21145850c
Merge pull request #216 from hapytex/hlint/redundant-dollar
remove redundant $s
2021-02-18 06:52:28 -08:00
Willem Van Onsem
68ec269cf5
remove redundant $s 2021-02-18 07:40:26 +01:00
Willem Van Onsem
b91829353f remove unused BangPatterns 2021-02-18 07:24:07 +01:00
Willem Van Onsem
152d3d6c07 remove unused NamedFieldPuns 2021-02-18 07:21:23 +01:00
Jonathan Daugherty
fdad9586c4
Merge pull request #214 from hapytex/hlint/atomically-to-io
use readTVarIO and newTVarIO as specialized atomic versions of readTV…
2021-02-17 14:48:41 -08:00
Willem Van Onsem
f0fb92aca0 use readTVarIO and newTVarIO as specialized atomic versions of readTVar and newTVar 2021-02-17 23:46:15 +01:00
Jonathan Daugherty
003f491a43
Merge pull request #212 from hapytex/hlint/group-import
Hlint/group import
2021-02-17 14:41:10 -08:00
Willem Van Onsem
a803a2ad72 use head over !!0 2021-02-17 23:38:49 +01:00
Willem Van Onsem
194cd8502c group import 2021-02-17 23:35:49 +01:00
Jonathan Daugherty
309c0e4824
Merge pull request #209 from hapytex/improvement/simplify-color
rewrite the color logic
2021-02-16 13:34:13 -08:00
Jonathan Daugherty
bf0874598f combinedOpsForLayers: fix 2021-02-16 13:10:06 -08:00
Jonathan Daugherty
f0f729d755
Merge pull request #202 from hapytex/hlint/eta-reduction
eta reductions
2021-02-16 09:45:47 -08:00
Jonathan Daugherty
572c59881b
Merge pull request #203 from hapytex/hlint/use-fmap
make use of <$>
2021-02-16 09:44:49 -08:00
Willem Van Onsem
9eaa5e5cb5 16 iso 15 2021-02-16 13:27:46 +01:00
Willem Van Onsem
ffdd86df1c rewrite the color logic 2021-02-16 12:15:12 +01:00
Willem Van Onsem
f2c58a1870 extra improvements 2021-02-16 09:26:54 +01:00
Jonathan Daugherty
dfa4c1ec08
Merge pull request #207 from hapytex/hlint/redundant-bracket
remove useless parenthesis and ellipse
2021-02-15 15:58:45 -08:00
Willem Van Onsem
9c479554ee revert pattern brackets 2021-02-15 23:59:25 +01:00
Jonathan Daugherty
ab621ee8a4
Merge pull request #204 from hapytex/hlint/remove-lambda
avoid lambda expressions
2021-02-15 14:48:32 -08:00
Jonathan Daugherty
7f8d21b8d6
Merge pull request #205 from hapytex/hlint/use-string
use String over [Char]
2021-02-15 14:43:08 -08:00
Willem Van Onsem
0e5c1646f6 remove useless parenthesis and ellipse 2021-02-15 23:07:09 +01:00
Willem Van Onsem
bed8068d37 use String over [Char] 2021-02-15 17:42:45 +01:00
Willem Van Onsem
b5da64bb63 avoid lambda expressions 2021-02-15 17:39:53 +01:00
Willem Van Onsem
d3a1a5576a make use of <$> 2021-02-15 17:08:15 +01:00
Willem Van Onsem
ec463f1c85 eta reductions 2021-02-15 12:12:20 +01:00
Jonathan Daugherty
fd90f7dc85 Cursor: add PositionOnly constructor for cursor placement without visibility 2020-12-06 17:17:20 -08:00
Eric Mertens
36c1dcc451 Simplify definition of MaybeDefault
The previous version of MaybeDefault stores pointers to the Eq, Show, and Read instances of the defaulted value.

MaybeDefault is used with Style, Color, and Text. All of these types already have all of the necessary instances, and we never work with MaybeDefault generically. Defering the Show, Eq, and Read instances down to the SetTo case isn't helping us to work with types that don't have these instances.
2020-11-16 09:56:30 -08:00
Jonathan Daugherty
99d738b02c Add missing import 2020-11-08 20:43:06 -08:00
Emeka Nkurumeh
4aa1873485 follow up to #89 - ensure string are the same case 2020-11-08 22:37:12 -06:00
Jonathan Daugherty
0b4fa6410b Merge branch 'master' of github.com:jtdaugherty/vty into master 2020-11-04 18:11:48 -08:00
Jonathan Daugherty
27e9bf77a5 specialSupportKeys: add cases for Meta-PageUp and Meta-PageDown (fixes #193) 2020-11-04 18:11:43 -08:00
Jonathan Daugherty
ef6b73d71b supportsItalics, supportsStrikethrough: documentation 2020-10-13 08:57:43 -07:00
Jonathan Daugherty
bcbf7fabc1 Output: add supportsItalics and supportsStrikethrough to check for feature support 2020-10-13 08:52:18 -07:00
Jonathan Daugherty
1dc2379e3c Add support for strikethrough mode
This change adds a new 'strikethrough' Style value and uses the 'smxx'
and 'rmxx' Terminfo capabilities to activate and deactivate
strikethrough mode, respectively. If the terminfo does not report those
capabilities, this style is ignored.

For details, see

https://invisible-island.net/xterm/terminfo-contents.html#tic-ecma_strikeout
2020-09-30 12:45:58 -07:00
Jonathan Daugherty
dea6fbfa98 XTermColor: remove unhelpful comment 2020-07-29 11:35:17 -07:00
Jonathan Daugherty
6a9c90da0e Output: add setDisplayBounds field and implementation for TerminfoBased backend 2020-07-15 13:49:05 -07:00
Jonathan Daugherty
cb08446df4 Graphics.Vty: add setWindowTitle (fixes #188) 2020-07-15 10:42:29 -07:00
Jonathan Daugherty
a828f305d0 Merge branch 'bugfix/terminal-init-flags' 2020-07-09 15:05:20 -07:00
Jonathan Daugherty
812e873499 Input: add a new field, restoreInputState
This change adds a new record field to the Input type to allow the end
user to have direct access to the logic needed to restore the terminal's
input state flags. Prior to this change, this state restoration logic
could only be invoked as part of calling 'shutdownInput', but since that
function does other things (like killing threads) it is not advisable to
call it repeatedly (which is necessary in the use case this change is
intended to support).

This change supports a use case where an application initializes
Vty repeatedly, with changes to the input state flags in between
initializations, but where the application wants to ensure that the
*final* input state flag configuration matches the terminal's condition
before Vty started handling input for the first time. This change allows
applications to access the state restoration for the initial Vty handle
by exposing the logic directly in a field of Input.

The input state restoration is still an implicit part of invoking
'shutdownInput' (and thus 'shutdown') so no user-facing changes are
required for applications that do not build their own Input structures.
2020-07-09 15:01:45 -07:00
Jonathan Daugherty
e49ea78472 Whitespace 2020-07-09 14:14:17 -07:00
Jonathan Daugherty
be263d4893 Typo 2020-07-09 14:07:33 -07:00
Jonathan Daugherty
620a5ca544 attributeControl: document which constructors map to which terminal mode flags 2020-07-09 14:07:14 -07:00
Jonathan Daugherty
95cabe0b87 inputForConfig: move mode flag documentation to the right place and update it to include enabled flags 2020-07-09 14:05:45 -07:00
Jonathan Daugherty
c572ad1ac7 attributeControl: explicitly enable a required mode flag (see #187)
Prior to this change, Vty would initialize the terminal by clearing the
flags it needed to clear. That is good, but it means that some flags
that were assumed to be enabled but not *explicitly* enabled by Vty
would cause trouble if they were not, in fact, enabled prior to Vty
initialization.

This comes up in (pathological?) cases where the terminal state prior to
Vty initialization is not what Vty assumes it will be, i.e., cases in
which some flags which are assumed to be set are not. We found this to
be true when an application (in this case vim) was terminated uncleanly,
leaving the terminal mode flags in a state that Vty did not anticipate.

To resolve this problem, this change explicitly sets one flag which we
now know to be required for Vty to function properly (the ICRNL flag).
2020-07-09 13:57:33 -07:00
Jonathan Daugherty
17e2560846 Clarify the meaning of "escapes" in some Haddocks (fixes #186) 2020-05-02 15:53:44 -07:00
Jonathan Daugherty
ab10b97e31 Graphics.Vty.UnicodeWidthTable.Install: use withMVar to avoid boilerplate 2020-03-09 13:49:11 -07:00
Jonathan Daugherty
0d2226cb1a installUnicodeWidthTable: use throwIO, not throw 2020-03-09 13:45:05 -07:00
Jonathan Daugherty
84e391f56a UnicodeWidthTable.Install: clean up lock use 2020-03-09 10:24:57 -07:00
Jonathan Daugherty
5772d6aa57 UnicodeWidthTable.Install: make functions thread-safe with a global MVar 2020-03-09 10:20:28 -07:00