Closed h-3-0 closed 5 years ago
@judah I'd be interested in getting this feature in, what's the reason for not merging this PR?
Thanks in advance.
I am in favor of the feature. However, I feel that this particular PR is too invasive compared to what it is implementing. It involves adding a new parameter to the low-level core of the rendering loop, for something that is only specific to display of the vi mode.
Instead, I would prefer the changes be more localized to the Vi.hs
module. One half-formed idea is that it ought to be possible to write functions like:
changeInsert :: ReaderT Prefs m => (s -> IMode) -> Command m s IMode
changeInsert f s = do
indicator <- lift asks insertModePrefix
let t = f s
setState (Prefixed indicator t)
return s
data Prefixed s = Prefixed String s
instance LineChars s => LineChars (Prefixed s) where ...
Which would render the indicator prefix when the state is changed.
Another idea is to actually keep the Prefixed s
itself as the line state inside the Vi
loop, using its Functor instance to turn functions like IMode -> IMode
into Prefixed IMode -> Prefixed IMode
. I'm not sure which way would be simpler, though.
Fixes #38.
When using the vi editing style, the presence of insert-mode or command-mode is indicated before the usual prefix by a user configurable string.
The emacs editing style, and all other modes (e.g. search-mode, arg-mode) are unaffected.
This change is