Sublime Forum

Sublime Text X 20101217

#1

20101217 is out now, with auto complete support. From the UI perspective, auto complete works a bit differently than what’s in Sublime Text: Press Ctrl+Space (all platforms) to activate auto complete, this will insert the most likely option, and show a list of the other available completions. Press Ctrl+Space again or Ctrl+Shift+Space to cycle through the available options.

It’s worth noting that apart from escape, no other keys are hijacked when the auto complete list is displayed: the arrow keys will move the cursor, and not select different options in the auto complete list. Auto complete will work with multiple selections, but only if each selection has the same text before it.

There are a few other changes too: a duplicate line command, pressing F3 to go the next find result will centre the result on screen, rather than having it near the edge of the screen (the same change will also effect bookmarks and goto symbol when they’re implemented), and Ctrl+F4/Ctrl+w will now close transient views (i.e, what you get when single clicking on a file in the project).

0 Likes

#2

What do you mean by that?

0 Likes

#3

Being able to type with the auto complete window up implies that another key press to confirm the choice is required - typically enter is hijacked for this, meaning it has to be pressed twice while the window is up.

I’m not committed to the way the auto complete UI currently works, it could be changed if the current implementation isn’t popular.

0 Likes

#4

Noticed an issue with autocomplete on mac osx in python. When ctrl+space is pressed, the match is completed but there is no popup window, nor do additional presses of spacebar cycle through the other options. Also it appears that it does complete local function names, and variables, but not stuff like “print” from the python libraries.

As an example, when I attempt to complete “pr” it doesn’t popup or complete anything in an empty python file, but if I have a variable name pram1, it completes that. I am on OSX 10.6, python 2.6.1 and STX 20101217.

On windows I tried out the completion and it worked just as described and works fine. As for whether using ctrl+space to choose options, I’m not sure yet, but want to give it a chance and use it a bit. Immediately it wasn’t what I expected coming from different editors where completion usually narrows the list as characters are added, and you can select a choice via tab or by pressing dot if access class members.

The new method does make sense in that it’s fewer keys and probably less complex to implement. The only downside I can see is if there were a very long list of options.

0 Likes

#5

I am used to the ctrl-space for autocompletion, but I find the selection of word using the up/down arrow keys more intuitive.

0 Likes

#6

If there’s only one possible match, then it will be inserted with no window popup - it sounds like this is what’s happening here?

[quote=“mikeb”]Also it appears that it does complete local function names, and variables, but not stuff like “print” from the python libraries.

As an example, when I attempt to complete “pr” it doesn’t popup or complete anything in an empty python file, but if I have a variable name pram1, it completes that. I am on OSX 10.6, python 2.6.1 and STX 20101217.[/quote]

The completions are sourced only from what’s present in the current buffer - this will be expanded in the future.

0 Likes

#7

Now that I look at it again, I think so… was just comparing the completion list that showed up in windows version to the mac version, and so in fact it’s working normally with the exception that mac doesn’t have quite as complete of a list items to pop up.

Also wanted to clarify my earlier comment where I wasn’t explicit in that ctrl+space is what I have found used in all other editors to initiate the autocomplete list to drop-down.

One question, are packages like zoom enabled in x yet?

mike

ps Thanks for an awesome editor!

0 Likes