AutoFileName icon indicating copy to clipboard operation
AutoFileName copied to clipboard

IndexError!

Open ryanpcmcquen opened this issue 5 years ago • 3 comments

  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1381, in run_
    self.view.end_edit(edit)
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime.py", line 1072, in end_edit
    sublime_api.view_end_edit(self.view_id, edit.edit_token)
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 846, in on_modified
    run_view_callbacks('on_modified', view_id)
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 665, in run_view_callbacks
    callback(v, *args)
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 147, in profiler
    return event_handler(*args)
  File "/Users/rmcquen/Library/Application Support/Sublime Text 3/Installed Packages/AutoFileName.sublime-package/autofilename.py", line 162, in on_modified
    sel = view.sel()[0].a
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime.py", line 846, in __getitem__
    raise IndexError()
IndexError```

ryanpcmcquen avatar Aug 13 '20 16:08 ryanpcmcquen

All these calls:

sel = view.sel()[0].a

Should be wrapped like so:

try:
	sel = view.sel()[0].a
except IndexError:
	pass

ryanpcmcquen avatar Aug 13 '20 17:08 ryanpcmcquen

SAME ERROR!

jingyuexing avatar Apr 06 '21 14:04 jingyuexing

This should be fixed as it can randomly break ST and even affect other packages.

@liamcain do you have time to address it? Alternatively are you open to transferring this repo to https://github.com/SublimeText/ org?

rchl avatar Aug 10 '22 09:08 rchl