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

cant't work on sublime 4100 #121

Open
jingyuexing opened this issue Apr 6, 2021 · 1 comment
Open

cant't work on sublime 4100 #121

jingyuexing opened this issue Apr 6, 2021 · 1 comment

Comments

@jingyuexing
Copy link

the error log:

Traceback (most recent call last):
  File "I:\Programming\sublime_text_4100\Data\Installed Packages\LSP.sublime-package\plugin/core/windows.py", line 500, in _update_panel_main_thread
    panel.run_command("lsp_update_panel", {"characters": characters})
  File "I:\Programming\sublime_text_4100\Lib\python33\sublime.py", line 1304, in run_command
    sublime_api.view_run_command(self.view_id, cmd, args)
  File "I:\Programming\sublime_text_4100\Lib\python33\sublime_plugin.py", line 1490, in run_
    self.view.end_edit(edit)
  File "I:\Programming\sublime_text_4100\Lib\python33\sublime.py", line 1265, in end_edit
    sublime_api.view_end_edit(self.view_id, edit.edit_token)
  File "I:\Programming\sublime_text_4100\Lib\python33\sublime_plugin.py", line 924, in on_modified
    run_view_callbacks('on_modified', view_id)
  File "I:\Programming\sublime_text_4100\Lib\python33\sublime_plugin.py", line 708, in run_view_callbacks
    callback(v, *args)
  File "I:\Programming\sublime_text_4100\Lib\python33\sublime_plugin.py", line 152, in profiler
    return event_handler(*args)
  File "I:\Programming\sublime_text_4100\Data\Installed Packages\AutoFileName.sublime-package\autofilename.py", line 162, in on_modified
    sel = view.sel()[0].a
  File "I:\Programming\sublime_text_4100\Lib\python33\sublime.py", line 1012, in __getitem__
    raise IndexError()
IndexError
@leandro27
Copy link

leandro27 commented May 6, 2021

I'm using Sublime 4104 and this worked for me:
Open autofilename.py, using PackageResourceView. Go to line 162, and instead of

sel = view.sel()[0].a
txt = view.substr(sublime.Region(sel-4,sel-3))
if (self.showing_win_drives and txt == FileNameComplete.sep):
    self.showing_win_drives = False
    view.run_command('afn_delete_prefixed_slash')

Use:

try:
    sel = view.sel()[0].a
    txt = view.substr(sublime.Region(sel-4,sel-3))
    if (self.showing_win_drives and txt == FileNameComplete.sep):
        self.showing_win_drives = False
        view.run_command('afn_delete_prefixed_slash')

except IndexError:
    pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants