Not able to filter status messages in a Vim9 script using :filter

9 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Oct 11, 2020, 11:57:40 AM10/11/20
to vim_dev
Hi,

Before patch 8.2.1832, exceptions from readdireex() cannot be caught.
When readdirex() fails to read a directory, it emits a status message.
If there are multiple unreadable directories, then multiple messages
are displayed. I am trying to filter these messages using the ":filter"
command.

In a Vim9 script, I am not able to filter the status message:
============
vim9script
var l: list<dict<any>>
:filter /abc/ l = readdirex('non-existing-dir')
echo l
============
The above code snippet displays the "E476: Invalid command:" error.

In a Vim8 script, i am able to filter the status message:
============
filter /abc/ let l = readdirex('non-existing-dir')
echo l
============

- Yegappan

Reply all
Reply to author
Forward
0 new messages