Home Download Buy Blog Forum Support

Build 3009

Re: Build 3009

Postby qgates on Fri Feb 01, 2013 7:01 pm

FichteFoll wrote:Edit: Something I just discovered: When I opened ST3 portable for the first time it displayed the sidebar. I could not close the sidebar (using "ctrl+k, ctrl+b") until I selected "View > Side Bar > Show open files", after that it works as expected.

Yes, I noticed that too. Ctrl+k, Ctrl+b seems not work without enabling view open files, but it's also stopped working for me on a few other occasions.
qgates
 
Posts: 223
Joined: Mon Nov 05, 2012 4:33 pm

Re: Build 3009

Postby facelessuser on Fri Feb 01, 2013 8:37 pm

@jps

view.insert in ST2 had this description:

Code: Select all
Inserts the given string in the buffer at the specified point. Returns the number of characters inserted: this may be different if tabs are being translated into spaces in the current buffer.


In ST3 view.insert returns nothing. Is there a reason for this, and can we get it to return the characters inserted again?
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Build 3009

Postby FichteFoll on Fri Feb 01, 2013 11:01 pm

Note: This post is courtesy of boredom, I guess.

I reviewed the "sublime.py" file, mostly adjusting it to match pep8, add a few "isinstance" checks, removed a typo, added some blank lines to separate (probably similar) constants and removed the call of "sublime_api.settings_get" respectively. Check the revisions for the changes I made, the first commit was the original file.
https://gist.github.com/4694665

Edit: Updated __magic__ for Selection class because as it works now there is no way that comparing two Selection instances of the same view construct different lists due to their wrapper nature. The only possibilities that these could differ are 1. that the selection is changed by some other thread between evaluating the two operands and 2. Selection instances of different views. Thus, comparing the view_id attributes seems more accurate/reliable. "__lt__" cannot really be implemented. "__str__" can be used to compare older Selection objects with an updated one due to wrapper nature. See also.
FichteFoll
 
Posts: 400
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Build 3009

Postby atomi on Sat Feb 02, 2013 2:16 am

I'm using plugin_loaded() to import a module which is working fine, but I'm getting an error
Code: Select all
"sublime_plugin.py", line 133, in on_api_ready
    for m in sys.modules.values():
RuntimeError: dictionary changed size during iteration


Is there any way to avoid this?
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: Build 3009

Postby jps on Sat Feb 02, 2013 2:23 am

atomi wrote:I'm using plugin_loaded() to import a module

Can't you just import the module the normal way? plugin_loaded is only required for API calls, it's best to do module imports before that, so the application isn't blocking on IO
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Build 3009

Postby atomi on Sat Feb 02, 2013 2:31 am

jps wrote:
atomi wrote:I'm using plugin_loaded() to import a module

Can't you just import the module the normal way? plugin_loaded is only required for API calls, it's best to do module imports before that, so the application isn't blocking on IO


I'm using a string from the package's sublime-settings file to load the module which only contains completions.

If that's a really bad idea, I'd love some recommendations.
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: Build 3009

Postby jps on Sat Feb 02, 2013 2:53 am

The most direct solution would be to use set_timeout or set_timeout_async. The latter will run the passed in function in a separate thread, so is preferable if it's not going to cause trouble elsewhere. Module importing in Python is threadsafe, although I don't know off the top of my head if custom importers need to do anything to maintain this guarantee. All plugins are loaded through a custom importer, MultizipImporter in sublime_plugin.py.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Build 3009

Postby zeuxcg on Sat Feb 02, 2013 7:12 am

jps, what is your stance on the smart_indent issue described here: viewtopic.php?f=3&t=5692&p=42917 ?

Without any knowledge of ST internals I'm daring to assume that this is an easy fix. Is it possible to get it in ST3? This is a blocker for me and, I'm sure, for some other people as well. Using ST for languages without braces and some other editor for braced languages will be... awkard.

I tried to do a proper workaround by adjusting the Default keymap, but it seems that anything that does \n insertion is a suspect (i.e. "o"/"O" commands in Vintage and probably other things) - not to mention unindent on "}".
zeuxcg
 
Posts: 3
Joined: Fri Feb 01, 2013 7:13 am

Re: Build 3009

Postby malkomalko on Sat Feb 02, 2013 1:03 pm

small bug i think

https://gist.github.com/a068888801aaac1b050e

I like emacs keybindings so I plan to reconfigure my bindings to match. I'm starting with ctrl-g, which is basically escape.
There are a few instances where hitting ctrl-g doesn't have the effects of esc.

show_files overlay => calling ctrl-g closes the box, but leaves the preview of the file open, which is very strange... hitting esc has the correct action
prompt_select_workspace => ctrl-g does nothing, only escape works (more than likely because this is a popup window... anyway to unify?)

a good example of where this behavior is correct is in the "goto definition". the keybinding in fact is honored here and kills the preview properly.

on a side note: how do you go about altering the built in packages? I want to change some of the syntax for the lisp package but it appears the packages are not easily accessible for updating, and even if I could, would get overwritten with a version update.

and what about clearing the console? :D
malkomalko
 
Posts: 13
Joined: Sat Feb 02, 2013 12:54 pm

Re: Build 3009

Postby superfake123 on Sat Feb 02, 2013 1:40 pm

Could just be in my head but the last build seems to be more laggy than the previous builds ( Ubuntu x64 Linux 3.7.5-030705-generic )
superfake123
 
Posts: 24
Joined: Wed Jun 27, 2012 2:24 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 27 guests