EmEditor (text editor) Forum Index
   EmEditor Core Enhancement Suggestions
     Request: selection length in status bar
Register To Post

Threaded | Oldest First Previous Topic | Next Topic | Bottom
Poster Thread
Yutaka
Posted on: 2/23/2008 10:53 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2423
Re: Request: selection length in status bar
Good job!


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

shaohao
Posted on: 2/23/2008 4:58 am
Not too shy to talk
Joined: 11/12/2006
From:
Posts: 21
Re: Request: selection length in status bar
I just wrote a more complex Macro for the selected text status.


anchorX = document.selection.GetAnchorPointX(eePosLogical);
anchorY = document.selection.GetAnchorPointY(eePosLogical);
activeX = document.selection.GetActivePointX(eePosLogical);
activeY = document.selection.GetActivePointY(eePosLogical);

lines = 0;
chars  = document.selection.text.length;
if ( chars != 0) { // really select something
	if ( activeY > anchorY) {
		lines = activeY - anchorY + 1;
		if ( activeX == 1) lines--;
	} else if ( activeY < anchorY) {
		lines = anchorY - activeY + 1;
		if ( anchorX == 1) lines--;
	} else /* activeY == anchorY */ {
		lines = 1;
	}
}

status = "Selected: " + lines + "lines, " + chars + " chars";
Yutaka
Posted on: 2/18/2008 10:47 pm
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2423
Re: Request: selection length in status bar
Quote:

Deipotent wrote:
Is there no way of making it update immediately ?

If not, can you consider adding this ability, or have a separate option to display the number of bytes and lines in a selection on the status bar.


How many seconds do you have to wait until the status bar is updated with the correct number of bytes? It should be within a few seconds. If not, there might be something wrong with EmEditor.


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

lutz
Posted on: 2/18/2008 5:44 pm
Just popping in
Joined: 12/6/2007
From:
Posts: 4
Re: Request: selection length in status bar
I am not sure if I fully understand the discussion.
But a display of the size of the current selection in the status bar would surely be really nice !!
Deipotent
Posted on: 2/18/2008 11:15 am
Just can't stay away
Joined: 2/15/2008
From:
Posts: 122
Re: Request: selection length in status bar
Is there no way of making it update immediately ?

If not, can you consider adding this ability, or have a separate option to display the number of bytes and lines in a selection on the status bar.
Yutaka
Posted on: 2/18/2008 11:00 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2423
Re: Request: selection length in status bar
Quote:

whileloop wrote:
It would be better if it can be put in a field on the right side of the status bar. So that it will not block other status messages.


Unfortunately, it is not possible to put in a field on the right side of the status bar with the current version of EmEditor.


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

Yutaka
Posted on: 2/18/2008 10:58 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2423
Re: Request: selection length in status bar
Quote:

Deipotent wrote:
I set the delay time to 0.0 seconds, and there is still a delay before the status bar is updated. Is this a bug ?

I would also like it to show the number of lines in the selection. Is this possible ?

BTW, the documentation does not mention about the length property. Where can I find an up-to-date reference for all objects and properties ?


The status bar is updated when EmEditor becomes idle, so it is not a bug. You can certainly include the number of lines in the selection. I will write the code if you would like me to. length property is not a property of EmEditor objects, rather it is a property of string object in JavaScript. JavaScript is a popular script language, and so you can find the reference in Web sites or in many books. Search for "JavaScript string length" in Google.


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

whileloop
Posted on: 2/15/2008 10:35 pm
Just popping in
Joined: 1/5/2008
From:
Posts: 15
Re: Request: selection length in status bar
It would be better if it can be put in a field on the right side of the status bar. So that it will not block other status messages.
Deipotent
Posted on: 2/15/2008 3:41 pm
Just can't stay away
Joined: 2/15/2008
From:
Posts: 122
Re: Request: selection length in status bar
I set the delay time to 0.0 seconds, and there is still a delay before the status bar is updated. Is this a bug ?

I would also like it to show the number of lines in the selection. Is this possible ?

BTW, the documentation does not mention about the length property. Where can I find an up-to-date reference for all objects and properties ?
tranglos
Posted on: 1/7/2008 5:26 am
Just popping in
Joined: 12/2/2006
From:
Posts: 12
Re: Request: selection length in status bar
This works great, thank you kindly!

(Now, about that "replace in all open documents" request od mine... :)
(1) 2 »
Threaded | Oldest First Previous Topic | Next Topic | Top


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