Commit Graph

308 Commits

Author SHA1 Message Date
George Sokianos 5c983f10b5 Merge branch 'master' into amiga2.1 2023-12-26 13:36:13 +00:00
Guldoman 2571e17d1b Fix `core.redraw` when window is not focused (#1601)
* Execute at least one step when window has no focus

This way if `core.redraw` is set, it's respected.

* Fully run threads at least once when window has no focus

This allows threads that set `core.redraw` (like `projectsearch`) to 
continue running even after the window loses focus.

"Fully" here means that `run_threads` has gone through *all* the "timed 
out" coroutines at least once.
2023-12-26 13:16:33 +00:00
Guldoman 3ee903b16c Fix `dirmonitor` sorting issues (#1599)
* Use `PATHSEP` in path-related functions

* Don't stop on digits when getting the common part in `system.path_compare`

* Avoid sorting multiple times in `dirwatch.get_directory_files`

This also fixes the timeout detection in `recurse_pred`.
2023-12-26 13:16:33 +00:00
Guldoman 1dceaf65f5 Fix running `core.step` when receiving an event while not waiting
When `time_to_wake` was <= 0, so when a coroutine needed to be executed 
as soon as possible, we didn't check for events, so we only performed a 
`core.step` with the blink timer.
This resulted in jerky reactions to input.
2023-12-26 13:16:33 +00:00
Guldoman 7e20424b29 Ignore keypresses during IME composition (#1573)
Some IMEs continue sending keypresses even during composition, so we 
just ignore them.
2023-12-26 13:16:33 +00:00
Takase dc14860166 fix(core): defer core:open-log until everything is loaded (#1585)
* fix(core): defer core:open-log until everything is loaded

* docs(core): document why core:open-log is opened in a thread
2023-12-26 13:16:33 +00:00
Adam 5b62eba35f Fixed things for when a thread requests a redraw. (#1570)
* Fixed things for when a thread requests a redraw.

* @guldoman's changes.

* Whoops.
2023-08-07 15:26:49 +01:00
Guldoman 48bcf66cc1 When logging don't use `core.status_view` if not yet initialized 2023-08-07 15:26:38 +01:00
Guldoman 43f9b8accc Add mouse grab (#1501)
* Add mouse grab

We now also send mouse movement events only to the interested view.

* Add deprecation messages handler

* Make various `View`s respect `on_mouse_left`

* `StatusView`
* `TitleView`
* `TreeView`
* `ToolbarView`

* Fix scrollbar in `TreeView` not updating

We were in some cases sending outdated mouse positions to the scrollbar, 
which made it think that the mouse was hovering it.

This also updates the hovered item more responsively during scroll.
2023-08-07 15:26:38 +01:00
Jan 9fb714236b Add View dragging (#1402) 2023-08-07 15:26:38 +01:00
Adam 9634715618 Added in support for foreground and background events. (#1395) 2023-08-07 15:26:38 +01:00
Adam acbd8715f4 Added in explicit touchscreen keyboard support. (#1389) 2023-08-07 15:26:38 +01:00
Adam b30ea9e9ef Disable `trimwhitespace` and `drawwhitespace` via their configs (#1446)
Instead of completely disabling them, we now use their internal toggle.

Also moved `drawwhitespace` commands inside the plugin.

---

* Fixed bug where commands would show even when plugin was disbled. Also removed antiquated way of disabling.

* Fixed typos.

* Also moved trimwhitespace out of config, if it already has a default enabled value of false.

* Changed documentation.

* Clarified comments.
2023-08-07 15:26:38 +01:00
Guldoman c1adfb55d2 Limit `core.threads` without a timeout to run 30 times per second 2023-08-07 15:26:38 +01:00
Adam Harrison c8977ca62b Made things clearer, as per jgm's suggestion. 2023-08-07 15:26:38 +01:00
Adam b348acaa81 Made coroutines make more sense, and fixed a bug. (#1381)
* Made coroutines make more sense, and fixed a bug.

* Fixed typo.

* Additional checking for off-cycles.

* Fixed issue with calling step too much.

* If we have no redraw, set next step time for next frame.

* Added in `now` variables to reduce calls.
2023-08-07 15:26:38 +01:00
Jefferson González 68108aeff2 NagView: properly rescale on scale change (#1379)
* drop font option since style.font is always used
2023-08-07 15:02:19 +01:00
Guldoman c40e19d9fe Make mod-version follow semver (#1036)
* Make mod-version follow semver
  Now plugins can optionally specify the minor and patch version they
support.
  If no minor or patch version is specified, it's considered 0.
  Plugins are only loaded if they have the same major version and a
  smaller or equal minor+patch version.
* Add modversion to logging and plugin mismatch nagview

---------

Co-authored-by: Jefferson González <jgmdev@gmail.com>
2023-08-07 15:02:19 +01:00
Adam 1378c3d6a7 Getting rid of annoying forward slash on windows. (#1345) 2023-08-07 15:02:06 +01:00
Adam 9b0a348a91 Added in Config Postload (#1336)
* Added in an `onload` variable to configs which is called by the plugin loader.

* Used appropriate parameter.

* Fixed tabbing.
2023-08-07 15:01:50 +01:00
Adam 5145194f1f Fixed things for when a thread requests a redraw. (#1570)
* Fixed things for when a thread requests a redraw.

* @guldoman's changes.

* Whoops.
2023-08-07 14:51:14 +01:00
Guldoman f80a4563be When logging don't use `core.status_view` if not yet initialized 2023-08-07 14:50:59 +01:00
Guldoman 528e5641fb Add mouse grab (#1501)
* Add mouse grab

We now also send mouse movement events only to the interested view.

* Add deprecation messages handler

* Make various `View`s respect `on_mouse_left`

* `StatusView`
* `TitleView`
* `TreeView`
* `ToolbarView`

* Fix scrollbar in `TreeView` not updating

We were in some cases sending outdated mouse positions to the scrollbar, 
which made it think that the mouse was hovering it.

This also updates the hovered item more responsively during scroll.
2023-08-07 14:50:59 +01:00
Jan 662fde364b Add View dragging (#1402) 2023-08-07 14:50:58 +01:00
Adam 7ca0ec18ca Added in support for foreground and background events. (#1395) 2023-08-07 14:50:58 +01:00
Adam ee80b451c6 Added in explicit touchscreen keyboard support. (#1389) 2023-08-07 14:50:58 +01:00
Adam 1becf35508 Disable `trimwhitespace` and `drawwhitespace` via their configs (#1446)
Instead of completely disabling them, we now use their internal toggle.

Also moved `drawwhitespace` commands inside the plugin.

---

* Fixed bug where commands would show even when plugin was disbled. Also removed antiquated way of disabling.

* Fixed typos.

* Also moved trimwhitespace out of config, if it already has a default enabled value of false.

* Changed documentation.

* Clarified comments.
2023-08-07 14:50:58 +01:00
Guldoman b005454652 Limit `core.threads` without a timeout to run 30 times per second 2023-08-07 14:50:58 +01:00
Adam Harrison 73ff025552 Made things clearer, as per jgm's suggestion. 2023-08-07 14:50:58 +01:00
Adam 7f0651155d Made coroutines make more sense, and fixed a bug. (#1381)
* Made coroutines make more sense, and fixed a bug.

* Fixed typo.

* Additional checking for off-cycles.

* Fixed issue with calling step too much.

* If we have no redraw, set next step time for next frame.

* Added in `now` variables to reduce calls.
2023-08-07 14:50:58 +01:00
Jefferson González 84039331a5 NagView: properly rescale on scale change (#1379)
* drop font option since style.font is always used
2023-08-07 14:50:58 +01:00
Guldoman 57cd4e2949 Make mod-version follow semver (#1036)
* Make mod-version follow semver
  Now plugins can optionally specify the minor and patch version they 
support.
  If no minor or patch version is specified, it's considered 0.
  Plugins are only loaded if they have the same major version and a 
  smaller or equal minor+patch version.
* Add modversion to logging and plugin mismatch nagview

---------

Co-authored-by: Jefferson González <jgmdev@gmail.com>
2023-08-07 14:50:58 +01:00
Adam f74716b436 Getting rid of annoying forward slash on windows. (#1345) 2023-08-07 14:50:58 +01:00
Adam 4682092b8d Added in Config Postload (#1336)
* Added in an `onload` variable to configs which is called by the plugin loader.

* Used appropriate parameter.

* Fixed tabbing.
2023-08-07 14:50:43 +01:00
George Sokianos 65d95c7f40 Merge branch 'master' into amiga2.1 2023-01-08 21:04:04 +00:00
Dave 4e272c33de Minor typos in init text 2022-12-30 13:32:20 +01:00
Simon Krauter 8603644726
Fix two typos in data/init.lua (#1272) 2022-12-27 19:56:30 -04:00
Martin Ashby d4989d98bd
Add example settings to _overwrite_ an existing key binding (#1270) 2022-12-27 18:40:22 -05:00
jgmdev fb43e6f9e6 traceback: some lua versions do not support message as nil 2022-11-07 12:48:09 -04:00
Takase 437b954595
make the default core.ignore_files more specific (#1160)
* make the default core.ignore_files more specific

instead of blanket ignoring all dotfiles, we define a list of folders
and files to ignore. this makes the overall experience better.

* fix wrong path pattern

* add ignore_files to user init
2022-10-19 22:23:01 -04:00
Guldoman 5c2c95765e
Add IME support (#991) 2022-10-15 19:58:51 -04:00
Jefferson González f89088d0ec
dirmonitor: add watch to subdirs on file limit mode (#1155) 2022-10-13 00:37:52 -04:00
Jefferson González 214c9d6287
dirwatch: exit coroutine if project not open anymore to properly gargage collect it (#1142) 2022-10-11 13:22:44 -04:00
George Sokianos 2bdfd5a694 Merge branch 'master' into amiga-2.0 2022-09-26 17:27:35 +01:00
George Sokianos 283f1d0837 Fixed an issue when the user added a directory in the project that already existed 2022-08-29 20:28:33 +01:00
George Sokianos 7b51ee99de Fixed editor refresh whenever init.lua is changed, no matter the working folder 2022-08-28 18:03:34 +01:00
Aqil Contractor 9b1bfeacac
Added a smoothing and strikethrough option to font loading. (#1087)
* Added a smoothing option to font loading.
* Added a font strikethrough option to font loading.
* Fixed underline applying incorrectly in cases of non-underlined fallback fonts being used.

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2022-08-20 16:15:08 -04:00
cisoun 366cadf605
Add font style options in user module 2022-07-15 12:05:59 +02:00
Guldoman 259de54c33
Fix opening `LogView` when reloading customizations
As `reload_customizations` was called during save operations, opening 
the `LogView` changed `core.active_view` which caused some errors to be 
thrown.
2022-06-28 04:21:43 +02:00
jgmdev 3f206db69a initial documentation for better code completion 2022-06-07 22:09:34 -04:00