Commit Graph

1165 Commits

Author SHA1 Message Date
Francesco Abbate 719839d299 Add a limit for very slow filesystems
When adding a directory in a project we check if the filesystem is too
slow. If it is too slow we act as if the projects was files-limited by
the number of files but we show a specific warning.

This solution is not perfect but for very low filesystem it can limit
the problem. Otherwise the application would be totally irresponsive.
2021-10-21 11:07:37 +02:00
Francesco Abbate 1794765f07 Fix problem with treeview keeping the editor busy
Fix a problem introduced when fixing the dirty pixel problem, commit
cb08c5c. The node, when determining the layout was rounding the size
of the fixed-size view. In turns this latter was calling move_towards
to the default_size it wanted. If default_size was non-integer the
value vas never archieved because it was rounded during layout and
move_towars was keeping the editor busy by setting the
core.need_redraw flag.
2021-10-14 09:13:06 +02:00
Francesco Abbate bed103b7a6 Fix error introduced with 43fc35d7 2021-10-12 22:19:24 +02:00
Francesco Abbate 80db3cb027 Fix problem with treeview x resizing
The x size of the treeview plugin cannot really change expect if explicitly
resized.

The call to move_towards for x seems to raise a state where core.redraw is
always set to true and this prevent the application to go idle.

It is seen after the introduction of the dmon directory monitoring but it
is not clear why it wasn't seen before.
2021-10-12 18:06:00 +02:00
Francesco Abbate a0f4ac93e1 Do not use normalize_path when not needed 2021-10-12 16:08:06 +02:00
Francesco Abbate 43fc35d7dc 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-12 14:28:28 +02:00
Francesco Abbate 0d2166c9ce Correct Node's clipping rectangle
Fixing the Node's clipping rectangle make the clipping in DocView:draw()
partially redundant. This latter is now no longer needed to clip
on the right when drawing the document's lines but it still serves to
the purpose of clipping on the left, before the gutter region.
2021-10-11 09:25:38 +02:00
Francesco Abbate 8b634daa66 Use rounded value for node's size when splitting
Rouding node's size to an integer value ensure drawing are pixel
perfect in sizing.
2021-10-10 21:48:16 +02:00
Francesco Abbate c7aa3ebe01 Fix clipping error in docview 2021-10-10 21:44:16 +02:00
Francesco Abbate 0f8d7f3202 Do no add rencache a command for empty rectangles 2021-10-10 14:58:51 +02:00
Francesco Abbate cb08c5cbb7 Fix dirty pixels problem on window's right side
The last column of pixel on the window's right side isn't correctly
drawn and pixels appear dirty and more noticeably when the a NagView
message was previously shown, a stripe of red pixels remains on the right.

We use now a more souding roundig scheme. Now the rectangles to clip or to
draw are passed around as Lua numbers without any rounding. In turns, when
the rect coordinates are passed to the renderer we ensure the border of the
rect are correctly snapped to the pixel's grid. It works by computing the
coordinates of the edges, round them to integers and then compute the rect's
width based on the rounded coordinates values.
2021-10-10 14:52:55 +02:00
Francesco c179f909e2
Merge pull request #520 from Guldoman/select_previous
Add reverse search and some related commands
2021-10-10 10:01:55 +02:00
Guldoman 3a1274fd08
Merge reverse find functions for lua patterns and regexes 2021-10-10 01:11:41 +02:00
Guldoman cfe0c79a04
Simplify reverse search
Remove `plain_rfind` optimization.
2021-10-10 01:11:40 +02:00
Guldoman af925d603b
Fix `doc` selection in `findreplace`
Use `last_view` if `active_view` is `CommandView`.
2021-10-10 01:11:40 +02:00
Guldoman 1976facaf1
Use reverse search for `find-replace:previous-find` 2021-10-10 01:11:38 +02:00
Guldoman e7be9652c9
Add `find-replace:select-previous` 2021-10-10 01:10:52 +02:00
Guldoman 56eace627a
Add reverse option to `search.find` 2021-10-10 01:10:47 +02:00
Francesco Abbate a99dd947ed Add missing meson file 2021-10-09 14:37:33 +02:00
Francesco Abbate 7dd5699c96 Use dmon events in reload plugin 2021-10-08 23:15:25 +02:00
Francesco Abbate 911a3cee08 Report dmon modify events 2021-10-08 23:13:50 +02:00
Francesco Abbate a9f6f01ed0 Move dmon files into lib/dmon 2021-10-08 22:10:17 +02:00
Francesco Abbate bba42adc73 Adopt new version of dmon 2021-10-08 21:55:43 +02:00
Francesco Abbate 9c43727ebc Implement directory monitoring using septag/dmon
Use a notification based directory monitoring based on the
septag/dmon lirbary instead of periodically rescan the whole
project's tree.
2021-10-08 21:31:22 +02:00
Francesco Abbate 92362586df Improve highlither for document edits
The syntax highlighter keep a cache of the documents like tokenization.

In order to minimize the amount of tokenize re-computations we insert some
emtty lines or remove some lines in the highlither lines corresponding to
the lines added or removed to the document.
2021-10-08 21:28:27 +02:00
Francesco Abbate 7a435a568a Fix error in incremental syntax highlighter
In the highlither thread We should accept a previously generated line tokenization
past first_invalid_line only if the text is the same. The text can change because of
insert or remove operations.

Close #573.
2021-10-08 21:27:57 +02:00
Francesco 9fb166d3cc
Merge pull request #575 from Guldoman/sanitize_selection_redo
Sanitize selections after redo
2021-10-02 22:16:30 +02:00
Guldoman db3643653e
Sanitize selections after redo 2021-10-02 22:03:52 +02:00
Francesco Abbate 3589031579 Bump version number 2021-10-02 18:44:27 +02:00
Francesco Abbate 72c950338c Enable always show tabs by default 2021-10-02 18:44:05 +02:00
Guldoman 20ddbd6e9f Load project module on project change (#571) 2021-10-02 18:39:23 +02:00
Guldoman 57bfb67f6a Add option to disable caret blinking (#572) 2021-10-02 18:39:23 +02:00
Guldoman 468229e4d0 Small cleanup of `scale` plugin 2021-10-02 18:39:23 +02:00
Guldoman f6b9d9ab67 Add option to disable scrolling past the end (#566) 2021-10-02 18:39:22 +02:00
Rongfei Wang b0b3485152 Remove duplicate command declaration (#565) 2021-10-02 18:39:22 +02:00
Jean-André Santoni 0b4d1e2bce Fix the size and blurriness of the icon on OSX (#553)
* Fix the size and blurriness of the icon on OSX

* Don't nest ifndef

* Fix
2021-10-02 18:39:22 +02:00
Not-a-web-Developer a97a3d80da fixed the build link in readme.md 2021-10-02 18:39:21 +02:00
Adam 6aa316e3c3 Rearranged DPI calc so that on calc failure, returns 1. (#547) 2021-10-02 18:39:21 +02:00
Adam ed3ea35ed5 Potentially fixing issue with cache not invalidating on restart. (#548) 2021-10-02 18:39:21 +02:00
Adam Harrison 291616df3f Removed extra macros, used PLATFORM. Also removed MACOS, as it's redundant C code that's already encapsulated within PLATFORM. 2021-10-02 18:39:03 +02:00
Francesco Abbate 34983668d8 Normalize to project dir in treeview open
When left-clicking in a TreeView file we use now
core.normalize_to_project_dir to normalize correctly
the file name.
2021-10-02 18:37:01 +02:00
Francesco Abbate d067cc8577 Scale custom syntax fonts for scale plugin
Close #539.
2021-10-02 18:37:01 +02:00
Francesco Abbate 48475c70a0 Avoid unnecessary call to SDL_GetModState 2021-10-02 18:37:01 +02:00
Adam ab73f914ad Added in custom runtime environment variable for ease of testing. (#538) 2021-10-02 18:37:00 +02:00
Guldoman e2f7c984de Reset syntax highlighting on file rename 2021-10-02 18:37:00 +02:00
Francesco 0ff0ee2c61 Fix numpad fn keys (#532)
* Fix the numeric keypad function keys

As suggested in:

https://github.com/lite-xl/lite-xl/issues/64

* Apply scancode lookup to KEY_UP events
2021-10-02 18:37:00 +02:00
Guldoman d817944170 Force showing tabs when dragging them 2021-10-02 18:37:00 +02:00
Guldoman dced6da03d Implement tab drag and drop 2021-10-02 18:36:59 +02:00
Guldoman 86632b68de Move single tab drawing to its own function 2021-10-02 18:36:59 +02:00
Adam Harrison 2ac7c7f09b Syntax. 2021-09-16 17:43:17 -04:00