Reply to topic  [ 2 posts ] 
Macro to Delete Unitl End of Sentence 
Author Message

Joined: 2007-07-30 12:06:49
Posts: 30
Another macro request:
I need a macro that will deletete from the cursor to the end of the sentence (i.e. the period).

Any advice?


2007-10-19 08:25:46
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
This should do what you're looking for:

$deleteStart = Selection Location
$deleteLen = 0

# find the end of the current sentence
Find '($|\.(?![0-9])|[!?]+)[ \t]*', "E"
$selStart = Selection Location
$selLen = Selection Length
Begin Perl
$deleteLen = $selStart - $deleteStart;

# Select the sentence and delete it
Set Selection $deleteStart, $deleteLen

We also have some other sentence navigation macros in our macro repository.

2007-10-19 14:25:03
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software