Sublime Forum

Dev Build 3156

#1

Dev Build 3156 is out now at https://www.sublimetext.com/3dev

7 Likes

Command palette - clear last used command after execute
Opening the Command Palette does NOT select the previous text
#2

The update just made me realize: Why is there no command to update in the Command Palette?

1 Like

#3

Initial Command Palette text is no longer selected

What is the reasoning behind this? The effect is to make it so I have to select text manually for any other command than the previously entered one, which means I can’t just open the Palette and type a command, as I would expect.

19 Likes

#4

Initial Command Palette text is no longer selected

@wtgee, I also would like to keep this behavior, then I created a package/plugin to restore the behavior:

import sublime
import sublime_plugin

class FixedCommandPaletteInputSelectionCommand(sublime_plugin.WindowCommand):

    def run(self):
        self.window.run_command( "show_overlay", {"overlay": "command_palette"} )
        self.window.run_command( "select_all" )

Then you need to assign this command to the key bind Ctrl+Shift+P:

    { "keys": ["ctrl+shift+p"], "command": "fixed_command_palette_input_selection" },
10 Likes

#5

Thanks @addons_zz, I appreciate the package, but it seems like this shouldn’t be there in the first place. Expected behavior of Command Palette should be: open Command Palette -> type command.

That is why I was curious if there is some motivation for the change that I don’t understand.

8 Likes

#6

Up until build 3153 the command palette would not select initial text, so the change was technically a regression and we had a couple of requests to change it back.

Certain uses of the command palette are awkward then the text is preselected. Perhaps we should add an arg for this?

6 Likes

#7

It would make easier to users make the command palette text initially selected, as they would only be required to create a new key bind as:

	{ "keys": ["ctrl+shift+p"], "command": "show_overlay", "args": {"overlay": "command_palette", "select_initial_text": true} },

But more determined users can can create a plugin as mentioned on my post above.

I would suggest to the command palette to be shipped by default keeping the initial text selected because this is the behavior on current stable build 3143. For me, the solution could be either a new parameter as select_initial_text: true, or creating a command which open the command palette as:

        self.window.run_command( "show_overlay", {"overlay": "command_palette"} )
        self.window.run_command( "select_all" )
2 Likes

#8

That’s weird, I could have sworn this wasn’t true. I’ve been a Sublime user for almost 5 years now, and I keep making mistakes with the new behavior - it’s so frustrating that I came here specifically to find info about it.

I do trust my muscle memory at least somewhat, though, so is there something that’s different now? Because my fingers are trained to do “CTRL+SHIFT+P” and start typing a command immediately - perhaps before the regression, the previously typed command (the initial text) wasn’t already in the palette, rather it was empty - or something like that?

Personally, I’d be very grateful if you reconsider this change - perhaps by adding a setting parameter to control the behavior, or a command argument so we can bind a shortcut, as suggested already.

In the meantime, I’ll be using the hack by @addons_zz to restore what I (think) I’m used to doing. Thanks for the quick workaround!

14 Likes

#9

@levacic, the fixed regression was with another command on the vintage mode, which must not keep the initial text selected. @wbond should be talking about that other command when he said:

Up until build 3153 the command palette would not select initial text

Perhaps he meant to say:

Up until build 3153 the vintage command would not select initial text

The problem here is that the fix for that vintage command, also make the command palette not select the initial text, i.e., the fix to a regression, created another regression.

2 Likes

#10

As I can deduce, you want the command palette empty when invoked. You can use following workaround to get the behavior you wanted. This plugin is slightly modified version of what is posted by @addons_zz

import sublime
import sublime_plugin

class DeselectCommandPaletteTextCommand(sublime_plugin.WindowCommand):
    def run(self):
        self.window.run_command("show_overlay", {"overlay": "command_palette"})
        self.window.run_command("select_all")
        self.window.run_command("left_delete")

Then add this line to your default keybindings:
{ "keys": ["ctrl+shift+p"], "command": "deselect_command_palette_text" },

0 Likes

#11

To echo @levacic and support what @addons_zz said, I have also been a sublime user for 5+ years and something has most definitely changed in this build as whatever I have been doing for 5+ years no longer works. Which is to say, typing Ctrl-Shift-p and then directly typing a command no longer works.

@bantya, the palette doesn’t have to be empty and probably shouldn’t be because then it is forgetting my previously type command, which is often the command I want to repeat. However, if the text is selected by default and I start typing it gets replaced with whatever new command I want. That is, with selected text I get both my previous command readily accessible and can immediately type any new command.

8 Likes

#12

Up until build 3153 the command palette would not select initial text

This is not true. I just tried it using ST 3126.

  1. Open command pallet -> input is empty
  2. Enter a command and execute it
  3. Reopen command pallet -> previous command is displayed in input control and fully selected

So I can either type enter again to recall it or just start typing another command.

If the command pallet is canceled without running a command, the input is cleared.

As @levacic I stumbled with the new behavior, too. It now requires us to press backspace several times to delete the previously run command in order to be able to run a new one. This is kind of stupid.

Maybe I am misled, but the only discussions I can remember were related to “command pallet not remembering the last command” or something like that.

From my point of view, the most recent run command should always stay in the input control being fully selected no matter whether the command pallet was closed with or without running it the last time. This way the most recent run command can always be executed again by just pressing enter or a new one can be typed in.


And maybe in the future the first lines of the search result list may be dedicated to the most recently run commands matching the fuzzy search, in order to ease up working with a couple of commands only. Sometimes one needs to call one or two commands after each other. Having some kind of favorites built from command history might help to quickly find them.

9 Likes

#13

Long key binding hints are cut off.

4 Likes

#14

Sorry, the fix was for when the text arg was passed to show_overlay, but it appears that I also managed to have it apply in this other situation. The intent is to preserve the behavior before the Command Palette was enhanced with the new functionality. I’ll get this kink worked out in the next build.

20 Likes

#15

Default settings on Windows 10. Scrolling yields 100% CPU usage and about 4 screenupdates per second, when scrolling in the attached file. The Minimap also shows a wrong position.

Behaviour is normal when turning Word Wrap off.

Examplefile: http://s000.tinyupload.com/?file_id=78365722612302444015

0 Likes

#16

is this problem new in this build? if not, it probably doesn’t belong on this thread - if it’s not a regression or discussion about changes in this build, maybe make a separate thread for it

2 Likes

#17

Echoing the same sentiment as others have stated. Ctrl-Shift-P, felt broken and awkward after this build. Whether this was to fix a previous regression or an explicit change in behavior, the previous behavior with the previous command text selected just felt “right” - You can simply hit Enter to re-run the previous command, or immediately start typing to run a new command.

0 Likes

#18

If you read up three posts, you’ll see the situation you are speaking about was a mistake and we’ll be correcting it in the next build.

3 Likes

#19

My bad. Glad it’s getting fixed. Thanks

0 Likes

#20

Anyone getting issues with 3156 and copy and paste? I’m on Windows 10 and I get:

Unable to extract text form the clipboard, available formats: DataObject, TGerminal Services Private Data, Ole Private Data
0 Likes