LudoPinelli / comment-box.nvim

:sparkles: Clarify and beautify your comments and plain text files using boxes and lines.
MIT License
408 stars 15 forks source link

Comment boxing URL fails #8

Closed balazser closed 1 year ago

balazser commented 2 years ago

Hi @LudoPinelli, I noticed comment-box.nvim fails when I'm commenting out an URL.

Reproduce:

  1. move cursor to line containing https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/discuss/1054742/Python-O(logn)
  2. call :CBlbox on the line
  3. You should get the following error message:
    E5108: Error executing lua ...k/packer/start/comment-box.nvim/lua/comment-box/init.lua:114: attempt to perform arithmetic on local 'f' (a nil value)
    stack traceback:
        ...k/packer/start/comment-box.nvim/lua/comment-box/init.lua:114: in function 'wrap'
        ...k/packer/start/comment-box.nvim/lua/comment-box/init.lua:137: in function 'get_text'
        ...k/packer/start/comment-box.nvim/lua/comment-box/init.lua:197: in function 'create_box'
        ...k/packer/start/comment-box.nvim/lua/comment-box/init.lua:422: in function 'display_box'
        ...k/packer/start/comment-box.nvim/lua/comment-box/init.lua:453: in function 'lbox'
        [string ":lua"]:1: in main chunk
    Press ENTER or type command to continue