Home Download Buy Blog Forum Support

Dev Build 2144

Re: Dev Build 2144

Postby Mylith on Mon Nov 28, 2011 8:36 am

jps wrote:
wuub wrote:What are the semantics of .set_encoding()?

It just sets the encoding that will be used when saving next. If you want to reopen the current file with a different encoding, you can use the reopen command - see Default/Main.sublime-menu for an example.

So it's possible to call reopen from API ? Afaik it's not exposed to public.
Mylith
 
Posts: 30
Joined: Mon Oct 17, 2011 12:58 pm

Re: Dev Build 2144

Postby guillermooo on Mon Nov 28, 2011 9:54 am

Commands can be executed via API in one of the following ways:

Code: Select all
view.run_command('command_name_here')
window.run_command('command_name_here')


IIRC, since recently the window object dispatches view commands based on input focus, so you can run view/window commands from window plugins easily.

You can also pass args if needed:

Code: Select all
window.run_command('command_name_here', {"arg1_here":"foo", "arg2_here":10)


So I guess this should work:

Code: Select all
window.run_command('reopen')
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Dev Build 2144

Postby Mylith on Mon Nov 28, 2011 10:25 am

So I guess this should work:

But it doesn't :) thanks anyway guillermooo.
Mylith
 
Posts: 30
Joined: Mon Oct 17, 2011 12:58 pm

Re: Dev Build 2144

Postby guillermooo on Mon Nov 28, 2011 10:58 am

The works for me, though:

Code: Select all
view.run_command("reopen", {"encoding":"utf-16 le"})


I might have made up the part about command dispatching or just didn't get it right.
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Dev Build 2144

Postby Mylith on Mon Nov 28, 2011 11:27 am

guillermooo wrote:The works for me, though:

Code: Select all
view.run_command("reopen", {"encoding":"utf-16 le"})


I might have made up the part about command dispatching or just didn't get it right.


You have right it works now, but I was trying to run it in on_load event and that was the problem (it's working only via sublime.set_timeout in on_load).
Mylith
 
Posts: 30
Joined: Mon Oct 17, 2011 12:58 pm

Re: Dev Build 2144

Postby buymeasoda on Mon Nov 28, 2011 12:24 pm

oriceon wrote:There is a problem on showing * on tab that has modified content. (* is missing)


I've now updated Soda Theme to support the new file state theme features.

Sidebar file items will now show a dirty indicator, and tabs will show a dirty state indicator if you've got "highlight_modified_tabs": true.
buymeasoda
 
Posts: 65
Joined: Mon Jul 18, 2011 11:40 pm
Location: Brisbane, Australia

Re: Dev Build 2144

Postby oriceon on Mon Nov 28, 2011 3:45 pm

I've now updated Soda Theme to support the new file state theme features.


Thanks but it`s ugly the new way .. :(
oriceon
 
Posts: 56
Joined: Tue Jun 14, 2011 6:06 am

Re: Dev Build 2144

Postby facelessuser on Mon Nov 28, 2011 4:30 pm

oriceon wrote:Thanks but it`s ugly the new way .. :(


??? All he added was a dot by the file...how can that be ugly? I find it very useful. Before I had a hard time telling what wasn't saved, now I can easily tell. I think it looks fine, and more importantly, useful.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Dev Build 2144

Postby oriceon on Mon Nov 28, 2011 5:16 pm

I`d like the old way what shown an asterix after tab text, not the new one that replace (x) from close tab with a round..Anyway, it`s ok that works again on soda.
oriceon
 
Posts: 56
Joined: Tue Jun 14, 2011 6:06 am

Re: Dev Build 2144

Postby natebeaty on Mon Nov 28, 2011 5:18 pm

buymeasoda wrote:Sidebar file items will now show a dirty indicator, and tabs will show a dirty state indicator if you've got "highlight_modified_tabs": true.


I see the new tab dirty indicators (very nice update, thanks), but I'm not seeing the sidebar dirty indicator -- is there a setting to turn that on?
natebeaty
 
Posts: 121
Joined: Wed Apr 06, 2011 8:28 pm
Location: Chicago, IL

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 15 guests