Skip to content

check timeout #3

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

Closed
wants to merge 9 commits into from
Closed

check timeout #3

wants to merge 9 commits into from

Conversation

hek14
Copy link

@hek14 hek14 commented Mar 17, 2023

If the user passes the wrong args to configs, it's possible that EasyFormat will not respond. This commit will kill the formatter process if it costs more than timeout(such as 100ms) and notify the user the check their configs.

if vim.fn.executable(conf.cmd) == 0 then
vim.notify('[EasyFormat] ' .. config.cmd .. ' not executable', vim.log.levels.Error)
return
if type(v) == 'table' then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v is always table because do check before .

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v = type(v) == 'boolean' and {} or v doesn't handle all of the situations. If the users wanna override a key like timeout, then it will not work. So we still have to check whether type(v) == "table"

@glepnir glepnir closed this Jun 12, 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

Successfully merging this pull request may close these issues.

2 participants