Home Download Buy Blog Forum Support

Refresh current view

Refresh current view

Postby NoxArt on Thu Dec 27, 2012 10:03 am

Hi, is there a way to refresh current view?
When you change the view's file (download), the file stays the same until you switch to other view and back. Is it possible to manually trigger a refresh?

Thank you
NoxArt
 
Posts: 14
Joined: Mon Jan 30, 2012 9:05 pm

Re: Refresh current view

Postby FichteFoll on Sat Jan 19, 2013 3:56 am

On Windows sublime prompts me to reload the changed file when I did change it. Maybe it's some file event issue with your OS or you disabled a setting in Sublime Text.
FichteFoll
 
Posts: 408
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Refresh current view

Postby NoxArt on Sat Jan 19, 2013 2:07 pm

Thank you for response

I am using Windows and it does prompt me, but only if the file already contained unsaved changes. Nothing is related disabled in my config. Also - as this is in plugin development section I would be glad for cross-platform solution ideally

Sublime API does not seem to feature set_dirty ... maybe it'll be possible to hack it by making that unsaved modification manually, but that's really a hack
NoxArt
 
Posts: 14
Joined: Mon Jan 30, 2012 9:05 pm

Re: Refresh current view

Postby FichteFoll on Sat Jan 19, 2013 4:04 pm

I understand what you meant, now that I'm not as tired as today at 4am.
Well, since you stated that the view is only updated when you re-activate it you can also do that from within a plugin. That is, activate another view and activate the first view again. However, this would only work if you have at least 2 views in a window.

I don't know of a way to explicitly "reload" a view from disk.
FichteFoll
 
Posts: 408
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Refresh current view

Postby LONGMAN on Tue Mar 05, 2013 1:31 am

This is actual problem for me too. Founded any solutions?
AutoBackups: ST2 / ST3
CodeFormatter: ST2 / ST3
StringUtilities: ST2 / ST3
LONGMAN
 
Posts: 68
Joined: Mon Nov 26, 2012 5:03 pm
Location: Tbilisi, Georgia

Re: Refresh current view

Postby tito on Tue Mar 05, 2013 1:46 am

SidebarGit does exactly that with F5. If you have installed BufferScroll, cursor position, bookmarks, folds, and can't remember what else more will be intact.
Not best solution, but it works for me, and will be hard to beat :P
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 876
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Refresh current view

Postby NoxArt on Fri Oct 25, 2013 11:46 am

So there actually is a solution, I posted it here: https://www.sublimetext.com/forum/viewt ... 78&p=54944
NoxArt
 
Posts: 14
Joined: Mon Jan 30, 2012 9:05 pm

Re: Refresh current view

Postby lunixbochs on Sat Oct 26, 2013 9:11 am

As far as "set_dirty", you should either save the file or revert it. You can do either of those with view.run_command.

Re: above post - If you already have a reference to the view, you can just ` view.run_command('revert') ` directly. You don't want to accidentally revert one of the other views if they change at a bad time.
lunixbochs
 
Posts: 91
Joined: Fri Oct 08, 2010 10:18 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 4 guests