Sunday, August 7, 2022

popup window filter, what is <80><fd>` ?

Hi, currently there is no built-in way to have a prompt in a popup window so am trying to fake it with filtering.

While in the early stages, I found out that the filter func constantly gets <80><fd>` value.

What is this?
How can I properly filter it out?

With the following code:

vim9script

export def TestPopup(contents: string)
    var prompt = ""
    var main_id = popup_create(contents, {
        pos: 'center',
        mapping: 0,
        filter: (id, key) => {
            if key == "\<esc>"
                popup_close(id, -1)
            else
                prompt ..= key
            endif
            return true
        },
        callback: (id, result) => {
                echom prompt
            }
        })
enddef

TestPopup('hello')

If you wait a 3-4 seconds and close popup with ESC, you will see <80><fd>`:
viim-filter.gif

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5d3c9840-b60e-4c07-9040-01d859a47fb0n%40googlegroups.com.

No comments:

Post a Comment