Sublime Forum

Dev Build 3154

#61

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:

  1. The special size of 85% would only be set when entering on special modes like Arithmetic, which uses phantom.
  2. 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:

0 Likes

#62

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.

0 Likes

#63

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.

3 Likes

#65

I got this behavior as well on Windows.

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.

Can you reproduce this as well?

0 Likes

#66

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.

0 Likes

#67

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.

0 Likes

#68

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:

  1. 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.
  2. 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.:

  1. When I open the command palette for the first time, its size is computed as on build 3153.
  2. 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:

  1. When opening the command palette for the first time, set WIDTH accordingly to the list items.
  2. When an input phantom is open, the command palette width is kept WIDTH
  3. But if the input phantom requires a WIDTH bigger than the original WIDTH, its width is expanded to WIDTH2
  4. If the input phantom does not requires such increased width, its width is not shrinked and is kept to WIDTH2
  5. If the input phantom requires more than WIDTH2, then its with is increase to WIDTH3.
  6. ā€¦ 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:

  1. First I would like most to the dynamic width to be implemented as described at the beginning of the post
  2. Second, something implemented like described at the beginning of the post would be also nice.
  3. Third, a maximum width as proposed by @dubeg would also seem to help.
  4. 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?
0 Likes

#69

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.

1 Like

#70

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:

class RenameInputHandler(sublime_plugin.TextInputHandler):

    def __init__(self, view):
        self.view = view

   def name():
       return "new_name"

    def display_name(self):
        return "Renaming file"

    def placeholder(self):
        return "Expressions"

   ...

class PackageNameRenameFile(sublime_plugin.TextCommand):

   def run(self, edit, new_name):
      do_command_stuff(new_name)

   def is_visible(self):
      return is_this_visible()

   def input(self):
      return RenameInputHandler(self.view)
1 Like

#71

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.

1 Like

#72

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).

0 Likes

#73

Disable colored title bars and your issue will be fixed. Sublime Text for some reason doesnā€™t like them in custom themes.

Details:

https://github.com/ihodev/sublime-da-ui/issues/30

1 Like

#74

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.

0 Likes

#75

My plan is to look into this over the next day or two to figure out what is going on.

1 Like

#76

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.

0 Likes

#77

You mean multiple lines in the listbox?

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.

0 Likes

#78

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.

0 Likes

#79

how to turn on auto text or auto command complete please help

0 Likes

#80

how to turn on auto complete commands that means if i write <htm then full command appear please help

0 Likes

#81

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ā€¦

0 Likes