Sunday, August 7, 2022

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



Salman

On Sun, Aug 7, 2022, 10:53 Bram Moolenaar <Bram@moolenaar.net> wrote:

Maxim Kim wrote:

> 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>`:
> [image: viim-filter.gif]

Don't see it in the GIF.

here probably is a third byte that you don't see.  0x80 0xfd is a
prefix for a special key.  There is a list in src/keymap.h, "enum
key_extra".

It shows up on the command line at the bottom at the end of the 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/CANuxnEdgVWJB8XW0LcmpryJMC5HA1FSN49FpXPsoZj7OW4AG0w%40mail.gmail.com.

No comments: