diff options
| author | Guldoman <giulio.lettieri@gmail.com> | 2021-08-29 04:02:53 +0200 |
|---|---|---|
| committer | Francesco <francesco.bbt@gmail.com> | 2021-08-29 11:13:39 +0200 |
| commit | ab6eac399c7b38680a99c911f4d41478dc711ac2 (patch) | |
| tree | b513de059b61ee6e1c72ae98f0e4e5eeff8a7817 | |
| parent | 76334a7946e2f936daf99dafff2be59f149018b3 (diff) | |
| download | lite-xl-ab6eac399c7b38680a99c911f4d41478dc711ac2.tar.gz lite-xl-ab6eac399c7b38680a99c911f4d41478dc711ac2.zip | |
Fix crash in project search when project has no files
| -rw-r--r-- | data/plugins/projectsearch.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/data/plugins/projectsearch.lua b/data/plugins/projectsearch.lua index 45967697..dda3a2d0 100644 --- a/data/plugins/projectsearch.lua +++ b/data/plugins/projectsearch.lua @@ -171,7 +171,7 @@ function ResultsView:draw() local ox, oy = self:get_content_offset() local x, y = ox + style.padding.x, oy + style.padding.y local files_number = core.project_files_number() - local per = files_number and self.last_file_idx / files_number or 1 + local per = common.clamp(files_number and self.last_file_idx / files_number or 1, 0, 1) local text if self.searching then if files_number then |
