This is what I meant to when said when exiting the Arithmetic mode. So, after calling a command like Arithmetic and returning to the main list as you explained, the extended width of 85% would stay.
But would be better let the command palette have its original size, when returning to the main list. So the code is not hidden anymore. Therefore:
The special size of 85% would only be set when entering on special modes like Arithmetic, which uses phantom.
The special size of 85% would not be used for other commands which just display a list of commands.
The only thing which bothers about this big size my code being hidden behind the command palette, while its open, when there is no need to. Why hide more code while I am searching for a simple command?
About the dynamic resizing, it would be a problem while moving between list menus, like this plugin implements with multiple quick panel menus:
Yes, and the point I am trying to make is that this is conceptually the wrong model to use when thinking about the new command palette.
There is no new āmodeā, but instead the command palette stays open if a command needs input. So instead of invoking new instances of the quick panel and so forth, everything is done in the command palette proper.
It is clear that you would prefer dynamic sizing, and I understand that. I am just trying to help you (as a package developer) to understand the implementation and implications of the new command palette.
To me, the obvious solution would be a configurable max width, like website layouts are setup. They usually have no limit on shrinking, but when growing, their width stops at around 1000-1300 pixels. For the command palette, I would set it around 900px. Or it could be an amount of characters: 80 chars wide.
Another thing:
Because from a user experience, having the width jump around and your text/input jump around feels jarring.
Shouldnāt all quick panels be the same size? When jumping between GoTo panel and the Command Palette, you jump between two widths. When invoking a command from the cmdPal that calls another quick panel, you also jump between two widths. At least itād be consistent.
Open the Command Palette with Ctrl+Shift+P, then click on the buffer somewhere, then refocus the palette with Ctrl+Shift+P, and notice that the cursor isnāt drawn anymore.
It seems the palette enters in a weird state when doing this. If you donāt click in the paletteās input area, you canāt see what youāre typing, but if you close and open it again with the keyboard shortcut, it will display the characters entered the last time it was open. At this point, I need to restart Sublime to make the palette behave as expected.
Confirm that. Itās reproduceable on my Win 10 box. I was a bit confused when I ran into that situation this afternoon and even got ST to crash after some retries. Thankās for clarifying what caused it.
Why canāt I trigger sublime commands that use the new InputHandler classes with run_command?
For example, window.run_command("rename_file", {'new_name': "test.py"}) works as expected but window.run_command("rename_file") throws an error: missing 1 required positional argument: 'new_name'
window.run_command("rename_file") should open the input dialog. That would make the new API more useful.
Thanks for patience. Now you explained, it seems pretty obvious. Indeed, I would prefer the command palette width to be resizable. Now the width is more complex then, it would be two types of widths:
When the command palette contents are commands, .i.e., a list of commands. This is just usual as when showing a quick panel with a list of options for the user to choose.
When the command palette is accepting user input, as when the Arithmetic command is selected. On this case, the Arithmetic command seems to be opening a html phantom attached to the command palette bottom.
I would favor the command palette to be dynamically sizable when switching between the width types 1 and 2, i.e.:
When I open the command palette for the first time, its size is computed as on build 3153.
When a command is accepting input from the command palette with a embed phantom, its size can be set higher as 85%.
This would define the first part of the dynamically width. However there is a second part which can be though of, which is when you are inside the step 2 (accepting input with a phantom). On this case the command palette width could be just set to a default/standard width as of 85%, or it can follow the increment width adjustment:
When opening the command palette for the first time, set WIDTH accordingly to the list items.
When an input phantom is open, the command palette width is kept WIDTH
But if the input phantom requires a WIDTH bigger than the original WIDTH, its width is expanded to WIDTH2
If the input phantom does not requires such increased width, its width is not shrinked and is kept to WIDTH2
If the input phantom requires more than WIDTH2, then its with is increase to WIDTH3.
ā¦ this would follow until the input phantom mode exists
Now when the command is not requiring more inputs the the command palette is back displaying the commands list, its width would be set back to WIDTH.
This solution seems to would also helps with my problem. To be more clear, I would like them on the following order:
First I would like most to the dynamic width to be implemented as described at the beginning of the post
Second, something implemented like described at the beginning of the post would be also nice.
Third, a maximum width as proposed by @dubeg would also seem to help.
Forth, write my own command palette parsing all .sublime-command files, and sadly losing this nice new feature of input phantom. Or perhaps this is also implemented for quick panels, but without this width constraint of 85% width?
It would be great to change the text to show in the Command Palette when I invoke a command. For the āRename Textā command, it shows āRename Textā, which is a great default. But many package use things like āPackage Name: command nameā and I would like to change that.
I also would like it. It could be something like, if a package command is called Package Name: Rename File, then it would show Renaming file when the command is selected.
It could be possible by an API addiction to allow the package to return the command name when using the new input phantom, like this bellow where the command is called display_name(), which returns Renaming file, then instead of display Package Name: Rename file, it would display Renaming file:
The idea is that you are creating a chain of inputs to launch a command. Note that you can also hit backspace to delete inputs and even the command. The UI is more of a āflowā than entering a separate mode, so it would strike me as odd to have the thing you previously selected change once you selected it.
I am only asking to change the initial command name so that selecting āPackage Name: command nameā in the command palette becomes ācommand nameā.
More important: It would be great if we could invoke these commands in other ways then the palette. Why canāt I use a keyboard shortcut the invoke the arithmetic command { "keys": ["super+option+control+a"], "command": "arithmetic" }? Why canāt I use window.run_command("rename_file")? That would be extremely useful (and require a different way to set the command caption, I guess).
Support for multiple rows per entry in sublime_plugin.ListInputHandler
show_quick_panel supports multiple rows for each entry in the quick panel. From the API documentation: "items may be a list of strings, or a list of string lists. In the latter case, each entry in the quick panel will show multiple rows". It would be great to have the same support in sublime_plugin.ListInputHandler. I know that list_items function uses [(str,value)] for the command argument. Still I think it would be great if the two API were consistent. With the current implementation, I sometimes have to pick between a chain of inputs vs multiple rows.
You are on the dev channel. I guess the new command pallet is brand new and a kind of initial implementation. So itās quite normal not to have it fully functional for all use/edge cases. Maybe feedback like this is exactly the goal of publishing it in such an early state. Furthermore each command needs to support the new command pallet by returning an ImputHandler. Might be the second or third step after command pallet works well enough?
The ability to automatically open the command pallet to query for all missing arguments automatically, would be really great.
I also thought about it. Maybe the preview area can be used to show detailed information about the selected item in the list? This way the listbox itself keeps quite compact. One disadvantage of multi-line items is the list getting very long with only very few items being displayed at a time.
With GitSavvy or GitGutter in mind, I think displaying the branch/tag/commit names only in the list with details about author/date/email, ā¦ being displayed for the selected list item in the preview area only, might even be a bit cleaner and avoid overloading the quick panel with too much detailed information.
Your proposal would result in exactly what @jps and @wbond tried to avoid. In the worst case each input would cause the command pallet to resize and ājump aroundā. Not sure, whether it is really a better solution.
Yes, like the screenshot. In this case, it shows all previous or current jobs running on a high performance computational cluster. I find the two rows pretty usefulā¦