Blightmud
Blightmud copied to clipboard
Keep last sent text in prompt but marked as selected (Mudlet behaviour)
Allow for selection of input line text.
Text should be selectable via:
- Keyboard input
SHIFT+<left arrow>,SHIFT+<right arrow>: select prev/next characterSHIFT+CTRL+<left arrow>, `SHIFT+CTRL+': select prev/next word SHIFT+<up arrow>,SHIFT+<down arrow>: select entire input line? or select to EOL/beginning of line from current cursor position?
- Mouse input
Typing should replace the selected text.
I think as a first step in this issue we should do the following:
- Update
CommandBufferinsrc/ui/command.rsto hold aselection_range: Option<(usize, usize)> - If a selection exists when typing a char that is not
Enter/Left/Rightetc. Then the selection should be replaced with the recently typed char. (Write tests for this) - Include this range when sending the
Event::UserInputBuffer(deal with all the areas where this needs to be dealt with). - Make the UI display selections if they exist, using a background color (I'm thinking blue but I'm up for suggestions)
Further steps
After the above is in place and working.
- Introduce a setting that makes last sent command "stay" in the prompt but completely selected (Mudlet behaviour)
If there is a demand, we feel like it
- Introduce UI bindings for stepping and selecting (I don't see much use for this. But Solving the original request (Mudlet prompt logic) in this way should leave all doors open for the future.
To summarize.
- Allow the backend
CommandBufferto handle selections. - Change the
submit()function keep what was just submitted but set the selection range to include the entire line. (Based on a setting) - Make UI show selections.
- Update docs on the setting.
Leave all possible extensions for possible future development. Just knowing that we could do it is good enough. I don't think there is any demand. I just want the selections to be done "right" from the start. :wink:
Will this be something to opt into and not a default behaviour?
Issue flagged as stale