Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image file view not available in plugin_loaded() at startup #2116

Closed
gerardroche opened this issue Dec 29, 2017 · 2 comments
Closed

Image file view not available in plugin_loaded() at startup #2116

gerardroche opened this issue Dec 29, 2017 · 2 comments

Comments

@gerardroche
Copy link

Opening Sublime Text with an active view containing an image e.g. png, jpg, etc. doesn't provide a valid view in the plugin_loaded() hook via sublime.active_window().active_view().

Re:

Steps to reproduce:

import sublime

def plugin_loaded():
    view = sublime.active_window().active_view()
    print(view)
  1. Open an image file in the current view.
  2. Close Sublime Text.
  3. Open Sublime Text.

Expected

sublime.active_window().active_view() should return a the image file view.

Actual

sublime.active_window().active_view() returns None.

Note: a non-image file view returns a valid view.

@keith-hall
Copy link
Collaborator

images aren't represented by a View, but by a Sheet...
http://www.sublimetext.com/docs/3/api_reference.html#sublime.Sheet

@gerardroche
Copy link
Author

gerardroche commented Dec 29, 2017

Yep. Thanks.

sublime.active_window().active_view() returns None

sublime.active_window().active_sheet() returns a Sheet
object.

gerardroche added a commit to NeoVintageous/NeoVintageous that referenced this issue Jan 2, 2018
gerardroche added a commit to NeoVintageous/NeoVintageous that referenced this issue Jan 2, 2018
* master:
  Doc: Update vimdocs
  Add trackback to sublimehq/sublime_text#657
  Add trackback to sublimehq/sublime_text#2116
  Fix :map doesn't work in visual block or visual line mode
  Fix remove unused setting
  Fix settings should be erased when cleaning up views
  Fix gx for quoted urls and trailing commas
  Fix #298 gd can't jump back with CTRL-o
  Fix #241 Leaving Insert mode still shows as being in Insert mode
  Add GitHub issue template
  Update README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants