Commit Graph

72 Commits

Author SHA1 Message Date
George Sokianos 6807a8e29a s when opening projects or changing paths. 2024-02-19 22:51:41 +00:00
George Sokianos 1be1c7fb0b More fixes with the relative paths 2024-02-19 00:56:45 +00:00
George Sokianos 7efe75fe7d More path fixes 2024-02-18 21:31:24 +00:00
George Sokianos 9c2eec9066 Added AmiUpdate support. Made a lot of changes in paths manipulation 2024-02-17 17:47:15 +00:00
George Sokianos 5c983f10b5 Merge branch 'master' into amiga2.1 2023-12-26 13:36:13 +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 9612f20685 Improve `common.serialize` (#1640)
* Make `common.serialize` more locale-independent

* Handle inf/nan numbers in `common.serialize`
2023-12-26 13:16:33 +00:00
Takase 691df348f0 Documentation for core.common (#1510)
* docs(core.common): add and improve documentation

* refactor(core.common): remove unused variable to get_height()

* docs(core.common): remove messy newlines

* docs(core.common): fix wording

* docs(core.common): use integer instead of number

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

* docs(core.common): update docs

the docs now follow the style in docs/ directory.
some of the changes suggested are also implemented.

* docs(core.common): fix typo

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

* docs(core.common): restyle annoatations

Extra whitespaces are removed and @overload is used whenever possible.

* docs(core.common): fix various documentation errors

* docs(core.common): simplify unicode description

* docs(core.common): fix return value

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

* docs(core.common): clarify common.bench for not being a benchmark

* docs(common): add disclaimer for numbers in common.serialize

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-08-07 15:26:49 +01:00
xwii 90a7882ed4 Use `table.move` to implement `common.splice` (#1324)
* Use `table.move` to implement `common.splice`

* Disallow negative `remove` in `common.splice`
2023-08-07 15:01:50 +01:00
Takase ac3630c2ea Documentation for core.common (#1510)
* docs(core.common): add and improve documentation

* refactor(core.common): remove unused variable to get_height()

* docs(core.common): remove messy newlines

* docs(core.common): fix wording

* docs(core.common): use integer instead of number

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

* docs(core.common): update docs

the docs now follow the style in docs/ directory.
some of the changes suggested are also implemented.

* docs(core.common): fix typo

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

* docs(core.common): restyle annoatations

Extra whitespaces are removed and @overload is used whenever possible.

* docs(core.common): fix various documentation errors

* docs(core.common): simplify unicode description

* docs(core.common): fix return value

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

* docs(core.common): clarify common.bench for not being a benchmark

* docs(common): add disclaimer for numbers in common.serialize

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-08-07 14:51:14 +01:00
xwii e4c5fceaf9 Use `table.move` to implement `common.splice` (#1324)
* Use `table.move` to implement `common.splice`

* Disallow negative `remove` in `common.splice`
2023-08-07 14:50:43 +01:00
George Sokianos 789004ea2c Updates and fixes for the latest available code, for 2.1 release 2022-10-10 19:06:19 +01:00
George Sokianos 2bdfd5a694 Merge branch 'master' into amiga-2.0 2022-09-26 17:27:35 +01:00
George Sokianos 98711e1cb5 Fixes with paths to avoid crashes and now the partition folders are shown in suggestions 2022-09-26 14:21:51 +01:00
Guldoman 4c186b07a3
Be more lenient with appending `PATHSEP` in `common.path_suggest` in Windows
This allows to use the Unix separator without resulting in ugly 
suggestions that added the Windows separator too.

For example:
Before: `data/` -> `data/\core\`
After: `data/` -> `data/core\`
2022-08-17 00:11:19 +02:00
Guldoman e8ca861512
Remove final `PATHSEP` in `common.normalize_volume` 2022-08-16 23:53:03 +02:00
Guldoman a4355c6536
Add `PATHSEP` before listing the directory in `common.path_suggest`
Before, in Windows, listing `.` instead of `.\` resulted in unexpected 
results.
2022-08-16 23:51:12 +02:00
Guldoman 4b4c54ba65
Remove dot slash from suggested paths in `common.path_suggest`
When no `root` is specified and the initial `path` is empty, the initial 
`path` becomes `.`.
This results in returned files/dirs that are prepended with `./`.

Now, in that case, `./` is removed.
2022-08-16 08:08:04 +02:00
George Sokianos 69bd81188b Merged MOS and OS4 code. Did some more fixes before the 2.0.3r2 release. 2022-06-18 18:17:07 +01:00
Jefferson González 92c6f1c04f
Merge pull request #1021 from Guldoman/PR_lax_common_merge
Make `common.merge` work with invalid arguments
2022-06-07 20:05:22 -04:00
Guldoman 0b96be7af2
Make `common.merge` work with invalid arguments
This is needed because users could try to enable plugins with 
`config.plugins.plugin_name = true`.
Before, this would result in `common.merge` throwing an error; now it 
just returns a copy of the "base" table.
2022-06-05 04:10:51 +02:00
Guldoman 295e6b7e5a
Allow `common.path_suggest` to specify a root directory
This will make relative paths start from `root`.
2022-06-01 06:57:38 +02:00
Guldoman 9a428648a9
Add `common.is_absolute_path` 2022-06-01 04:42:50 +02:00
Guldoman f8622efc01
Add pretty printing to `common.serialize` 2022-05-03 06:28:34 +02:00
Dheisom Gomes 13adedb23a Go back to `common.match_pattern` and use `table.unpack` directly on function `core.add_thread` 2022-01-28 18:30:19 -03:00
Dheisom Gomes 6331a23c6b Added support to use a array of regex to ignore files 2022-01-28 12:02:30 -03:00
Adam Harrison 456126400a Added in new merge method, and run it on plugins. Also made it so plugin configs can be set anywhere, even if we don't know the plugin beforehand. 2022-01-22 18:39:23 -05:00
Jan200101 99ddf1fb92
Migrate to Lua 5.4 2021-12-31 13:53:01 +01:00
Jipok 941b283681 Support rgba hex format 2021-12-20 23:54:03 +05:00
Francesco 6f732f67f9
Merge pull request #612 from Guldoman/fix_regex
Fix regex in tokenizer
2021-10-22 21:44:44 +02:00
Francesco Abbate f18ac849fb Fix error introduced with 43fc35d7 2021-10-21 23:18:31 +02:00
Francesco Abbate 9c52c420c5 Do not use normalize_path when not needed 2021-10-21 23:18:31 +02:00
Francesco Abbate f472c24c73 First attempt to treat correctly network volumes
On windows paths belonging to network volumes will be gives like:

\\address\share-name\path

Now the code recognize these paths and treat them correctly.
2021-10-21 23:18:31 +02:00
Guldoman 3a71528087
Allow specifying offset for `common.is_utf8_cont` 2021-10-11 22:18:02 +02:00
Guldoman dced6da03d Implement tab drag and drop 2021-10-02 18:36:59 +02:00
Francesco Abbate 3cc4cd1ada Fix error when opening root directory 2021-09-07 05:09:26 -07:00
Adam Harrison e2a7578553 If multiple '..' handle correctly. 2021-08-11 20:54:03 -04:00
Adam Harrison 5e66f74f38 Handle proper path normalization if we begin with '..'. 2021-08-11 19:19:58 -04:00
Adam 47eaca18d8
Merge branch 'master' into Merged 2021-08-01 14:58:36 -04:00
ep af22a6a824 +readability, hopefully 2021-07-26 03:50:57 -07:00
ep 2df363747b fix workspace folders on different drives in Windows 2021-07-26 03:50:57 -07:00
Adam Harrison c461cfae93 Removed unecessary duplicates. 2021-07-20 14:50:40 -04:00
Adam Harrison 0777a6f0b8 Merged dev to master. 2021-07-20 14:39:50 -04:00
Francesco Abbate 265501bb9e Fix problem with previous commit
Desastrous problem where core.normalize_path was removing the leading /.
2021-07-15 18:01:18 -04:00
Francesco Abbate e1530c0951 Remove duplicate normalize_path function
Use the function defined in the "common" module.

Move the check for not-nil filename from common.normalize_path
to core.open_doc. In this latter the filename can be nil if a
new unnamed document is created.
2021-07-15 18:01:17 -04:00
jgmdev 4188269cef Added system.rmdir(path)
It is reported that the built-in lua function os.remove(path) does
not removes empty directories on windows. To fix this a system.rmdir
function is introduced that calls a native win32 function.

Also common.rm(path, recursively) was added which wraps system.rmdir()
to easily delete an entire folder with all its contents.
2021-06-28 11:07:27 -04:00
Adam Harrison b42708fe56 Cleaned up functions. 2021-06-18 17:33:55 -04:00
jgmdev e070dbebc1 Fix undeclared NagView findindex() by moving it to common. 2021-06-13 21:28:29 -04:00
Francesco 98164f6d4f
Integrate mkdirp function in common module (#265)
Move the function mkdirp into common to be generally available.

Use the new common.mkdirp from create_user_directory() from
core/init.lua replacing previous parent directory creation code
within the function.

The previous mkdirp function did not work on Windows where
absolute paths starts with a drive letter. The code from
create_user_directory() did not have this problem but was wrong
in the way it was creating the nested directories.

The new implementation in common.mkdirp fix both problems.
2021-06-13 19:50:42 +02:00
Francesco Abbate f17f5a4d6d Fix problem with filenames missing normalization 2021-05-24 15:58:49 +02:00