It's currently possible to split existing windows via WindowAction::Split, but opening new content has to be done via WindowContainer::window_open. This makes it difficult to express some keybindings such as gf, and also makes it hard to express some commands (e.g. providing an argument to :sp). The following needs to be done to make opening windows and switching between them easier:
New WindowAction::Open and WindowAction::Switch variants for opening a new window of a specific height and changing the currently displayed window respectively. Both variants will take an OpenTarget.
The OpenTarget type will allow specifying what window content needs to be shown: this will be things like a name given as a String, the alternate file, the filename under the cursor, etc.
Jumping to previously open windows should be possible via Action::Jump and OpenTarget::Offset
Consumers should be able to specify a custom WindowId type and ContentId type in their ApplicationInfo implementation. ContentId will replace the current BufferId type, and should hopefully make it easier for consumers to lookup content in the BufferStore without having to maintain state elsewhere.
A new WordStyle::Filename which will be used with gf and friends, and a WordStyle::CharSet to make it easier for consumers to specify their own important characters when overriding the gf-style keybindings.
Attempting to jump to a mark located in another buffer should produce an error containing the target ContentId, so that consumers can open the appropriate window. Action::is_switchable will indicate whether it's appropriate to change windows during that action. (For e.g., trying to do d'A should not switch windows, but should just show an error.)
It's currently possible to split existing windows via
WindowAction::Split
, but opening new content has to be done viaWindowContainer::window_open
. This makes it difficult to express some keybindings such asgf
, and also makes it hard to express some commands (e.g. providing an argument to:sp
). The following needs to be done to make opening windows and switching between them easier:WindowAction::Open
andWindowAction::Switch
variants for opening a new window of a specific height and changing the currently displayed window respectively. Both variants will take anOpenTarget
.OpenTarget
type will allow specifying what window content needs to be shown: this will be things like a name given as aString
, the alternate file, the filename under the cursor, etc.Action::Jump
andOpenTarget::Offset
WindowId
type andContentId
type in theirApplicationInfo
implementation.ContentId
will replace the currentBufferId
type, and should hopefully make it easier for consumers to lookup content in theBufferStore
without having to maintain state elsewhere.WordStyle::Filename
which will be used withgf
and friends, and aWordStyle::CharSet
to make it easier for consumers to specify their own important characters when overriding thegf
-style keybindings.ContentId
, so that consumers can open the appropriate window.Action::is_switchable
will indicate whether it's appropriate to change windows during that action. (For e.g., trying to dod'A
should not switch windows, but should just show an error.)