Commit Graph
1398 Commits
Author SHA1 Message Date
takase1121 b5317c5318 core: make project_dir detection more robust
On macOS, listing / can silently fail due to SIP. We try to default to ~ if there's no choice.
2025-06-05 11:03:45 +08:00
Ildar Mulyukovandtakase1121 5ff596aff2 language_lua: add files with rockspec extenstion 2025-05-18 22:55:30 +08:00
Takase 590367a6e5 syntax: warn against malformed patterns and disable them (#2029)
(cherry picked from commit 3501f3d0bb6ee399ecb7cdf04cff8cf138b1ca02)
2025-05-18 22:55:29 +08:00
Takase 026d2a4271 language_cpp: add back digit separators (#2026)
* language_cpp: add back digit separators

* language_cpp: rewrite number matching in regex

* language_c: port digit separators over from language_cpp

(cherry picked from commit 8ea0393800bb59a214e8a6efd5b9fb69282803a9)
2025-05-18 22:55:29 +08:00
Takase 0d9431857e common: allow / and \ as PATHSEP on Windows when fuzzy matching files (#1992)
* common: allow / and \ as PATHSEP on Windows when fuzzy matching files

* common: fix PLATFORM == Windows

(cherry picked from commit 5d6ae412e76e69181a3b46c79b8408fbd55183c9)
2025-05-18 22:55:28 +08:00
takase1121 7a68eaa165 fix: use current char to determine col in DocView:get_x_offset_col (#1946)
Previously it would use the last char position, which resulted in incorrect values when the next char had a different size than the current one.

(cherry picked from commit f066c88e186a02b9912d7f102b541f514ae1aa35)
2025-05-18 22:55:20 +08:00
ThaCuberandtakase1121 ce16538903 add a __tostring method to every object (#1534)
* added a stupid __tostring to every object

* moved every __tostring to just after the :extend() call

---------

Co-authored-by: Adam <adamdharrison@gmail.com>
(cherry picked from commit 880e7f1fa1521cdf176f44627a27c901e187058e)
2025-05-18 22:54:38 +08:00
Programutoxandtakase1121 15123e4054 Update CSS plugin to support more units (#2010)
* Update css plugin to support more units

* Fixed spacing.

---------

Co-authored-by: Adam Harrison <adamdharrison@gmail.com>
(cherry picked from commit 7a4260600509e26337e67ce65ff3c66eec79d3b6)
2025-05-18 22:54:37 +08:00
Guldomanandtakase1121 f87617f829 fix: only allow backslash as path separator in Windows in common.path_suggest (#1976) 2024-12-04 13:02:07 +08:00
Takase 451bfacaf5 docview: prevent overscroll when DocView size is less than lh * 2 (#1971) 2024-12-04 13:02:06 +08:00
d436dfe9bf check item type before creating input text (#1904)
* check item type before creating input text

* Update data/plugins/treeview.lua

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

* Update data/plugins/treeview.lua

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

---------

Co-authored-by: FloppyDisco <joshuapaulpiasecki@gmail.com>
Co-authored-by: Takase <20792268+takase1121@users.noreply.github.com>
2024-12-04 13:02:06 +08:00
ThaCuberandtakase1121 9222136070 allow / for path suggestions in all OSes 2024-12-03 08:35:40 +08:00
Guldomanandtakase1121 f6fd438b08 Return state when tokenizing plaintext syntaxes 2024-12-02 15:21:52 +08:00
Takase 7c68b20115 feat(core.emptyview): add name to emptyview (#1569)
* feat(core.emptyview): add name to emptyview

* fix(core.emptyview): set filename to empty
2024-11-27 20:53:34 +08:00
Guldomanandtakase1121 ac4995ee46 Fix multi-type usage in delimited patterns (#1740)
In the "end" pattern we weren't considering the multiple types.
2024-11-27 20:53:34 +08:00
3114f2103e 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-11-27 20:53:33 +08:00
takase1121 cf40e254fe process: migrate arg validation and checking to Lua 2024-11-27 20:53:32 +08:00
Guldomanandtakase1121 8c66c5f493 treeview: remove unused code (#1895)
It caused a lot of useless `system.absolute_path` calls.
2024-11-25 21:29:05 +08:00
Adamandtakase1121 49a1ec32b8 Add keyboard shortcut to tooltips in ToolbarView (#1880) 2024-11-25 21:28:47 +08:00
aia29andtakase1121 4e3558322c add cuda 2024-11-25 21:03:11 +08:00
takase1121 4bfcd0d16e core/doc: fix wrong table index in Doc:merge_cursors
it was off by 1
2024-06-24 22:29:05 +08:00
Guldomanandtakase1121 71913e1b86 fix(doc): convert Doc:merge_cursors parameter from "selection index" to table index 2024-06-24 22:29:05 +08:00
takase1121 5ba8cfde6d core/rootview: fix dnd multiple folders into dock 2024-06-23 13:09:52 +08:00
Guldomanandtakase1121 52dd76add6 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:08:08 +08:00
fgelm01andtakase1121 9c7f1bede4 Handle static constexpr in language_cpp (#1806) 2024-06-23 10:08:08 +08:00
Takase ce70fcf5dd 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-23 10:08:08 +08:00
2f32806426 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-23 09:02:56 +08:00
fgelm01andtakase1121 2679ac9d83 Add support for binary integer literals. (#1819) 2024-06-23 09:02:56 +08:00
Takase a8e5941337 language_cpp: backport number highlighting from c (#1818) 2024-06-23 09:02:56 +08:00
ThaCuberandtakase1121 28edec36e8 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-23 09:02:55 +08:00
Guldomanandtakase1121 9fb5d299f9 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-23 09:02:46 +08:00
fgelm01andtakase1121 3d692cf5a6 Change co_wait to co_await in language_cpp (#1800)
The C++20 keyword is spelled `co_await`.
2024-06-21 08:06:53 +08:00
Guldomanandtakase1121 67202c7284 Skip patterns matching nothing in tokenizer (#1743)
These patterns cause infinite loops, so warn about them and skip them.
2024-04-15 09:02:17 +08:00
PerilousBookletandtakase1121 4299909cd3 Added Arduino syntax highlighting support alongside C++. (#1767) 2024-04-15 08:50:13 +08:00
PerilousBookletandtakase1121 48712a242d 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-04-15 08:49:40 +08:00
Guldomanandtakase1121 e053ea3ad2 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 17:22:34 +08:00
Aziz Mazouz Jaberandtakase1121 41e2939ea9 Add from symbol to support ESM (#1754) 2024-03-25 17:22:12 +08:00
Guldomanandtakase1121 ddf08de1d4 Fix language_js regex/comment distinction (#1731) 2024-03-23 20:28:31 +08:00
takase1121andGuldoman 48aa350a3e 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

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2024-03-23 20:27:47 +08:00
Guldomanandtakase1121 499124d8e3 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-23 20:26:43 +08:00
PerilousBookletandtakase1121 e568e4acdf Added .pyi extension to python. (#1728) 2024-03-23 20:26:43 +08:00
Takase bbc524ad82 language_js: support binary and octal representation (#1710) 2024-01-21 14:49:28 +08:00
vqnandtakase1121 a389adbaf5 autoreload docs only if their filename matches an actual file (#1698) 2024-01-21 14:48:56 +08:00
vqnandtakase1121 df12a5dde6 reorder nagview options on doc:save error to be more consistent with other nagview confirmations (#1696) 2024-01-21 14:48:44 +08:00
Fijiandtakase1121 e353c5322a 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-21 14:48:21 +08:00
vqnandtakase1121 2ce8c58bea 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-21 14:40:41 +08:00
vqnandtakase1121 9c21903af7 add autocompletion to multicursor (#1394)
* use Doc:remove
2023-12-29 08:47:21 +08:00
Adam Harrisonandtakase1121 1d4e01a192 Fixed a minor bug, should close issue #1680. 2023-12-29 08:47:21 +08:00
ThaCuberandtakase1121 f1bdd840a1 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-29 08:47:05 +08:00
Guldomanandtakase1121 8e2928aeb8 Improve font/color change detection in language_md (#1614)
* Delay setting font for custom `language_md` token types

* Improve font/color change detection in `language_md`
2023-11-30 11:45:58 +08:00