ports/editors/ad/files/patch-src_util.rs
Robert Clausecker a4e552651c editors/ad: Adaptable text editor
ad (pronounced A.D.) is an attempt at combining a modal editing
interface of likes of vi and kakoune with the approach to extensibility
of Plan9's Acme.  Inside of ad text is something you can execute as
well as edit.

It is primarily intended as playground for experimenting with
implementing various text editor features and currently is not at all
optimised or feature complete enough for use as your main text editor.

ad is aiming to be a hybrid of the pieces of various editors that I find
most useful:

 - vim style modal editing to allow for convenient key bindings
 - convenient text navigation and selection from vim/kakoune
 - mini-buffer based user defined minor modes from emacs
 - sam/acme style editing commands for larger editing actions
 - acme style extension through exposing editor state and functionality
   for external client programs.
 - support for mouse based navigation and selection but not requiring
   that as the main way of using the editor like in acme.  That's fine
   for desktop but most of the time I'm working with a laptop which
   makes that far too clunky.

ad is not trying to replace vim (or kakoune, or emacs) in terms of being
a massively hackable editor.  Rather it is trying to follow the
philosophy of acme in being an integrating development environment
(rather than integrated).  By which I mean that the aim is to provide a
comfortable editing environment to work in that supports direct
interaction with external tools and programs from the outside rather
than pulling everything in.

WWW: https://crates.io/crates/ad-editor
2024-10-06 13:49:20 +02:00

20 lines
716 B
Rust

--- src/util.rs.orig 2024-10-04 13:50:39 UTC
+++ src/util.rs
@@ -12,7 +12,7 @@ use std::{
thread::spawn,
};
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "freebsd"))]
/// Set the current system clipboard state using xclip.
pub fn set_clipboard(s: &str) -> io::Result<()> {
let mut child = Command::new("xclip")
@@ -23,7 +23,7 @@ pub fn set_clipboard(s: &str) -> io::Result<()> {
child.stdin.take().unwrap().write_all(s.as_bytes())
}
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "freebsd"))]
/// Read the current system clipboard state using xclip.
pub fn read_clipboard() -> io::Result<String> {
let output = Command::new("xclip")