blacklight / nvim-http

An HTTP client for neovim inspired by vscode-restclient and the IntelliJ HTTP client
MIT License
87 stars 5 forks source link

TypeError: 'tuple' object does not support item assignment #4

Closed blacklight closed 8 months ago

blacklight commented 8 months ago

vim.current.window.cursor always returns a tuple now (it used to be a list before, or it could be overridden to a list):

Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/blacklight/git_tree/dotfiles/.vim/bundle/nvim-http/autoload/../python/nvim_http/client.py", line 61, in http_run
    text = "\n".join(vim.current.range) if visual else select_surrounding_http_request()
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/blacklight/git_tree/dotfiles/.vim/bundle/nvim-http/autoload/../python/nvim_http/parser.py", line 50, in select_surrounding_http_request
    vim.current.window.cursor[1] = 0
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: 'tuple' object does not support item assignment

We therefore need to always assign tuples to this object rather than modifying its individual elements.