MarkdownEditing icon indicating copy to clipboard operation
MarkdownEditing copied to clipboard

Error throws on streaming into view

Open yaroslavyaroslav opened this issue 1 year ago • 1 comments

Hey, I'm using this package with my OpenAI plugin which streams text into md view. Occasionally I got spammed in logs with this error on streaming:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 954, in on_modified
    run_view_callbacks('on_modified', view_id)
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 747, in run_view_callbacks
    callback(*args)
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 162, in profiler
    return event_handler(*args)
  File "/Users/yar/Library/Application Support/Sublime Text/Installed Packages/MarkdownEditing.sublime-package/plugins/view.py", line 105, in on_modified
    pt = sel[0].begin()
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime.py", line 2291, in __getitem__
    raise IndexError()
IndexError

yaroslavyaroslav avatar Oct 10 '24 15:10 yaroslavyaroslav

Well, something seems to delete carets. This shouldn't happen.

deathaxe avatar Oct 19 '24 10:10 deathaxe