Commit Graph

2407 Commits

Author SHA1 Message Date
Adam 2035886fcd
Added in ability to specify prefix via env variable. (#1388) 2023-02-15 21:48:09 -04:00
vqn a07a4e3706
fix incorrect x_offset if opened docs have different tab sizes (#1383) 2023-02-09 13:26:32 -04:00
Adam 8bf47ec172
Fixed up some post 5.1/jit Symbols (#1385)
* Updated k functions to have appropriate method signatures for 5.3 and up.

* Fixed up some inconsistent signatures that I forgot.
2023-02-09 12:55:47 -04:00
Guldoman 195520ea12
Make tab scrolling more flexible (#1384)
* Add `Object:{is_class_of,is_extended_by}` to check inverse relationships

* Make tab scrolling more flexible

This adds tab scrolling commands and connects them to mouse scroll
events.
This way scrolling behavior can be customized more easily.

For example an alternative behavior could be:
```lua
keymap.add({
  ["wheelup"] = "root:switch-to-hovered-previous-tab",
  ["wheeldown"] = "root:switch-to-hovered-next-tab"
})
```
2023-02-09 12:51:41 -04:00
jgmdev 02a99b17fe Correct the inverted tabs scrolling 2023-02-06 15:44:19 -04:00
Eric Gaudet a2acc6d770
Make mouse scrollwheel hovering tabs scroll the tab bar (#1314) 2023-02-06 15:40:04 -04:00
Guldoman 841a456106
Allow groups to be used in end delimiter patterns in tokenizer (#1317)
* Allow empty groups as first match in tokenizer
* Avoid pushing tokens with empty strings
* Allow groups to be used in end delimiter in tokenizer
* Use the first entry of the type table for the middle part of a subsyntax
This applies to delimited matches with a table for `type` and without a 
`syntax` field.
* Match only once if using `at_start` in tokenizer `find_text`
* Check if match is escaped in the "close" case too
Also allow continuing matching if the match was escaped.
2023-02-06 15:24:40 -04:00
Guldoman c6d269d35e
Improve `DocView:get_visible_line_range` precision (#1382) 2023-02-06 14:03:29 -04:00
Jefferson González 0495ac28a6
plugins scale: also rescale style.expanded_scrollbar_size (#1380) 2023-02-06 13:40:12 -04:00
Jefferson González d784133777
NagView: properly rescale on scale change (#1379)
* drop font option since style.font is always used
2023-02-06 13:38:00 -04:00
Jefferson González e800a5de3c
Restore in-selection replace as discussed in #1331 (#1368) 2023-02-06 13:34:59 -04:00
Jefferson González 5b2538e856
Improved plugins config table handling (#1356)
* Warns user if trying to disable a plugin that is already
  enabled when doing `config.plugins.plugin_name = false` and also
  prevents replacing the current plugin config table with the false
  value to mitigate runtime issues.
* Uses a merge strategy by default when assigning a table to a plugin
  config to prevent a user from removing a plugin default config values
  as experienced and explained on this issue lite-xl-plugins#158
* This change is basically backwards compatible, but will require a
  change on the settings ui plugin on how it checks for already
  enabled plugins, since rawget will no longer be a working hack
  or workaround for this.
* As suggested by Adam dropped loaded key and switched to package.loaded
2023-02-06 13:32:44 -04:00
Guldoman 2e02aede7c
Make mod-version follow semver (#1036)
* Make mod-version follow semver
  Now plugins can optionally specify the minor and patch version they 
support.
  If no minor or patch version is specified, it's considered 0.
  Plugins are only loaded if they have the same major version and a 
  smaller or equal minor+patch version.
* Add modversion to logging and plugin mismatch nagview

---------

Co-authored-by: Jefferson González <jgmdev@gmail.com>
2023-02-01 20:28:21 -04:00
Takase 9d7a9ac564
fix: exec() error not returned to parent (#1363)
* fix: exec() error not returned to parent

* chore: remove accidental lua.h inclusion
2023-01-31 17:26:15 -05:00
vqn d207adc230
Context menu fixes and keyboard navigation (#1338)
* fix Doc contextmenu not registering commands if scale plugin is not found
* fix TreeView contextmenu commands not working if the mouse hovers DocView
* add keyboard navigation to TreeView contextmenu
* fix incorrect contextmenu predicate
2023-01-30 13:36:17 -04:00
Himura Kazuto 0a0754d1c3
Replace globally when replacing from selection (#1331) 2023-01-30 13:00:48 -04:00
sammyette 719540e73d
feat: add option to only draw whitespace if it is within selection (#1312)
* refactor: remove sort_positions usage
* refactor: move draw conditional to has_any_selection and other changes
  - snake case (sssss)
  - break after finding selection
* fix: typo of config plugins
* fix: do check for show selected only properly
* feat: only draw within selection per substitution
* `drawwhitespace`: Make `show_selected_only` work properly

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
2023-01-30 12:43:26 -04:00
Adam ad272fce53
Abstracted open_doc out to allow for more easy overriding. (#1344) 2023-01-30 12:12:44 -04:00
Adam 813b8b278b
Getting rid of annoying forward slash on windows. (#1345) 2023-01-30 12:10:11 -04:00
jgmdev 8aa97291fe gh workflow: fix path to macOS arm64 cross file 2023-01-25 17:28:34 -04:00
Jefferson González 2cd537342c
ci: fix msys build now requiring ca-certificates (#1348)
Thanks to Guldoman who discovered the cause for meson failing to
validate SSL certificates which turned out to be MSYS now requiring
ca-certificates package installed for the different architectures.
2023-01-24 15:25:56 -04:00
Jan 36cb0e6425
pass RenWindow by argument (#1321)
* pass RenWindow to all renderer functions that need it

* pass RenWindow to all rencache functions that need it
2023-01-21 22:11:42 -05:00
Velosofy 89c0c76dd4
Add "Open with Lite XL" to windows' context menu (#1333)
Closes #423
2023-01-19 19:46:19 -05:00
Adam Harrison 9a7c442727 Added missing header declaration. 2023-01-19 19:28:14 -05:00
Jefferson González aa20159eb1
plugin api: allow usage on multiple source files (#1335)
As discussed with Adam on discord current Lite XL Lua Plugin API was not
working on native plugins with more than 1 source file since imported
symbols were not exposed to other unit files. The issue was tackled on #1332
but the solution introduced another issue when Lite XL was dynamically
linked to the system lua. So we opted to tackle this by using function
wrappers around the function pointers.
2023-01-19 19:27:23 -05:00
Adam aa627d4023
Added in Config Postload (#1336)
* Added in an `onload` variable to configs which is called by the plugin loader.

* Used appropriate parameter.

* Fixed tabbing.
2023-01-19 10:14:45 -05:00
Guldoman 9308dfdd66
Avoid drawing hidden text in `DocView:draw_line_text` (#1298)
* Stop drawing text past the `DocView` edge in `DocView:draw_line_text`

* Don't add draw commands if they fall outside the latest clip

The check was previously done with the window rect, so this will reduce 
a bit more the number of commands sent.
2023-01-18 22:15:26 -05:00
Jan 7dae15d711
remove static libgcc from meson (#1290) 2023-01-18 20:43:48 -05:00
Adam Harrison 283ee8520a Updated dummy method signature to match prototypes. 2023-01-13 16:31:28 -05:00
Guldoman b89dedf566
Make empty groups in `regex.gmatch` return their offset (#1325)
This makes `regex.gmatch` behave like `string.gmatch`.
2023-01-13 19:34:09 +01:00
xwii 6e04a4f970
Use `table.move` to implement `common.splice` (#1324)
* Use `table.move` to implement `common.splice`

* Disallow negative `remove` in `common.splice`
2023-01-13 19:33:13 +01:00
Merlin Volkmer 673c564e09
language_md: add nix code block highlighting (#1323) 2023-01-12 15:12:55 +01:00
adityaraj f9933ed621
Create Renderer Only When It Doesn't Exist (#1315) 2023-01-11 18:53:23 -05:00
Jan bebef68d97
replace uses of SDL_Window with RenWindow (#1319)
Since Renwindow contains our instance of SDL_Window we can use this
to simplify future logic to create separate window instances
2023-01-11 18:25:06 -05:00
Takase 81776b1c19
Reorganize resources/ + wasm target (#1244)
* add README.md to resources directory
* add cross/ directory for meson cross files
* fix readme list syntax error
* fix reflink
* disable ASYNCIFY_ADVISE by default
* use executable names instead of hardcoding paths
2023-01-09 17:50:26 -04:00
jgmdev d6600b1ea3 packaging: use master branch for plugin addons 2023-01-08 02:32:31 -04:00
sammyette 1504ad7f4c
fix: center title and version in emptyview (#1311)
* fix: divide by amount of lines
2023-01-06 15:27:05 -04:00
Jan aa503665e0
defer lua error until after cleanup (#1310) 2023-01-06 14:31:44 -04:00
Jefferson González da524a3c46
plugin api: added missing luaL_typeerror (#1313) 2023-01-06 14:22:55 -04:00
jgmdev 7eb75b1a19 Packaging Scripts: updated widgets install location 2023-01-06 11:43:14 -04:00
Guldoman 385ee69f94
`linewrapping`: Disable horizontal scrolling when enabled (#1309) 2023-01-05 16:02:12 -05:00
Julien Voisin 6c6e5e9b99
Handle readlink errors (#1292) 2023-01-05 15:59:45 -05:00
Guldoman 72c0ad768e
Make `dirwatch` sorting compatible with what `file_bisect` expects (#1300)
The result of `a.filename < b.filename` is sometimes different from 
`system.path_compare(a.filename, a.type, b.filename, b.type)` which 
causes issues to `file_bisect`, as it expects the sorting to be done 
with `system.path_compare`.
2023-01-05 15:59:15 -05:00
Julien Voisin b3937b0380
Don't set a value twice (#1306) 2023-01-05 15:48:49 -05:00
Julien Voisin 7133ea5419
Fix a memory leak (#1305)
`font` was not freed upon error.
2023-01-05 15:48:01 -05:00
Julien Voisin 81b8747d80
Make api_require's nodes const (#1296) 2023-01-05 15:46:26 -05:00
Takase b7e9ca6585
do not allow users to create an empty font group (#1303) 2023-01-04 16:46:08 +01:00
Guldoman 2638e9636b
Allow command buffer to be expanded (#1297) 2023-01-01 21:12:14 -05:00
Dave 4e272c33de Minor typos in init text 2022-12-30 13:32:20 +01:00
Jefferson González 3491eb464d
Bump version to 2.1.1 (#1284)
* updated wraps
* updated release date
2022-12-28 22:03:36 -04:00