Commit graph

15 commits

Author SHA1 Message Date
Dmytro Maluka
838f371486
Revert "Don't expose Go timers directly to lua" (#3211)
* Revert "Don't expose Go timers directly to lua"

This reverts commit 4ffc2206ee.

Reason for revert: some plugins happen to use raw Go timers via
time.AfterFunc(), in an unsafe way (without synchronizing their
async code with micro). Let them keep doing that for now, in an
unsafe way but at least without immediate crashes.

Fixes #3209

* Add TODO about Go timers deprecation
2024-03-25 17:11:12 +01:00
Dmytro Maluka
1d1b363fa7 Remove lua.Lock
Exposing locking primitives to lua plugins is tricky and may lead to
deadlocks. Instead, if possible, it's better to ensure all the needed
synchonization in micro itself, without leaving this burden to lua code.

Since we've added micro.After() timer API and removed exposing Go timers
directly to lua, now we (probably?) have no cases of lua code possibly
running asynchronously without micro controlling when it is running. So
now we can remove lua.Lock.

This means breaking compatibility, but, until recently lua.Lock wasn't
workable at all (see #2945), which suggests that it has never been
really used by anyone. So it should be safe to remove it.
2024-03-14 04:53:56 +01:00
Dmytro Maluka
4ffc2206ee Don't expose Go timers directly to lua
Since we now expose our own micro.After() API which is more convenient
and safer to use than directly using Go timers, we can remove exposing
Go timers to lua directly.
2024-03-14 04:52:59 +01:00
guangwu
d7c8daad0d
chore: os.SEEK_CUR os.SEEK_END os.SEEK_SET has been deprecated since Go 1.7 (#2856) 2023-07-04 12:13:41 -07:00
Carlos Henrique Guardão Gandarez
7a5f7e443a
Make more libraries available (#1917)
* Make more libraries available to plugin dvelopment

* Add Unzip function to util
2020-11-21 01:46:17 -05:00
Utkarsh Gupta
b748d0c383
Drop unnecessary Ftoa and FtoaWithDigits function (#1751)
Fixes: #1749

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
2020-06-30 13:19:27 -04:00
Zachary Yedidia
253281ae5e Add a lock for plugins to use if using async code
Ref #1539
2020-06-28 16:29:32 -04:00
Zachary Yedidia
5f62f550f3 Add more functions to customize status bar
Adds `status.lines`, `status.vcol`, `status.bytes`, `status.size`,
and exposes some functions from go-humanize to plugins.

Ref #1727
2020-06-24 17:19:42 -04:00
Zachary Yedidia
4027081e0e Add linter plugin support 2019-12-25 17:05:10 -05:00
Zachary Yedidia
e3ae38e54a Autoclose plugin support 2019-12-25 17:05:10 -05:00
Zachary Yedidia
74ee256260 Revert "Some plugin helpers"
This reverts commit 75f9d7d9122f5b475c4ff323cca7cc068ea4e411.
2019-12-25 17:05:10 -05:00
Zachary Yedidia
d45f8b4d23 Some plugin helpers 2019-12-25 17:05:10 -05:00
Zachary Yedidia
3335f377a9 Some plugin callbacks 2019-12-25 17:05:10 -05:00
Zachary Yedidia
5ab6c9795f Load plugins 2019-12-25 17:05:10 -05:00
Zachary Yedidia
0612af1590 Change project layout and use go.mod 2019-12-25 17:05:10 -05:00