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

[Backport release-0.6] fix(lsp): fix nil-index behavior for UTF-8 in _str_*index_enc helper functions #16785

Merged
merged 1 commit into from
Dec 25, 2021

Conversation

github-actions[bot]
Copy link
Contributor

Description

Backport of #16731 to release-0.6.

…hods

Previously, the `_str_utfindex_enc` and `_str_byteindex_enc` helper functions would return `nil` when `offset_encoding == "utf-8"` and `index == nil`. Clearly, this doesn't reflect the expected behavior of the functions they're wrapping which would return the length of the line in this case. This should fix behavior with servers that use UTF-8 `offset_encoding` when applying text edits, formatting a range, and doing range code actions (though this isn't tested currently).

(cherry picked from commit 5f4c501)
@mjlbach mjlbach merged commit 03bd914 into release-0.6 Dec 25, 2021
@mjlbach mjlbach deleted the backport-16731-to-release-0.6 branch December 25, 2021 15:52
bfredl added a commit that referenced this pull request Dec 31, 2021
Bug Fixes

  * api: allow nvim_buf_set_extmark to accept end_row key #16686 1b54344
  * diagnostic: assert that diagnostics have line number and column #16687 9dae939
  * diagnostic: clamp diagnostics on negative line numbers #16497 096f841
  * diagnostic: escape special chars in file names #16588 beac24d
  * diagnostic: respect "if_many" source option for virtual text #16697 060eeaa
  * diagnostic: set effective buffer number for DiagnosticChanged autocmd #16485 84784a8
  * diagnostic: set effective buffer number in autocmd (again) #16590 08ddfa9, closes #16474
  * lua: do not cast offset to char_u 93f1ec0
  * lsp: avoid attaching to unloaded buffers #16726 0088994
  * lsp: call config on_exit handler before context is cleared #16781 571609f
  * lsp: fix `nil`-index behavior for UTF-8 in `_str_*index_enc` methods #16785 03bd914
  * lsp: handle offset encoding #16783 7b60ec7
  * lsp: progress handlers should return vim.NIL on error #16476 fb11ef0
  * options: disallow empty 'fdc' and 'scl' #16776 37a00be
  * quickfix: avoid O(N^2) when filling from string typval #16663 aa0ddc6
  * screenpos, float: add top and left border adjustment 8f68548
  * terminal: fix resize crash with pending scrollback #16665 ae249d8
  * ui: close floating window on BufLeave event #16664 785bace
  * uri: change scheme pattern to not include the comma character #16798 0e96f7d

Features

  * lsp,diagnostic: open folds in jump-related functions #16784 ee9e342
  * lsp: add buf_detach_client #16741 ec101b9
  * lsp: use `vim.ui.select` for selecting lsp client #16782 14357c8
  * runtime: new checkhealth filetype #16708 09306f0
@dundargoc dundargoc mentioned this pull request Jan 4, 2022
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

Successfully merging this pull request may close these issues.

2 participants