Commit Graph

1441 Commits

Author SHA1 Message Date
Takase 3fe64609e7
Install plugins with lpm inside meson (#1951)
* meson: install plugins with lpm

* meson: add cachedir as output

* build.sh: fix bash syntax error

* build.sh: only copy datadir when PGO is enabled

* build.sh: properly install files with meson install

* build.sh: install macOS bundle files with .app suffix

* ci: copy bundle and portable files correctly

* package-dmg: remove extraneous steps

* ci: fix wrong bundle path

* build.sh: force reconfigure bundle=false if bundle is not explicitly given

* build.sh: move wrong bundle=true assignment to the right place

* ci: remove -a flag from cp command

* ci: use xargs and find -print0 to omit spaces in find output

* ci: specify correct path to Info.plist

* ci: correctly run dmgbuild

* dmgbuild: get application path from command line

* ci: organize dmgbuild arguments

* ci: properly escape arguments

* ci: finally correctly specify yaml string

* ci: don't copy Info.plist again

* build.sh: don't install any plugins if -A is not specified

* build.sh: use the latest release from github
2024-11-25 13:39:48 +01:00
Guldoman 1ce8cd1d82
Add `minimum_thumb_size` and `{contracted,expanded}_scrollbar_margin` to `Scrollbar` (#1589)
* Add `minimum_thumb_size` to `Scrollbar`

* Add `{contracted,expanded}_scrollbar_margin` to `Scrollbar`
2024-10-22 13:05:07 -04:00
Guldoman f81bd133b8
Add `inclusive` parameter to `Doc:get_text` (#1586)
This is needed to get the last character of the "selection".

For example:
```lua
doc:get_text(1, 1, #doc.lines, math.huge)
```
will return everything but the last newline, while
```lua
doc:get_text(1, 1, #doc.lines, math.huge, true)
```
will return the last newline too.
2024-10-22 12:59:55 -04:00
Takase f2a18cdce7
feat(core.emptyview): add name to emptyview (#1569)
* feat(core.emptyview): add name to emptyview

* fix(core.emptyview): set filename to empty
2024-10-22 18:43:50 +02:00
Guldoman 46b1499f4f
Fix multi-type usage in delimited patterns (#1740)
In the "end" pattern we weren't considering the multiple types.
2024-10-22 12:33:01 -04:00
Guldoman d486058875
Add support for relative `require`s (#1634) 2024-10-22 12:31:45 -04:00
Takase d925da47fa
Allow writing to hidden files on Windows (#1653)
* feat(system): add system.ftruncate

* fix: EPERM writing to hidden files on Windows

* chore(doc): fix capitalization

* refactor(system): make ftruncate length optional

* refactor(doc): don't specify length
2024-10-22 18:14:30 +02:00
ThaCuber 08fd994423
improve projectsearch (#1876)
* improve projectsearch

- stick status to top of view
- add horizontal scrolling
- added ellipsis at the end of the text if it's too long

* Reverted removal of 0 on yield.

---------

Co-authored-by: Adam Harrison <adamdharrison@gmail.com>
2024-10-22 18:10:33 +02:00
takase1121 a25ab3c535 process: migrate arg validation and checking to Lua 2024-10-22 17:17:40 +02:00
Guldoman 850aa25879
treeview: remove unused code (#1895)
It caused a lot of useless `system.absolute_path` calls.
2024-10-21 18:28:55 +02:00
Adam 5b6c666652
Add keyboard shortcut to tooltips in `ToolbarView` (#1880) 2024-10-02 05:41:12 +02:00
Guldoman de118ab82a
Add primary selection support (#1729)
* Add support for primary selections

* Handle primary selection in `DocView`s
2024-09-13 13:31:15 -04:00
Takase 872364ded3
Configurable statusview icon (#1617)
* docs(core.statusview): fix item.visible being mandatory

* feat: make the line icon configurable

* fix: empty icons

* fix: use user specified font

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

* fix: never draw anything if disabled

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

* fix: always add stonks icon

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

* feat: add rgb functionality

* fix: reduce number of color changes

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2024-09-03 13:42:55 -04:00
Takase f5df5d6626 Revert "fix: avoid following symlinks in `common.rm`"
This reverts commit e3e8badf99.
2024-07-22 12:10:35 +08:00
Guldoman e3e8badf99 fix: avoid following symlinks in `common.rm` 2024-07-22 11:06:51 +08:00
aia29 96579d9a7f add cuda 2024-07-04 13:09:00 +08:00
Adam 3bb27082ae
(fix): passed missing core.window to set_window_mode call (#1836)
* (fix): passed missing core.window to set_window_mode call

* Propogated fix to calls made from TitleView.
2024-06-30 07:26:01 +08:00
takase1121 adb64e6784 core/doc: fix wrong table index in Doc:merge_cursors
it was off by 1
2024-06-24 22:22:57 +08:00
Guldoman 7ca4c948bf fix(doc): convert `Doc:merge_cursors` parameter from "selection index" to table index 2024-06-24 22:14:53 +08:00
Takase 6cbfa44c95
core/rootview: fix dnd multiple folders into dock (#1828) 2024-06-23 13:09:07 +08:00
Guldoman 74fcd19ac2
fix(autoreload): wait a second before automatically reloading a file (#1823)
This is needed because we use `mtime` to determine if a file has actually changed, but on most systems this has a resolution of 1 second (and we truncate it to an integer anyways).

Without this wait, we would skip reloading a file that has been changed multiple times in the same `mtime` second, thus losing some data.
2024-06-23 10:01:50 +08:00
Jan 1a045e5e86
move window creation and management to Lua (#1751)
* remove scaling logic from font code
for the time being its been hardcoded to 1 for the non SDL Renderer basewin setup, so nothing is lost for non MacOS users.
will be revisited in the future when scaling is improved with SDL3 and moved into scripts.

* remove unused window_renderer argument from font functions

* move window logic to lua, pass window via argument

* rename window creation functions `*_create`, `*_destroy`, add real init

* Set active window when processing frame

* get size directly from RenWindow, get active window size from renderer

* correct reverted draw calls

* fix window not reappearing on restart

* add simple logic to persist the core window

* fix style

* add renwindow documentation

* make windows hidden by default again

* reorder ren_update_rects execution, add comment to note future work
2024-06-22 15:01:39 -04:00
Adam dae74f01ae
Expand Process API (#1757)
* Initial commit of process framework.

* Fixed a small issue.

* Cleaned up old name.

* Harmonized with lua 5.4, and added documentation.

* Process is a userdata, not a table, so had to wrap it. Also added in `wait`.

* Added in documentation.

* Clarified documentation.

* Applied patch, and fixed undefined variable.

* Re-ordered documentation to be more sensible, added missing option.

* Added into start.

* Removed unecessary require.
2024-06-22 12:43:05 -04:00
fgelm01 5bca44f3bf
Handle static constexpr in language_cpp (#1806) 2024-06-22 12:15:33 -04:00
Takase 687aeda956
macos: support drag-and-drop and default file associations (#1822)
* macos: support drag-and-drop and default file associations

* resources/macos: use LSItemContentTypes to narrow down files

* macos: support opening folders

* rootview: workaround macos weird dnd event timing

* core/rootview: rename variable and refactor if statement
2024-06-22 12:23:06 +08:00
Gaspartcho c86677831e
Update language_python.lua (#1723)
* Update language_python.lua

* Update language_python.lua

* Update language_python.lua

* implemented a better `python_type` subsyntax

* Update language_python.lua

* fixed a small error where you couldn't hint a type at a var and guive it a value at the same time

* Update language_python.lua

* Update language_python.lua

Dictionaries appear now normally

* Update language_python.lua

* added suggestions concerning strings

* commited suggestion

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

* Various changes

* Update language_python.lua

Syntax more optimized but a tiny bit more complex...

* Simplified everything

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2024-06-21 07:54:32 +08:00
fgelm01 4ec908bc1e
Add support for binary integer literals. (#1819) 2024-06-20 14:55:01 +08:00
Takase 0fc179a4b5
language_cpp: backport number highlighting from c (#1818) 2024-06-20 10:16:39 +08:00
ThaCuber 4df2871a46
improve number highlighting for c (#1752)
* improve number highlighting for c

* add unsigned suffix

* add long suffixes

* reorder octal literals and add suffix for hex numbers

* fix integer and float suffixes
too many characters, send help
2024-06-20 10:02:12 +08:00
Guldoman 4d649ba92d
fix: avoid iterating over a changing table in `run_threads` (#1794)
* fix: avoid iterating over a changing table in `run_threads`

This is done to avoid iterating over a table that can change in the meantime.
More precisely the issue appears if a thread is removed from the table, we yield early from `run_threads` because we reached the end of the frame, and a new thread is added before the next iteration.

For example:
```lua
local lost_time = false
core.add_thread(function()
  -- force early yield
  local t0 = system.get_time()
  while system.get_time() - t0 < .1 do end
  lost_time = true
end, "a")

local step = core.step
function core.step()
  if lost_time then
    -- add a new thread while run_threads hasn't finished iterating
    core.add_thread(function()end, "a1")
    lost_time = false
  end
  return step()
end
```
would crash with `invalid key to 'next'`.

* fix: only run coroutine if it wasn't removed

* fix: don't handle `core.threads` table as an array

This caused some entries to be skipped or even removed erroneously.
2024-06-05 08:58:19 -04:00
fgelm01 e0a7bdbcba
Change co_wait to co_await in language_cpp (#1800)
The C++20 keyword is spelled `co_await`.
2024-06-05 12:25:33 +02:00
Guldoman 21dcd782c0
Skip patterns matching nothing in `tokenizer` (#1743)
These patterns cause infinite loops, so warn about them and skip them.
2024-04-15 09:00:03 +08:00
PerilousBooklet 727c179deb
Added Arduino syntax highlighting support alongside C++. (#1767) 2024-04-13 10:54:31 +02:00
PerilousBooklet e9e2d83dc5
Fixed some typos in core.init (#1755)
* Fixed some typos.

* Update data/core/init.lua

Co-authored-by: Takase <20792268+takase1121@users.noreply.github.com>

* Update data/core/init.lua

Co-authored-by: Takase <20792268+takase1121@users.noreply.github.com>

---------

Co-authored-by: Takase <20792268+takase1121@users.noreply.github.com>
2024-03-28 19:33:55 +01:00
Guldoman 3bed5c16ae
Limit `language_js` regex avoidance to numbers, and fix starting `/*` comments (#1744)
* Avoid starting regexes only after numbers in `language_js`

* Allow starting `/*` comments after numbers in `language_js`
2024-03-25 00:20:32 +01:00
Aziz Mazouz Jaber 6e849890be
Add from symbol to support ESM (#1754) 2024-03-24 14:25:44 -04:00
Guldoman cfca01e88e
Fix `language_js` regex/comment distinction (#1731) 2024-03-06 21:06:36 +01:00
Guldoman 2c1dc93d9d
Improve `CommandView` and `autocomplete` scroll behavior (#1732)
* Make command palette item scrolling more natural

Also add a config option for the maximum number of visible entries in the command palette.

* Make `autocomplete` item scrolling more natural
2024-03-05 22:56:01 -05:00
Guldoman abf8955799
Improve `autocomplete` suggestions box behavior (#1734)
* Improve `autocomplete` suggestions box sizing

This avoids that the box gets too big because of non-visible items, and makes it reactive to window sizing.

* Draw ellipsis when `autocomplete` entries aren't fully visible
2024-03-05 22:29:17 -05:00
PerilousBooklet 03b8c239dc
Added .pyi extension to python. (#1728) 2024-02-24 01:46:28 +01:00
Luke aka SwissalpS 8cf40de860
Fix comment typos in data/core/{init.lua,dirwatch.lua} (#1549)
* comment typo in data/core/init.lua

* init.lua reword comment

* Update dirwatch.lua

Some wording is still whacky, maybe next time

* Update dirwatch.lua

* clear up can/may be not nil confusion

* falsey vs falsy new wording to help out

* falsey -> falsy

* Update data/core/dirwatch.lua

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2024-01-21 22:30:59 +01:00
Takase dd69d7b9d0
language_js: support binary and octal representation (#1710) 2024-01-21 10:18:13 +08:00
vqn c561eb78e6
autoreload docs only if their filename matches an actual file (#1698) 2024-01-21 01:49:25 +01:00
vqn fd9b17ff15
reorder nagview options on doc:save error to be more consistent with other nagview confirmations (#1696) 2024-01-20 01:19:12 +01:00
Fiji c27d9aa0c0
Improve number highlighting for python syntax highlighting (#1704)
* Improve number highlighting for python syntax highlighting

Adds support for octal and binary representation, as well uppercase characters (X, B and O)

* add underscore and negative hex/oct/bin value support

* Removed | from pattern
2024-01-20 01:04:49 +01:00
vqn 8b9b26e18f
Fix doc:create-cursor-previous/next-line with tabs (#1697)
* use DocView.translate to split cursor on previous/next line

* use dv.doc instead of doc()
2024-01-13 13:49:26 +01:00
Adam Harrison cfbe68936a Fixed a minor bug, should close issue #1680. 2023-12-03 11:09:56 -05:00
ThaCuber f26eef14fa
fix nagbar failed save message (#1678)
* fix nagbar failed save message

- visually separated statements with a `.`
- first statement slightly rewritten
- use `'` rather than `"`

* yeahhhh no back to `"`
2023-12-03 06:44:07 +08:00
Guldoman e8ae7583bc
Expose plaintext syntax (#1652) 2023-11-30 10:53:01 -05:00
Guldoman 9a4831d5c2
Use `\r\n` for new files on Windows (#1596)
* Use `\r\n` for new files on Windows

* Add `config.line_endings`
2023-11-30 10:51:10 -05:00