Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Storage Class #1929

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d5940b6
Initial commit to clean up projects; spun off find-file to its own pl…
adamharrison Apr 1, 2023
2f4aff1
Bump modversion.
adamharrison Jun 22, 2024
a716131
Bumped modversion and changed a few minor things.
adamharrison Jun 22, 2024
f2fd9ba
Added in handling of ignored files.
adamharrison Jun 22, 2024
0350614
Fixed small issue.
adamharrison Jun 27, 2024
3cc4543
Fixed issue with absolute arguments.
adamharrison Jul 5, 2024
9e2ec1b
Removed home encoding; may revert this if I can find out why it was d…
adamharrison Jul 7, 2024
9c05676
Fixed minor issue with file suggestions.
adamharrison Aug 22, 2024
0303199
Cleaned up treeview.
adamharrison Aug 22, 2024
41f8206
Typo.
adamharrison Aug 22, 2024
59650ec
Added in visible.
adamharrison Aug 23, 2024
056a2cb
Ensured that the appropriate project module is loaded.
adamharrison Sep 10, 2024
975e416
Fixed improper rebase.
adamharrison Sep 10, 2024
17a3503
Abstracted out the storage system of the workspace plugin so other pl…
adamharrison Mar 6, 2024
3de9036
Fixed double return.
adamharrison Mar 6, 2024
a8fce83
Fixed functional issue.
adamharrison Mar 6, 2024
11af515
Added documentation.
adamharrison Apr 3, 2024
b84738f
Sumenko reports duplicate function definitions, unsure why.
adamharrison Apr 3, 2024
d5dbfad
Fixed minor bug with workspace.
adamharrison Sep 28, 2024
7be990f
Fixed switching projects on restart.
adamharrison Oct 9, 2024
f2a66b4
Merge branch 'master' into PR/project-rework
adamharrison Oct 22, 2024
00d708c
Harmonized spacing around asserts, and fixed an issue forgetting to s…
adamharrison Nov 3, 2024
86388a6
Made project an object.
adamharrison Nov 3, 2024
62bc82e
Removing unecessary yields.
adamharrison Nov 3, 2024
28b7029
Removed unecessary fallback.
adamharrison Nov 3, 2024
fed7967
Removed unecessary line.
adamharrison Nov 3, 2024
64b5f57
Reveted backslash handling, as it doesn't seem to make any difference.
adamharrison Nov 3, 2024
8e0ae38
Spacing.
adamharrison Nov 3, 2024
320695c
Only stonks.
adamharrison Nov 3, 2024
19046d0
Removed uneeded error handling.
adamharrison Nov 3, 2024
fef8f81
Added in function to determine project by path, and added in deprecat…
adamharrison Nov 3, 2024
dcb0ee6
Merge branch 'master' into PR/project-rework
adamharrison Nov 3, 2024
0bb8d7e
Removed storage module.
adamharrison Nov 3, 2024
283b0ae
Typo.
adamharrison Nov 3, 2024
0a3b440
Changed to use deprecation log instead of regular warn so as to not s…
adamharrison Nov 27, 2024
10f2ab9
Fixed small bug with saving workspaces on project change.
adamharrison Nov 27, 2024
b20a85c
Revert "Removed storage module."
adamharrison Nov 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added in handling of ignored files.
  • Loading branch information
adamharrison committed Sep 13, 2024
commit f2fd9baec3b16287168cb78be8e2fd8d264aba49
19 changes: 13 additions & 6 deletions data/core/project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,23 @@ local function fileinfo_pass_filter(info, ignore_compiled)
end


-- compute a file's info entry completed with "filename" to be used
-- in project scan or falsy if it shouldn't appear in the list.
function Project:get_file_info(path)
local info = system.get_file_info(path)

function Project:is_ignored(info, path)
-- info can be not nil but info.type may be nil if is neither a file neither
-- a directory, for example for /dev/* entries on linux.
if info and info.type then
info.filename = path
return fileinfo_pass_filter(info, self.compiled) and info
if path then info.filename = path end
return not fileinfo_pass_filter(info, self.compiled)
end
return false
end

-- compute a file's info entry completed with "filename" to be used
-- in project scan or falsy if it shouldn't appear in the list.
function Project:get_file_info(path)
local info = system.get_file_info(path)
if self:is_ignored(info, path) then return nil end
return info
end


Expand Down
8 changes: 7 additions & 1 deletion data/plugins/treeview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ function TreeView:get_cached(project, path)
project = project,
name = basename,
type = info.type,
project = project
project = project,
ignored = self.show_ignored and project:is_ignored(info, path)
}
if self.expanded[path] ~= nil then t.expanded = self.expanded[path] else t.expanded = (info.type == "dir" and #truncated <= 1) end
if t.expanded then self.watches[project]:watch(path) end
Expand All @@ -117,6 +118,7 @@ function TreeView:get_cached(project, path)
if f and f.type then
f.name = file
f.abs_filename = l
f.ignored = self.show_ignored and project:is_ignored(f, l)
table.insert(t.files, f)
end
self.cache[l] = nil
Expand Down Expand Up @@ -363,6 +365,8 @@ function TreeView:get_item_icon(item, active, hovered)
local color = style.text
if active or hovered then
color = style.accent
elseif item.ignored then
color = style.dim
end
return character, font, color
end
Expand All @@ -373,6 +377,8 @@ function TreeView:get_item_text(item, active, hovered)
local color = style.text
if active or hovered then
color = style.accent
elseif item.ignored then
color = style.dim
end
return text, font, color
end
Expand Down