~andreafeletto

Italy

https://andreafeletto.com

I study Electronics and Robotics at the University of Trento.

~andreafeletto/public-inbox

Last active 2 months ago
View more

Recent activity

[PATCH zig-spoon] update to zig 0.10.0 a month ago

From Andrea Feletto to ~leon_plickat/public-inbox

---
 example/input-demo.zig | 6 +++---
 example/menu.zig       | 6 +++---
 lib/Term.zig           | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/example/input-demo.zig b/example/input-demo.zig
index 2f52bef..642e10c 100644
--- a/example/input-demo.zig
+++ b/example/input-demo.zig
@@ -31,7 +31,7 @@ pub fn main() !void {
    try term.init(.{});
    defer term.deinit();

[message trimmed]

[PATCH] update to zig 0.10.0 a month ago

From Andrea Feletto to ~leon_plickat/nfm

---
 src/Config.zig        |  4 ++--
 src/Dir.zig           | 18 ++++++++++--------
 src/DirMap.zig        | 12 +++++-------
 src/File.zig          | 13 ++++++++-----
 src/UserInterface.zig |  2 +-
 src/ini.zig           | 35 +++++++++++++++++++++--------------
 src/nfm.zig           |  8 ++++----
 7 files changed, 51 insertions(+), 41 deletions(-)

diff --git a/src/Config.zig b/src/Config.zig
index 9b39da4..f51e919 100644
--- a/src/Config.zig
+++ b/src/Config.zig
[message trimmed]

[PATCH v2] draw both source and target for symlinks a month ago

From Andrea Feletto to ~leon_plickat/nfm

---
 src/Dir.zig           |  2 +-
 src/DirMap.zig        |  9 +++++----
 src/File.zig          | 37 ++++++++++++++++++++++++-------------
 src/UserInterface.zig | 11 +++++++++--
 4 files changed, 39 insertions(+), 20 deletions(-)

diff --git a/src/Dir.zig b/src/Dir.zig
index 376cb66..efd8b38 100644
--- a/src/Dir.zig
+++ b/src/Dir.zig
@@ -53,7 +53,7 @@ pub fn init(self: *Self, map: *DirMap, alloc: mem.Allocator, dir: fs.Dir, name:
        file.mark = false;
        file.text = null;
[message trimmed]

[PATCH] draw both source and target for symlinks a month ago

From Andrea Feletto to ~leon_plickat/nfm

---
 src/Dir.zig           |  9 +++++++++
 src/DirMap.zig        | 14 ++++++++++++++
 src/File.zig          | 13 +++++++++----
 src/UserInterface.zig | 10 +++++++++-
 4 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/src/Dir.zig b/src/Dir.zig
index 376cb66..ab59f27 100644
--- a/src/Dir.zig
+++ b/src/Dir.zig
@@ -52,6 +52,15 @@ pub fn init(self: *Self, map: *DirMap, alloc: mem.Allocator, dir: fs.Dir, name:
        file.kind = entry.kind;
        file.mark = false;
[message trimmed]

[PATCH] include offset in file signature matching a month ago

From Andrea Feletto to ~leon_plickat/nfm

fixes false negatives for mp4 files whose 4th byte is not \x1C.
---
 src/File.zig | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/src/File.zig b/src/File.zig
index 897c937..8873db7 100644
--- a/src/File.zig
+++ b/src/File.zig
@@ -80,21 +80,25 @@ pub fn isTextFile(self: *Self) !bool {
    if (bytes_read == 0) return true;

    // The magic values of some false positives.
    const magic = [_][]const u8{
[message trimmed]

Re: [PATCH 2/2] add move-marked-files-to-cwd command 3 months ago

From Andrea Feletto to ~leon_plickat/nfm

Ok, I'll think of something tomorrow. Maybe piping the list instead of passing every path as argument would work better.

Re: [PATCH 1/2] store marked files in a separate struct 3 months ago

From Andrea Feletto to ~leon_plickat/nfm

You are perfectly right. I didn't consider that drawFileName is called for every file during rendering.
To be honest, I developed this because I were convinced that the old implementation only iterated over
marked files in cwd (not in other directories). I now realise this assumption is completely wrong.
So don't even bother looking at it tomorrow.

August 19, 2022 10:48 PM, "Leon Henrik Plickat" <leonhenrik.plickat@stud.uni-goettingen.de> wrote:

> Thanks for the patch!
> 
> I'll take a proper look tomorrow, but I have a few questions before that:
> 
> * While this makes iterating over all marked files more efficient,
> doesn't this make checking if a specific file is marked considerably
> less efficient? We do the latter one a lot more often (every render)

[PATCH 2/2] add move-marked-files-to-cwd command 3 months ago

From Andrea Feletto to ~leon_plickat/nfm

New command for moving marked files and directories to cwd.
If any filename exists in cwd, the command exits before
moving any file and warns the user with an error.
---
 doc/nfm.1                   |  1 +
 example/config.ini          |  1 +
 src/Config.zig              |  2 ++
 src/key-operations/misc.zig | 17 +++++++++++++++++
 4 files changed, 21 insertions(+)

diff --git a/doc/nfm.1 b/doc/nfm.1
index 44339fd..8e15322 100644
--- a/doc/nfm.1
+++ b/doc/nfm.1
[message trimmed]

[PATCH 1/2] store marked files in a separate struct 3 months ago

From Andrea Feletto to ~leon_plickat/nfm

Create a new datatype for storing pointers to File.
It is optimized for iterating over all stored files and over
files on a specific directory.
---
 src/Dir.zig                   |  1 -
 src/DirMap.zig                | 35 ++----------------
 src/File.zig                  |  1 -
 src/FileSet.zig               | 68 +++++++++++++++++++++++++++++++++++
 src/UserInterface.zig         | 11 +++---
 src/key-operations/commit.zig |  6 ++--
 src/key-operations/cursor.zig |  4 +--
 src/key-operations/marks.zig  | 12 ++++---
 src/nfm.zig                   | 20 ++++++-----
 9 files changed, 99 insertions(+), 59 deletions(-)
[message trimmed]