Commit Graph

432 Commits

Author SHA1 Message Date
Francesco Abbate 6e3cd41bd1 Logical test simplification in detectindent 2021-04-06 08:27:35 +02:00
Francesco Abbate 3721ace099 Fix logical error in on_text_change 2021-04-06 08:26:53 +02:00
Francesco Abbate e43c980e4a Simplifies previous commit
Restore the previous signature of raw_insert/remove
2021-04-06 08:18:35 +02:00
Francesco Abbate d1984942ea Add hook function for Doc changes 2021-04-05 00:11:56 +02:00
Takase 63b9cf223e
NagView improvements (#136)
Implement keyboard commands for the NagView.
2021-04-04 16:11:47 +02:00
Francesco Abbate 3b040aabc7 Implement unicode character replacements
Useful to draw whitespaces with alternate characters and colors
without slowing down the text rendering.

A new API is implemented. A renderer.replacements object can be created
to list the replacements.

In turns the function renderer.draw_text and draw_text_subpixel now accept
two optional arguments for replacements.
2021-04-01 18:05:59 +02:00
Francesco Abbate 15a4985065 Prepare release 1.16.5 2021-03-20 22:31:45 +01:00
Francesco Abbate 60fa7d07ba Prepare 1.16.4 release 2021-03-20 17:10:27 +01:00
Francesco Abbate f9115751b4 Minor simplification of animation rate adjustment 2021-03-20 17:00:43 +01:00
Francesco Abbate 7f50df6a2f Ensure plugin within a directory are loaded
Close #118
2021-03-20 16:34:00 +01:00
takase1121 5e8444b2b1 rename tooltip_alpha_step to tooltip_alpha_rate 2021-03-20 01:04:07 +00:00
takase1121 93753634f5 set delay to 0.5 and disable animation 2021-03-20 01:03:16 +00:00
takase1121 cdf5b9b9b8 show tooltips only when hovering over text 2021-03-20 00:57:06 +00:00
takase1121 d191e8ee34 prevent rendering tooltip when alpha is 0 2021-03-20 00:28:49 +00:00
Francesco Abbate 26ec9e5820 Compute animation rate only if needed 2021-03-18 16:20:21 +01:00
Takase 0bb7f21dd7
tooltip enhancements (#114)
Add a delay to show the tooltip and other improvements.
2021-03-18 16:18:36 +01:00
Francesco Abbate 04063ff47e Fix error introduced with commit c0ad86d 2021-03-18 15:46:44 +01:00
Francesco Abbate 88bec172a1 Fix problem with tab size and subpixel positioning
Solve github issue https://github.com/franko/lite-xl/issues/109
2021-03-18 13:54:33 +01:00
takase1121 1f97805321 normalize tooltip filename to home dir 2021-03-14 03:09:18 +00:00
Takase 13ebb51c38
add tooltips to treeview.lua (#100) 2021-03-13 16:44:40 +01:00
Takase c0ad86de8c
integrate NagView 2021-03-13 12:57:52 +01:00
liquidev 844ecd1f26
Make animation speed independent of config.fps, add config.animation_rate to fine-tune animation speed (#93)
* animation rate config field

* @franko's math magic to make it look more correct
2021-03-10 16:35:37 +01:00
liquidev 3af6af654b
more stylish tabs (#95) 2021-03-09 14:24:14 +01:00
Francesco Abbate b612357371 Bump new version number 2021-03-07 18:47:15 +01:00
Francesco Abbate baf5aebe1c Merge remote-tracking branch 'origin/master' into subpixel-font-positioning-fix 2021-03-07 12:25:53 +01:00
Francesco Abbate 23a053e1ee Ensure error and stack trace are written to stdout
To address https://github.com/franko/lite-xl/issues/87
2021-03-07 09:48:44 +01:00
Francesco Abbate 199476547b Fix error related to panes resize along y 2021-03-06 23:50:19 +01:00
Francesco Abbate 991db14877 Ensure filename are store relative to project directory 2021-03-06 23:49:20 +01:00
Francesco Abbate 5bf7abf23d Ensure filename are store relative to project directory 2021-03-06 23:36:05 +01:00
Francesco Abbate 087c8ba402 Fix error related to panes resize along y 2021-03-06 23:05:04 +01:00
Francesco Abbate 3426bc5d73 Introduce subpixel text positioning within rencache
In order to fix the issue with cursor positioning a subpixel-aware draw
text operation within rencache was required.

With this modification the cursor positioning problem is completely
resolved.

A new function renderer.draw_text_subpixel is introduced to perform
consecutive, inline, text drawings with subpixel accuracy.
2021-03-06 18:12:02 +01:00
Francesco Abbate 9ff6a0325e Mostly fix problem of offset with cursor positioning when using mouse
In order to get right the cursor position on text on mouse clicks it is
needed to take into account text's subpixel positioning.

This fix mostly corrects the problem but cursor positioning is still
somewhat inaccurate for long lines due to repeated commands to draw a text
along a line. Repeated draw text calls make the subpixel information
lost and small errors will add-up.
2021-03-06 16:18:24 +01:00
daubaris 0cb594aaf2
Enable customizing cursor speed (#80)
Addresses issue #65
2021-03-06 11:03:12 +01:00
Francesco Abbate aa1408c01f Do not assume doc.indent_info is present 2021-03-05 23:47:36 +01:00
Francesco Abbate 09332fe242 Fix problem with fatal error message
Previous implementation was broken.

Ensure the error file is always written and write its location in the error message
2021-03-05 23:46:41 +01:00
Francesco Abbate 877e4ac6e2 Bump new version 2021-03-05 11:33:29 +01:00
Francesco Abbate a4bc8986ff Implement fatal error message box
Used when lite-xl fails at startup
2021-03-05 10:33:50 +01:00
Francesco Abbate 3506ff47fc Fix problem with plugin loading
Introduced with PR https://github.com/franko/lite-xl/pull/73
2021-03-05 07:22:56 +01:00
Francesco Abbate de13762085 Show complete tab name when close butto is not there 2021-03-03 18:48:41 +01:00
liquidev 2e1a6ad5d1
Fix #30 – user plugins take priority over built-in plugins (#73)
user plugins should take priority over stock plugins
2021-03-03 12:20:22 +01:00
Francesco Abbate 8883685eea Fix font size in initial user's config 2021-03-01 09:48:12 +01:00
Francesco Abbate c0942bbde7 Use slightly larget font for UI 2021-02-28 23:44:35 +01:00
Francesco Abbate 75eadf4dc7 Simplifies logic for suggestion's offset 2021-02-28 23:24:19 +01:00
Francesco Abbate e46800347f Implement scrolling in command view 2021-02-28 19:52:38 +01:00
Francesco Abbate a35ef764a0 Show Lite XL instead of lite in window's title 2021-02-28 18:55:05 +01:00
Francesco Abbate 6c84913f6a Do not set window's title to unsaved for command view 2021-02-28 18:54:32 +01:00
Francesco Abbate bd2d8db231 Draw divider for inactive tabs 2021-02-27 23:56:11 +01:00
Francesco Abbate f708a53a04 Keep active view when closing inactive tabs 2021-02-27 23:55:36 +01:00
Francesco Abbate 4d320c1946 Ensure treeview is large enough to show toolbar 2021-02-27 19:39:56 +01:00
Francesco Abbate e861ea1d66 Ensure tab's text and close button don't overlaps 2021-02-27 17:19:47 +01:00
Francesco Abbate 4cda8fc122 Show tab close button when hovering inactive tabs 2021-02-27 15:29:18 +01:00
Francesco Abbate ca6d1843bc Implement close button for tabs 2021-02-27 13:53:52 +01:00
Francesco Abbate 0dc18de6bc Add information about icon_big_font in initial user's configuration 2021-02-27 12:13:51 +01:00
Francesco Abbate 4d734e933c Fix resize behavior of treeview and toolbar
Now toolbarview always compute up-to-date sizes and spacing to adapt to
changes in icon big font.

For treeview and toolbarview revert the goto_size approach to use the
original approach of rxi/lite. In order to make it work when user resizes
dragging the divider we use the view optional method set_target_size().
This latter changes the view's target size instead of changing its size
right away. The size is only changed by the lite's layout and animation
system.

Remove the config.treeview_size variable that was no longer working because
plugins are loaded before the user's config.
2021-02-27 12:13:11 +01:00
Francesco Abbate af0be4abf1 Update changelog and version 2021-02-25 09:37:06 +01:00
Francesco 0f789cd6a2
Merge pull request #63 from eugenpt/master
+js language regexp pattern
2021-02-24 20:21:44 +00:00
Francesco Abbate 94b99b658e Fix multi-line commands
When second position is at the beginning of a line do not include this latter.
2021-02-24 18:06:47 +01:00
Francesco Abbate cbb42d0028 Fix spacing in treeview
Previous setting was not okay with monospaced fonts
2021-02-24 17:50:34 +01:00
Francesco Abbate 351a772466 do not use 'portable' as a compile time option
Introduce the file core/start.lua to initialize applications variables
2021-02-24 16:29:39 +01:00
ep b616b55fd9 +js language regexp pattern 2021-02-24 12:24:43 +07:00
Francesco Abbate 22de3354ce Minor toobar tooltip adjustment 2021-02-21 12:57:42 +01:00
Francesco Abbate fc46946ea1 Fix the flashing tooltip issue 2021-02-21 11:09:51 +01:00
Francesco Abbate 2353076b37 Add config.transitions to enable/disable transitions 2021-02-21 11:08:25 +01:00
Francesco Abbate 7a35e7c217 Don't show partially hidden icons in toolbar 2021-02-21 09:43:47 +01:00
Francesco Abbate 5e0dee3e18 Fix indent spaces/tabs labeling 2021-02-20 22:56:52 +01:00
Francesco Abbate 22c9628def Fix missing info icon
Github issue: https://github.com/franko/lite-xl/issues/45
2021-02-20 20:15:09 +01:00
Francesco Abbate cf6332aebc Fix tooltip from ghost toolbar
Github issue: https://github.com/franko/lite-xl/issues/48
2021-02-20 20:14:24 +01:00
Francesco Abbate 054350263d Fix treeview missing clamp bug
Github issue: https://github.com/franko/lite-xl/issues/44
2021-02-20 20:13:25 +01:00
Francesco Abbate 4f2e38d41f Make code and ui font smaller at 12 2021-02-19 16:23:19 +01:00
Francesco Abbate 688dc1a7b8 Do not log every plugin load
Since we now load the user's module before the plugins\nwe avoid to log a line for each loaded plugin to not hide\nan eventual error in the user module
2021-02-19 16:12:56 +01:00
Francesco Abbate 68d9794926 Adjust default code font size
The previous value looks too big in hidpi screens
2021-02-19 16:10:57 +01:00
Francesco Abbate 76b463bd11 Create empty fonts directory in USERDIR 2021-02-19 16:10:02 +01:00
Francesco Abbate 0233941fe9 Bump version number 2021-02-19 13:54:10 +01:00
Francesco Abbate 2a0846b604 Automatic keep adjusting indent size
When too few lines keep adjusting indent size
2021-02-19 11:51:49 +01:00
Francesco Abbate ef24828307 Add toolbar tooltips 2021-02-19 11:50:20 +01:00
Francesco Abbate 335d704cab New fontello font smaller plus two new icons 2021-02-19 10:12:43 +01:00
Francesco Abbate e463ba8959 Add new toolbar buttons and tips 2021-02-19 10:08:45 +01:00
Francesco Abbate 6353fde609 Move user module loading before plugins
Otherwise the configuration to disable a plugin does not take effect.
2021-02-19 10:08:03 +01:00
Francesco Abbate 114f6b2481 Do not print error on standard output
Delayed error when passing invalid directory argument.
2021-02-19 09:29:46 +01:00
Francesco Abbate 6fcdafc5b6 Adjust line numbers for detect indent 2021-02-19 09:23:55 +01:00
Francesco Abbate ba68d6db24 Improve error handling for directory arguments 2021-02-19 00:15:55 +01:00
Francesco Abbate 52fb5afe34 Improve detectindent to skip comments 2021-02-18 10:10:06 +01:00
Francesco Abbate a2c4fdf649 Normalize global PATH from core.init 2021-02-18 09:02:57 +01:00
Francesco Abbate de1afb3391 Add full filename path in window's title
Optimal implementation to limite computations in core.step.
2021-02-18 00:26:19 +01:00
Francesco Abbate 59fbf9cfc0 Merge branch 'master' into dev 2021-02-17 23:57:02 +01:00
Francesco Abbate 9b27180267 Use doc on_save hooks to reload user module 2021-02-17 20:10:39 +01:00
Francesco Abbate 1ce1c114ba Fix reload module problem on windows 2021-02-17 19:20:00 +01:00
Francesco Abbate 6369a7f760 Use tilde expansion when running save-as command 2021-02-16 22:54:00 +01:00
Francesco 1decf67b64
Merge pull request #34 from budRich/user-module-auto-reload2
User module auto reload
2021-02-16 20:52:06 +00:00
bud 63b024cb81 FIX: Use PATHSEP instead of hardcoded "/" path separator 2021-02-16 19:25:40 +01:00
bud 4917be3daf remove config for window title format 2021-02-16 19:13:41 +01:00
bud 3693556958 FIX: get DocView in init instead of step, remove option for window title format' 2021-02-16 19:12:56 +01:00
Francesco Abbate 9fced84a7a Move VERSION variable into Lua code
To avoid recreating binaries if there are no changes
in the C side of the source code.
2021-02-16 14:35:02 +01:00
Francesco Abbate d18b90ad4f Restore original key binding for trreview toggle 2021-02-16 09:41:03 +01:00
bud dd30725d84 FIX: before setting full path to window title, make sure activeView is DocView 2021-02-15 22:38:29 +01:00
bud b9fcb6e5ae ADD: test in doc:save(), if the file is the user module, automatically reload config 2021-02-15 22:09:25 +01:00
bud cc9aa23340 REMOVE: dont add reload on save hook in core:open-user-module, its automatically done in doc:save() 2021-02-15 22:09:06 +01:00
bud 7e3eb4a408 ADD: default value (false) for full_path_in_window_title 2021-02-15 21:06:03 +01:00
bud 436446dd9a ADD: in core.step() show full path if view is a document and config.full_path_in_window_title is true 2021-02-15 21:05:06 +01:00
Francesco Abbate 680058547d Replace icons font with new fontello font 2021-02-15 15:49:33 +01:00
Francesco Abbate c20aff2307 Adding final details for toolbarview plugin 2021-02-15 15:45:56 +01:00
Francesco Abbate ebba21310b Fix treesize toggle command and transition 2021-02-15 12:18:43 +01:00
Francesco Abbate b836c2e1e6 Implement proper layout of toolbar 2021-02-15 00:36:39 +01:00
Francesco Abbate 5851a04098 Add hover and click functions for toolbar 2021-02-13 18:29:08 +01:00
Francesco Abbate 2765cbd92b Show a dummy toolbar
Does not do anything for the moment
2021-02-12 15:54:11 +01:00
Francesco Abbate 7137f88b4c Start working in toolbar 2021-02-11 18:37:34 +01:00
Francesco Abbate 9f0abd1a8b Show resize cursor only when panes are resizable 2021-02-11 17:15:27 +01:00
Francesco Abbate f482ea318a Makes resizable attribute explicit in Node:split() 2021-02-11 16:12:21 +01:00
Francesco Abbate c6a1323214 More accurate implementation for x and y axis 2021-02-11 11:53:53 +01:00
Francesco Abbate e69d201e1b First preliminary implementation of treeview resize
Works but only cover resize along x.
2021-02-09 18:41:32 +01:00
Francesco Abbate a8c810d801 Merge remote-tracking branch 'origin/master' into dev 2021-02-09 18:39:39 +01:00
Francesco Abbate 3d8cf22933 Fix error with previous commit 2021-02-05 15:36:48 +01:00
Francesco Abbate 03818d13fd Fix error when using relative dir argument 2021-02-03 07:39:35 +01:00
B14CK313 65c7f666aa
Fixed path returned by temp_filename not writeable
The path returned by temp_filename was not writeable on UNIX (and possibly other OS). This lead to the gitstatus plugin not working.
The proposed change fixes this by using the USERDIR variable instead of EXEDIR
2021-01-22 02:10:24 +01:00
Francesco Abbate c2cccf0173 Fix conflict in treeview for top directories
Happened if a filename has the same name of a top directory.

It will cause a collision in the string to identify the entry into the cache.
2021-01-19 16:40:00 +01:00
Francesco Abbate 9412b3f0d8 Do not add project path in files from project search 2021-01-13 17:09:35 +01:00
Francesco Abbate 08b010a2da Add command root:close-all 2021-01-13 16:51:42 +01:00
Francesco Abbate ef5e431a8b New feature to disable plugins from config
Disable trimwhitespace by default
2021-01-13 14:50:24 +01:00
Francesco Abbate fcf763fe9c Fix problem when project directory has a trailing slash 2021-01-10 12:56:15 +01:00
Francesco Abbate 7f9e4e4984 Do not error out when project directory is invalid 2021-01-10 11:50:15 +01:00
Francesco Abbate 9f0fa5121b Add keymap bindings for ctrl/shift insert commands 2021-01-06 15:16:43 +01:00
Francesco Abbate 773464eab8 Merge remote-tracking branch 'rxi/master' 2021-01-04 13:59:53 +01:00
Francesco Abbate 431bf68e72 Fix missing gome expand in remove-directory command 2021-01-03 23:52:02 +01:00
Francesco Abbate d85598ce17 Write workspace information in lite-xl config directory 2021-01-03 23:36:28 +01:00
Francesco Abbate 8d4ba0cb34 Fix behavior when selecting project directories 2021-01-03 15:35:35 +01:00
Francesco Abbate e548a6adb9 Fix directories management to always keep the project's directory 2021-01-03 12:02:07 +01:00
Francesco Abbate 850fcbf710 Add required normalize_path call 2020-12-31 12:32:41 +01:00
Francesco Abbate 2cdf674b97 Keep memory of window's size and position and restore them on start
Fix also a problem with directory path on windows.
2020-12-31 11:25:12 +01:00
Francesco Abbate 9e5bf485df Fix problem in workspace for relative directory 2020-12-31 09:09:21 +01:00
Francesco Abbate 0ff61a30e1 Lite XL modification to welcome screen 2020-12-30 16:15:57 +01:00
Francesco Abbate 77d65fb3a1 Add scrolling bar to TreeView 2020-12-30 16:15:33 +01:00
Francesco Abbate c3f5d2c144 Fix problems with project files and project directories
Now treat coherently the case when the project directory is removed from
the project directories.
2020-12-30 14:53:50 +01:00
Francesco Abbate 7280ae47ab Fix missing absolute_path call in change-project-folder command 2020-12-30 14:40:03 +01:00
Francesco Abbate b91a84eb56 Fix project change and quit versus workspace plugin 2020-12-30 14:31:36 +01:00
Francesco Abbate 0e263af3c6 Create common.serialize function 2020-12-30 13:32:25 +01:00
Francesco Abbate b0686bbe87 Remove mouse command to remove directory and remap create directory
Create directory is now re-mapped to control+(left click).
2020-12-30 12:00:51 +01:00
Francesco Abbate f2faddbec7 Add command to create a directory in a new category "files"
Use the alt + (left click) is tree view to create a directory and
shift + (middle click) to remove a project directory.
2020-12-30 11:52:26 +01:00
Francesco Abbate 08f36cda1f Add support for project directories in workspace plugin 2020-12-29 18:04:13 +01:00
Francesco Abbate b757f618f0 Import workspace plugin from franko/lite-plugins 2020-12-29 16:44:31 +01:00
Francesco Abbate b7168b5ebb Fix find in project problem with get_active_view 2020-12-28 23:35:52 +01:00
Francesco Abbate ddd56ec615 Add command to remove a directory from the project
In addition directories can be removed with a mouse middle-click in the
tree view pane.
2020-12-28 15:51:16 +01:00
Francesco Abbate c042bfc907 Change project files output to not include a prefix '/' in filename
It make sense to not put the initial '/' in the filename as the name
is relative to the top directory it belongs to.

By removing the the initial '/' in the filename we can re-introduce the
variable

core.project_files

to stay compatible with standard Lite. The project_files variable will
always point to the files table of the first entry of
core.project_directories.
2020-12-28 10:26:27 +01:00
Francesco Abbate 4e260cd03e Add a comment about a possible improvement 2020-12-27 18:33:34 +01:00
Francesco Abbate df74781da8 Fix project search and status view for new add directory feature 2020-12-27 18:28:21 +01:00
Francesco Abbate e4fa196b33 Finalize add project directory feature 2020-12-27 11:32:52 +01:00
Francesco Abbate 39181a56fd Use relative path for filenames in project directories 2020-12-27 09:47:58 +01:00
Francesco Abbate 5449781353 Minor cleanup to project directory stuff 2020-12-26 23:39:27 +01:00
Francesco Abbate 54518c438d Cosmetic changes to names from previous commit 2020-12-26 23:29:18 +01:00
Francesco Abbate ec730e9520 Test configuration with project_files stored separately for each directory 2020-12-26 21:22:57 +01:00
Francesco Abbate 2f50f21f57 Preliminary version of projects with multiple directories 2020-12-26 16:48:08 +01:00