Skip to content

feat: add is formatting #25

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 2 commits into from

Conversation

otavioschwanck
Copy link
Contributor

add is_formatting

Useful for statusline

@glepnir
Copy link
Member

glepnir commented Jul 19, 2023

this need use like CursorHold or CursorMoved to render statusline after do format ?

@otavioschwanck
Copy link
Contributor Author

this need use like CursorHold or CursorMoved to render statusline after do format ?

No

@glepnir
Copy link
Member

glepnir commented Jul 19, 2023

so then how you get this function result twice in stl if there no event for trigger render stl .

@glepnir
Copy link
Member

glepnir commented Jul 19, 2023

maybe there need create a User GuardFormat event

@otavioschwanck
Copy link
Contributor Author

so then how you get this function result twice in stl if there no event for trigger render stl .

No idea hahah

image

image

@glepnir
Copy link
Member

glepnir commented Jul 19, 2023

okay is CursorHold when you hold cursor after updatetime value it will render stl

@otavioschwanck
Copy link
Contributor Author

okay is CursorHold when you hold cursor after updatetime value it will render stl

there is something missing in this PR ? @glepnir

@glepnir
Copy link
Member

glepnir commented Jul 21, 2023

I am thinking about create User GuardFormat event then you can use in stl

@otavioschwanck
Copy link
Contributor Author

I am thinking about create User GuardFormat event then you can use in stl

Should have two autocmd, User GuardFormatStart User GuardFormatFinished

@glepnir
Copy link
Member

glepnir commented Jul 21, 2023

just one is enough and get value from callback params like

nvim_exec_autocmds('User', {pattern = 'GuardFormat', modeline =true, data = { fmt_status = 'Pending' or 'Done'}

@otavioschwanck
Copy link
Contributor Author

just one is enough and get value from callback params like

nvim_exec_autocmds('User', {pattern = 'GuardFormat', modeline =true, data = { fmt_status = 'Pending' or 'Done'}

you are right!

@glepnir
Copy link
Member

glepnir commented Aug 14, 2023

#62

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