Skip to content

nextpad-plus-plus-plugins/rustnpp.macos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

rustnpp (macOS)

Rust plugin for Nextpad++ / Notepad++ on macOS — a full rewrite of the original Windows/Rust plugin rustnpp by ნიკა (Nika Begiashvili), reimplemented from scratch in Objective-C++ as a standard native plugin.

Features

Adds two commands under Plugins → Rust plugin:

  • Run — run the current Rust source via the toolchain.
  • Build — compile the current Rust source via the toolchain.

Behaviour (faithful to the original):

  • If the current file is inside a Cargo project — that is, walking up the file's path reaches a directory named src whose parent contains a Cargo.toml — the plugin runs cargo run / cargo build from that project root.
  • Otherwise the file is treated as a stand-alone .rs file: Build runs rustc <file.rs> in the file's directory; Run additionally executes the produced binary (./<file-stem>) afterwards.

The combined stdout + stderr of the toolchain (and the program, for Run) is opened in a new editor tab. This is the macOS-native equivalent of the original Windows behaviour, which popped a console window (cmd /c start cmd /c "<cmd> & pause") showing the same output.

Requirements

Install Rust from https://www.rust-lang.org/tools/install. The recommended rustup installer places cargo and rustc in ~/.cargo/bin, which the plugin searches (along with your PATH and the usual /usr/local/bin, /opt/homebrew/bin, …). If the toolchain can't be found, the plugin shows an alert with install instructions instead of doing anything destructive.

Notes / differences from the Windows original

  • Output surface: new editor tab (captured via NSTask) instead of a pop-up console window — there is no per-plugin console window on macOS, and a new tab is the established Notepad++-macOS idiom for command output.
  • Keyboard shortcuts: the original bound F10 (Run) and Ctrl+F10 (Build). The macOS host ignores plugin-supplied shortcuts (FuncItem._pShKey), so these are not bound here. Invoke the commands from the Plugins menu.
  • Toolchain discovery: the original assumed cargo/rustc were on PATH. A GUI app on macOS inherits a minimal PATH, so this port also looks in ~/.cargo/bin.
  • The plugin makes no changes to the host and ships no bundled resources or toolbar icons (the original Rust crate had none).

Build

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j

Produces a universal (arm64 + x86_64) rustnpp.dylib. cmake --install build copies it to ~/Library/Application Support/Nextpad++/plugins/rustnpp/rustnpp.dylib.

License

The original rustnpp repository did not include a license file. This macOS port follows the original; treat it as provided by its respective authors.

About

macOS port of the rustnpp Notepad++ plugin: Run/Build the current Rust file via cargo/rustc (full Objective-C++ rewrite)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors