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

E117: Unknown function: getbufoneline #1512

Closed
Jsbjr opened this issue Nov 16, 2023 · 4 comments
Closed

E117: Unknown function: getbufoneline #1512

Jsbjr opened this issue Nov 16, 2023 · 4 comments

Comments

@Jsbjr
Copy link

Jsbjr commented Nov 16, 2023

hello,
I did an update today (master -> ee2bb88) and now i get the following error:

Error detected while processing function <SNR>56_debounceTimeTimerCallback[1]..<SNR>56_tapSourceCallback[4]..<SNR>56_tapSourceCallback[1]..<lambda>26[1]..<SNR>76_set_highlights[10]..<SNR>76_place_highlights:
line   59:
E117: Unknown function: getbufoneline
Error detected while processing function <SNR>56_debounceTimeTimerCallback[1]..<SNR>56_tapSourceCallback[4]..<SNR>56_tapSourceCallback[1]..<lambda>26[1]..<SNR>76_set_highlights[10]..<SNR>76_place_highlights:
line   59:
E116: Invalid arguments for function strlen(getbufoneline(a:bufnr, l:line)) + 1

Apparently in vim-lsp/autoload/lsp/internal/diagnostics/highlights.vim on line 189 the function getbufoneline is used but not defined.

@prabirshrestha
Copy link
Owner

It is probably older version of vim where we need to check if it exists before using it.

@Jsbjr
Copy link
Author

Jsbjr commented Nov 17, 2023

That is possible, i am using vim in WSL with Ubuntu 22.04

vim --version 
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 06 2023 07:49:43)
Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     -perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
-clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          -ruby              +wildignore
+cursorbind        -lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      +sodium            -X11
+digraphs          +mouse             -sound             -xfontset
-dnd               -mouseshape        +spell             -xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        +mouse_gpm         +statusline        -xsmp
+eval              -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static

It looks like adding the following solve the issue:

if exists('?getbufoneline')
    let l:highlight_end_col = strlen(getbufoneline(a:bufnr, l:line)) + 1
else
    let l:highlight_end_col = strlen(getbufline(a:bufnr, l:line)[0]) + 1
endif

@prabirshrestha
Copy link
Owner

Feel free to send the PR with those changes.

@Jsbjr
Copy link
Author

Jsbjr commented Nov 20, 2023

#1514 Solve the issue thanks.

@Jsbjr Jsbjr closed this as completed Nov 20, 2023
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