EmEditor (text editor) Forum Index
   Questions and Answers about Macros
     anybody got a macro or other tool that can do Select Paragraph?
Register To Post

Flat Previous Topic | Next Topic
Poster Thread
webern
Posted on: 2/26/2011 1:49 pm
Not too shy to talk
Joined: 11/23/2006
From: Moscow, Russia
Posts: 38
Re: anybody got a macro or other tool that can do Select Paragraph?
[CODE]
// File: Select_Paragraph.jsee
// Autor: Dmitry Pirozhkov
// Date: 23.Nov.2006
// Info: Macro to select the entire paragraph.
// Requires: EmEditor Professional v.7.00 or later
// Usage: Place the cursor anywhere within a paragraph you wish to select. Run this macro.

var blankLine = "^$"; //the paragraph delimiter
var y1;

with (document.selection) {

if (document.GetLine(GetActivePointY(eePosLogical), eeGetLineWithNewLines).length<=2) {
alert ("Please, place the cursor on the non-blank line.");
Quit();
}

if (!Find(blankLine, eeFindPrevious | eeFindReplaceQuiet | eeFindReplaceRegExp)) {
y1 = 1;
} else y1 = GetActivePointY(eePosLogical)+1;

if (!Find(blankLine, eeFindNext | eeFindReplaceQuiet | eeFindReplaceRegExp)) {
EndOfDocument();
}

SetActivePoint(eePosLogical, 1, y1, true);
StartOfLine(true,eeLineHomeText);
//to perceive an indent as the paragraph boundary
}

[/CODE]
Flat Previous Topic | Next Topic


Subject Poster Date
   anybody got a macro or other tool that can do Select Paragraph? gning 2/25/2011 12:00 pm
   » Re: anybody got a macro or other tool that can do Select Paragraph? webern 2/26/2011 1:49 pm
       Re: anybody got a macro or other tool that can do Select Paragraph? shx 2/28/2011 9:02 am
         2 shx webern 2/28/2011 10:45 am
           Re: 2 shx gning 2/28/2011 11:42 am
             Re: 2 gning webern 2/28/2011 11:40 pm
               Re: 2 gning gning 6/16/2011 9:48 am

Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文