Commit Graph

952 Commits

Author SHA1 Message Date
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
Jefferson González f07b62f852
Merge pull request #1100 from Guldoman/PR_fix_path_suggest
Remove dot slash from suggested paths in `common.path_suggest`
2022-08-17 13:59:19 -04: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 6aa96556c0
Replace `assert` with `core.log_quiet` on command replace
This caused issues when saving the user module with commands defined
inside it, as it resulted in the user-defined commands trying to
overwrite themselves and failing.
2022-08-16 22:18:50 +02:00
Guldoman d944bd85ec
Add predicate memoization to `command.get_all_valid` 2022-08-16 22:13:25 +02:00
Guldoman cf29a6a45f
Allow command predicates to manage parameters passed to the commands
When a command is performed with parameters, those are now passed to the
predicate.
The predicate can then return, after the validity boolean, any other
value that will then be passed to the actual command.
If the predicate only returns the validity boolean, the original
parameters are passed through to the actual command.

This allows predicates to manipulate the received parameters, and allows
them to pass the result of an expensive computation to the actual
command, which won't have to recalculate it.

String and table predicates will now also return `core.active_view`.
2022-08-16 22:13:16 +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
Adam 6ccc5f6dde
Steps to generalize toolbar and treeview. (#1088) 2022-08-09 14:53:30 -04:00
Guldoman 4db71836af
Clear default Lua require path (#1085)
This is mainly done to avoid requiring from the current working 
directory of the editor.

This also avoids requiring from system paths, as it was already the case 
for the native modules search path.
2022-08-03 11:13:26 -04:00
ian` 2667f9476b
Fix "hard" indent column info on status view. (#1078)
* Fix "hard" indent column info on status view.

* Update tabs calculation and add "byte" number info

* Add config.show_char_byte_info

* Add show char byte toggle command.

it should be added on the commands/statusbar.lua, but there is no config module loaded before and i won't to add it.

* Update config.lua

* Update statusview.lua
2022-07-22 19:01:54 +02:00
Jefferson González e4bef5c5b6
Merge pull request #1080 from jgmdev/PR/fix-commandview-caret
CommandView: do not change caret size with config.line_height
2022-07-17 12:29:52 -04:00
jgmdev c7781a76a9 CommandView: do not change caret size with config.line_height 2022-07-15 11:27:27 -04:00
cisoun 366cadf605
Add font style options in user module 2022-07-15 12:05:59 +02:00
Jefferson González 86d45458f8
Merge pull request #1070 from Guldoman/PR_get_selections_swap_return
Make `Doc:get_selection[s]` return if the selection was actually sorted
2022-07-13 11:13:43 -04:00
Guldoman 9cfa3ecd56
Make `StatusView:add_item` accept a table 2022-07-13 07:22:42 +02:00
Guldoman 693bd11b22
Don't wrap around if there are no suggestions in `CommandView` 2022-07-11 23:28:08 +02:00
Guldoman e7c4bdfe8e
Make `Doc:get_selection[s]` return if the selection was actually sorted 2022-07-11 05:39:55 +02:00
Jefferson González e646f2fb28
Merge pull request #1065 from Guldoman/PR_log_size
Increase `config.max_log_items`, add a scrollbar and optimize `LogView`
2022-07-05 18:07:33 -04:00
Jefferson González f611556f1a
Merge pull request #1062 from Guldoman/PR_fix_logview_on_error
Fix opening `LogView` when reloading customizations
2022-07-05 18:00:56 -04:00
Jefferson González 58336f6060
Merge pull request #1060 from Guldoman/PR_drag_whitespace_newline
On `doc:newline` remove line content if it contains only whitespace
2022-07-05 17:56:13 -04:00
Guldoman 7888bf08e9
`LogView`: Show scrollbar 2022-07-01 05:29:55 +02:00
Guldoman b84a510d42
Increase default maximum number of log items
The low number in some cases resulted in hidden errors.
2022-07-01 05:29:54 +02:00
Guldoman caf106be1d
`LogView`: Don't draw invisible items 2022-07-01 05:29:45 +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
Guldoman c792b13666
On `doc:newline` remove line content if it contains only whitespace 2022-06-25 03:57:47 +02:00
Guldoman d6ce9e1ac6
Don't indent empty lines in a selection 2022-06-25 03:32:47 +02:00
Guldoman 9cd47aa12e
Fix full line cut when only a single line remains 2022-06-24 05:49:20 +02:00
Chris 1e91080680
Improve `lineguide` plugin (#1056)
* Add more options to lineguide
* Allow lineguide plugin to load but remain disabled
* Use config.line_limit for default ruler
2022-06-23 15:24:57 -04:00
Guldoman ec0e3018a8
`findreplace`: Sort last searches 2022-06-23 05:16:47 +02:00
Jefferson González 880e6e4f0f
Merge pull request #1040 from Guldoman/PR_tokenizer_errors_alert
Add more tokenizer errors/warnings
2022-06-22 19:43:51 -04:00
Guldoman 522d8a8094
`findreplace`: Fix number of total replacements 2022-06-23 00:16:16 +02:00
jgmdev 665c2cdd4d CommandView: improve performance by only drawing visible 2022-06-20 10:01:28 -04:00
Jefferson González 380cfb9a24
Merge pull request #1030 from Guldoman/PR_cache_draw_whitespace
`drawwhitespace`: Cache whitespace location
2022-06-15 21:08:09 -04:00
Jefferson González d2fd5c9df7
Merge pull request #1034 from Guldoman/PR_escape_start_patterns
Check if "open" pattern is escaped
2022-06-15 16:51:34 -04:00
Guldoman d169619f69
Warn if token type is a table when not needed 2022-06-15 21:31:16 +02:00
Guldoman 2e37e85a48
Add helper function to report bad patterns in tokenizer 2022-06-15 21:28:46 +02:00
Guldoman 5027a0f12b
Fix malformed pattern check for group patterns in tokenizer
If the token type was a simple string (and not a table), the size of the 
string was used instead of `1`.
2022-06-15 19:33:58 +02:00
Guldoman 5b6b48320f
Check if "open" pattern is escaped
Previously this check was only done for "close" patterns.
2022-06-12 04:19:05 +02:00
Guldoman c947e8a4d1
Convert more byte offsets to utf-8 pos in regex tokenizer 2022-06-12 02:55:36 +02:00
Guldoman 685956cbdb
Add `Highlighter:update_notify` to keep track of retokenized lines
This is helpful for plugins that need to know when a line has been 
retokenized.
2022-06-11 06:21:55 +02:00
Guldoman 99d328cfd7
Downgrade `StatusView:get_items` deprecation message to warning 2022-06-11 05:13:37 +02:00
jgmdev 3f206db69a initial documentation for better code completion 2022-06-07 22:09:34 -04:00
Jefferson González ff641cdb06
Merge pull request #1022 from Guldoman/PR_annoy_on_reload_error
Open `LogView` on user/project module reload error
2022-06-07 20:06:56 -04: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
Jefferson González 439c27447f
Merge branch 'master' into PR_commandview_options2 2022-06-07 19:03:55 -04:00
Jefferson González 2fc20330a3
Merge pull request #1010 from Guldoman/PR_improve_multiproject_treeview
`TreeView` improvements for multi-project
2022-06-07 18:24:54 -04:00
Guldoman 237f0c91cb
Open `LogView` on user/project module reload error 2022-06-05 04:29:24 +02: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