So far, when `alwaysHighlight' was enabled and the user selected an item
while not having completely written it out in the prompt, the input
string and not the eventual completion string would be entered into the
prompt history, which is obviously not the desired behaviour. This can
cause the history to clutter up with all these abbreviations, making
subsequent invocations of the prompt tedious to work with.
For example, an input of "xm" would narrow to both "xmonad" and
"xmobar", but thanks to `alwaysHighlight' "xmobar" was selected. If the
user now pressed enter, the prompt would correctly return "xmobar" as
the string to act upon, but "xm" would be entered into the prompt
history!
This is needed because the cache directory is now a part of XConf, which
is calculated once on startup and hence any recalculation would be
fragile.
Some internal functions that are not exposed (like writeHistory) were
also changed to accept that directory as an argument.
Fixes#164.
It's not clear to me why these functions take in XPState as a param only
to then produce some XP () values. It seems like they could just as well
call `get`.
Provide a way to perform case-insensitive file / directory completion.
We're using compgen to generate completion candidates, and this is
case-sensitive by default. We can control this by setting the
completion-ignore-case Readline variable prior to invoking compgen. If
we're running a Bash with Readline support, this works as expected.
Otherwise, it has no effect -- completion candidates are still returned,
but compgen generates them in a case-sensitive manner.
To avoid breaking changes, the signatures and behavior of existing
exported functions are unchanged:
- XMonad.Layout.WorkspaceDir.changeDir
- XMonad.Prompt.Directory.directoryPrompt
- XMonad.Prompt.Shell.getShellCompl
New variations of these functions are provided, allowing the caller
to specify the desired case-sensitivity via a ComplCaseSensitivity
argument:
- XMonad.Layout.WorkspaceDir.changeDir'
- XMonad.Prompt.Directory.directoryPrompt'
- XMonad.Prompt.Shell.getShellCompl'
The XMonad.Prompt.Shell exports a couple new functions:
- compgenDirectories
- compgenFiles
We make use of this in XMonad.Prompt.Directory to avoid duplicating the
compgen code.
Prompts based on `mkComplFunList` and `mkComplFunList'` were not
taking into account the `searchPredicate` funtion from `XPConfig`.
This was rather confusing.
We fix it by passing `XPConfig` to these functions; although
this is strictly more than they need, it makes the breaking change very
easy to fix and is also more future-proof.
Colors in 'XPState' continue to use 'XPColor' since it provides a
cleaner interface. For backwards compatibility color changes to
'XPConfig' were reverted. To avoid accessor clashes you'll have to deal
with slightly different names:
| 'XPState'/'XPColor' | 'XPConfig' |
| ------------------- | ----------- |
| bgNormal | bgColor |
| fgNormal | fgColor |
| bgHighlight | bgHLight |
| fgHighlight | fgHLight |
| border | borderColor |
A vim-like keymap, yay! And dynamic colors and a reworked event loop.
Also fixes 'showCompletionOnTab' which was broken, and many new or
improved prompt interface functions.
Changes moveWord/moveWord' but updates the old keymaps to retain the
original behavior. See the documentation to do the same to your XMonad
configuration.
P.S. That bug I mention was there before my changes.
This change improves the UX of X.Prompt when `alwaysHighlight` is
enabled. This is especially useful for use with `mkXPromptWithModes`
which forces `alwaysHighlight` to be `True`.
When the user presses the `complKey` and `alwaysHighlight` is `True`,
one of two things will happen:
1. If this is the first time `complKey` is pressed in this round of
completion then the prompt buffer will be updated so it contains
the currently highlighted item.
2. Every other time that the `complKey` is pressed the next
completion item will be selected and the prompt buffer updated.
This gives immediate feedback to the user and allows using some
prompts with `alwaysHighlight` that weren't possible before (e.g.,
shellPrompt, directoryPrompt, etc.)
Prompt should have been using getXMonadDir this entire time but since
we now have getXMonadCacheDir use that instead. This brings
xmonad-contrib inline with the changes in #62.
This also fixesxmonad/xmonad-contrib#68
This patch enables support for key binding like Ctrl + i which was not
previously possible. Technically, this changes the type of completionKey
from KeySym to (KeyMask, KeySym).
On a keyboard-less device (such as a smartphone), where one has to use
an on-screen keyboard, the maximum completion window height must be
limited to avoid overlapping the keyboard.
The base that comes with ghc-7.6.1 no longer includes Prelude.catch;
so these modules were changed so that there is no warning for
import Prelude hiding (catch)
At the same time these changes should be compatible with older GHCs,
since the catch being has never been the one in the Prelude.