Sublime Forum

Dev Build 2144

#5

It doesn’t work yet with Soda Theme (need update).
But it work for me with default theme (the cross is replaced with a big dot).

startup, version: 2144 windows x64 channel: dev

0 Likes

#6

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.

0 Likes

#7

[quote=“bizoo”]

It doesn’t work yet with Soda Theme (need update).
But it work for me with default theme (the cross is replaced with a big dot).

startup, version: 2144 windows x64 channel: dev[/quote]

To get the indicators working in Soda again you just need to add the following to your Global settings.

"highlight_modified_tabs": true
0 Likes

#8

ok, thanks

0 Likes

#9

[quote=“bizoo”]API: Added view.encoding() and view.set_encoding() API: Added view.line_endings() and view.set_line_endings()
yippee !!![/quote]

:mrgreen: Thank You Jps!

0 Likes

#10

API: Added view.encoding() and view.set_encoding() API: Added view.line_endings() and view.set_line_endings()
What’s the list of encodings accepted by set_encoding() ?
I try to get an UTF-8 with BOM but didn’t find how to spell it…

And is there any plan to have default encoding by syntax ?
Actually, I use different encoding for different language:
-Delphi and PL/SQL files -> cp1252
-Python -> utf-8 BOM
-Almost anything else -> utf-8

Actually new files are ‘Undefined’ and get an encoding when saved.
What I like is that the encoding used when the file is saved come from a settings in the Base File.sublime-settings (or the syntax specific one).
A warning message before saving if the encoding didn’t take care of some of the char in the buffer would be nice.

I’m pretty sure it’s easy to make a plugin that trap the on_pre_save event to do that work, but I just wonder if something is planned before doing it.

0 Likes

#11

[quote=“jps”]

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.[/quote]

So it’s possible to call reopen from API ? Afaik it’s not exposed to public.

0 Likes

#12

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

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:

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

So I guess this should work:

window.run_command('reopen')
0 Likes

#13

But it doesn’t :smile: thanks anyway guillermooo.

0 Likes

#14

The works for me, though:

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.

0 Likes

#15

[quote=“guillermooo”]The works for me, though:

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.[/quote]

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

0 Likes

#16

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.

0 Likes

#17

Thanks but it`s ugly the new way … :frowning:

0 Likes

#18

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

0 Likes

#19

Id 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, its ok that works again on soda.

0 Likes

#20

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?

0 Likes

#21

Thanks for updating the soda theme but I really hope the dirty files change gets reverted. It’s much harder to tell if files have changed now, especially if you have “show_tab_close_buttons” set to true. Often the tab is much wider than the filename. Before I just had to take a peek at the filename to see if there was a dot behind it. Combining 2 functions (close/modified) into 1 is not a good idea in this case in my opinion. I went back to build 2143.

0 Likes

#22

I don’t use Tabs so I don’t care about it, but for the sidebar the dirty indicator is way better now.

0 Likes

#23

I don’t want to be offensive, but i think it is actually a pretty good idea because you normally don’t want to close a modified file or you do it intentionally.

0 Likes

#24

Not offensive at all. Everyone has their preference :smile:. I understand what you are saying but it depends on how you work. I often have quite a few files open and need to run those from outside Sublime which means I need to save them but don’t want to close them. So saving and closing are two very separate things in my case.

That said, am trying build 2144 again and am slowly starting to get used to it. Just have to look in a different place but it’s a hard habit to break. Might turn off the close buttons. Who knows, might even start to like it.

0 Likes