Commit Graph
1385 Commits
Author SHA1 Message Date
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
Guldomanandtakase1121 9be5a46a22 Fix patterns starting with ^ in tokenizer (#1645)
Previously the "dirty" version of the pattern was used, which could 
result in trying to match with multiple `^`, which failed valid matches.
2023-11-30 11:39:55 +08:00
Guldomanandtakase1121 885e6b3c50 Fix language_js regex constant detection (#1581)
* Fix `language_js` regex constant detection

* Simplify regex constant detection in `language_js`

* Add more possessive quantifiers in `language_js` regex constant detection

This avoids more catastrophic backtracking cases.

* Allow `.` after regex constant in `language_js`
2023-11-30 11:39:48 +08:00
Guldomanandtakase1121 b1a647814f Fix editing after undo not clearing the change id (#1574) 2023-11-30 11:39:41 +08:00
Guldomanandtakase1121 8eacca7ae1 Fix selecting newlines with find-replace:select-add-{next,all} (#1608)
* Avoid adding existing selections in `select_add_next`

* Use the first available selection as delimiter in `select_add_next`

* Fix returning searches with newlines in `search.find`

* Fix repeat search when the last result spanned multiple lines
2023-11-30 11:39:27 +08:00
Guldomanandtakase1121 19cef97bcd 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-11-30 11:39:16 +08:00
Guldomanandtakase1121 5c5c77219b 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-11-30 09:20:34 +08:00
Guldomanandtakase1121 6cd1f96234 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-11-29 09:41:55 +08:00
Adamandtakase1121 3bf3266ca5 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-11-29 09:41:34 +08:00
Daniel Margaridoandtakase1121 35ef0a9484 Fixed issue with set_target_size passing the wrong value to plugins (#1657)
* Fixed issue with set_target_size passing the wrong value to plugins that are split on the right and activated from the settings UI.

* Added position awareness for the all resize_child_node calls.
2023-11-29 07:45:27 +08:00
Guldomanandtakase1121 01cab0611c Fix deleting indentation with multiple cursors (#1670) 2023-11-29 07:41:27 +08:00
Guldomanandtakase1121 fb7ed49a44 Avoid considering single spaces in detectindent (#1595) 2023-11-29 07:41:13 +08:00
TakaseandGuldoman 5d53b13cf4 fix(dirmonitor): deadlock if error handler jumps somewhere else (#1647)
* fix: deadlock if error handler jumps somewhere else

* docs(dirmonitor): fix wrong data type in error callback

* docs(dirmonitor): clarify coroutines and deadlocks

* docs(dirmonitor): wording

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

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-10-24 20:16:52 +08:00
Guldomanandtakase1121 4005a46144 Save in the workspace unsaved named files and crlf status (#1597)
* Save in the `workspace` unsaved named files

* Save in the `workspace` the `crlf` status and restore it for "new" files
2023-10-18 13:14:28 +08:00