From cc14a9f735f513fe5e0b4cd1f7552b5573b3d4ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?=
Date: Sun, 29 Dec 2024 22:57:41 +0100
Subject: [PATCH] Add selection functionality
At least for now, other actions mostly ignore the selection,
which is consistent with MC.
The selection is saved in the config/state file.
Closes #2
---
NEWS | 8 +++
sdn.cpp | 198 +++++++++++++++++++++++++++++++++++++++++++-------------
2 files changed, 161 insertions(+), 45 deletions(-)
diff --git a/NEWS b/NEWS
index b5434ef..54e2935 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,13 @@
Unreleased
+ * Added selection functionality, and adjusted key bindings:
+ - C-t or Insert toggle whether the current item is selected;
+ - + and - adjust the selection using shell globs;
+ - t and T insert the selection into the external command line
+ in relative or absolute form, respectively;
+ - Enter is like t but enters directories, and M-Enter is synonymous to t;
+ - C-g or Escape clear the selection, similarly to the editor.
+
* Added an sdn-view script that can process Midnight Commander mc.ext.ini files
and apply matching filters; this script has been made the default F3 binding,
while the original direct pager invocation has been moved to F13 (which also
diff --git a/sdn.cpp b/sdn.cpp
index af2e09e..76d60fc 100644
--- a/sdn.cpp
+++ b/sdn.cpp
@@ -28,6 +28,8 @@
#include
#include