Sublime Forum

Folding lost on focus

#1

Hi there. Sometimes when I lost focus from sublime text 2 to another window and go back I loose cursor position and any folded section. Its seems like a “refresh”. Is very strange.

Runing SublimeText 2 on Ubuntu 11.10.

Thanks and sorry about my poor english.

0 Likes

#2

That’s probably because you modified the document with an external application. The file is reloaded and the fold is lost.

0 Likes

#3

Nop. Nothing like that. But I think its because the file is in a samba share. Is absolutely annoying. Specially when working with larges files and debugging code. Please help.

0 Likes

#4

github.com/SublimeText/BufferScroll

The plugin was designed to try to keep every scroll, bookmarks, marks, folds, cursors and everything between sessions.

Unfortunately sublime text does not send “on_reload” event which prevents this plugin for restoring precious data.

Fortunately this plugin adds a new command called “refold”, which will restore the folding of the previous fold command. ( if the previous fold was saved at least one time )

Unfortunately sublime text yet again does not send some vital events (on_application_close, on_project_close, on_project_open, on_viewport_change , on_viewport_extent_change, on_… ) to keep this plugin functioning smoothly.

There is also a bug in the API ( set_viewport_position) which prevents this plugin from restoring scroll of xml/html documents, including: xml, tpl, html, xhtml, etc

0 Likes