Skip to content

Expose screen.Redraw() to lua#2944

Closed
dmaluka wants to merge 1 commit intomicro-editor:masterfrom
dmaluka:lua-screen-redraw
Closed

Expose screen.Redraw() to lua#2944
dmaluka wants to merge 1 commit intomicro-editor:masterfrom
dmaluka:lua-screen-redraw

Conversation

@dmaluka
Copy link
Collaborator

@dmaluka dmaluka commented Sep 30, 2023

If lua code is running asynchronously, e.g. in a timer callback passed to time.AfterFunc(), micro does not automatically update the screen contents after the actions performed by this async lua code. For such cases, expose screen.Redraw() to lua (as micro.Redraw()) to let lua code explicitly request screen update when needed.

Fixes #2923

If lua code is running asynchronously, e.g. in a timer callback passed
to time.AfterFunc(), micro does not automatically update the screen
contents after the actions performed by this async lua code. For such
cases, expose screen.Redraw() to lua (as micro.Redraw()) to let lua code
explicitly request screen update when needed.

Fixes micro-editor#2923
@dmaluka
Copy link
Collaborator Author

dmaluka commented Sep 30, 2023

After I submitted this PR I've noticed that @X-Ryl669 has already submitted #2939 which does the same. Feel free to pick whichever looks better.

@dmaluka
Copy link
Collaborator Author

dmaluka commented Oct 1, 2023

Duplicates #2939, closing this one to avoid confusion.

@dmaluka dmaluka closed this Oct 1, 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.

Timer callback in lua plugins can't refresh the screen

1 participant