Skip to content

nextpad-plus-plus-plugins/NppStripIpAndHost.macos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NppStripIpAndHost (macOS port)

macOS port of the Windows Notepad++ plugin NppStripIpAndHost by larreblarsson — for Nextpad++ (the macOS port of Notepad++).

It sanitizes the active document by replacing IP addresses (IPv4 & IPv6) and hostnames / URLs with configurable placeholder strings — handy for scrubbing server logs and configs before sharing.

Menu commands (Plugins → NppStripIpAndHost)

  • Strip IPs and Hostnames — run the replacement over the current document.
  • Undo Last Strip — restore the pre-strip text for this document only (a per-document backup, independent of the editor's own undo stack).
  • Replace Settings… — open the settings dialog.

Replace Settings dialog

  • IPv4 — four octets, each with its own replace checkbox and a placeholder field. Unchecked octets keep their original value; checked octets are replaced with your text (defaults qqq.xxx.yyy.zzz).
  • IPv6 — checkbox + placeholder (default 2001:db8:0:0:0:0:0:1).
  • Host/URL — checkbox + placeholder (default hostname.com).

Settings are persisted to <plugins config dir>/NppStripIpAndHost/NppStripIpAndHost.ini. (The original Windows plugin kept settings only in memory for the session; this port persists them across restarts.)

Notes on the port

  • The replacement logic (regexes, per-octet IPv4 format building, per-document undo keyed by the Scintilla doc pointer) is ported verbatim from the Windows source. Only the platform layer changed:
    • Win32 DIALOG resource → programmatic AppKit NSWindow (modal).
    • ::SendMessagenppData._sendMessage.
    • MessageBoxNSAlert; status updates → NPPM_SETSTATUSBAR.
  • The Windows wait-cursor (SetCursor(IDC_WAIT)) is dropped: macOS has no app-global busy pointer a plugin can set without owning the run loop, and the regex pass is effectively instantaneous for normal documents. Status-bar messages provide the feedback instead.
  • The IPv4/IPv6/hostname regexes are taken unchanged from upstream. As upstream, they are intentionally simple (e.g. the IPv4 pattern does not range-check octets to 0–255), so non-routable matches like 999.1.2.3 are treated as IPv4 — this matches the Windows plugin's behaviour exactly.

Building

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

Produces a universal (arm64 + x86_64) NppStripIpAndHost.dylib. Copy it into a NppStripIpAndHost/ folder inside the Nextpad++ plugins directory (~/Library/Application Support/Nextpad++/plugins/) and restart.

License

GPL v2 (see LICENSE) — same as the upstream plugin.

About

macOS port of the NppStripIpAndHost Notepad++ plugin (strip/replace IPv4, IPv6 and hostnames) for Nextpad++

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors