Forum Replies Created
- AuthorPosts
- ldmParticipant
Hi all,
1) What command should be used for removing a character?
2) How to replace double (or more) empty lines with a single empty line?
Thank you!
ldmParticipantThank you Stef! Of course, I’ll try it by myself!
ldmParticipantThanks Stefan!
In order to create tags, should I run the ‘Tag Jump’ command each time after ‘Find in Files’ one? Could the tags be created automatically and be loaded with the associated files (like highlights)?
Are there already ‘ready for use’ tag files created for the famous programming languages?
Is it possible to edit/customize the tag files? How? Is there any template/tool for that?
Hopefully I don’t ask too many questions :-)
Thank you in advance for any your comments!ldmParticipantGreat! Thank you for your comments!
ldmParticipant“find as you time” – did you mean “find as you type”?
ldmParticipantCould you please take a look on the Java code in my previously post? Could it be translated for using with EmEditor? It seems this script is exactly what’s we are looking for…
Are you familiar with Java?ldmParticipantStefan,
The CSV, TSV and DSV modes are just for the visualization, they do not make real alignments.
Honestly, I’m already tired to align comments in my files…
It seems the alignment feature should receive a first priority in the coming releases :-).
Why Yutaka don’t answer?ldmParticipantCould anybody help with translation of the script above for using it with EmEditor?
Is it a big issue to translate it?
Thank you!ldmParticipantHi,
I’ve found a Java code, which makes alignments for the `=` sign (see it below). The code is written for the UltraEdit. Could anyone translate it to a general one so that it could be used in the EmEditor as well?
Thank you!
————————————————————
CODE:
————————————————————
//alignEqual.js
//Bego
//Aligns the SELECTION by the Equal-sign. Might be configured with Left or Right alignment!
//Version 1.1 25.10.2007 result once was shifting 1 column to the left for each run: pos1 = getColOfFirstChar();// – 1;
// 1.2 25.10.2007 Now MYSIGN can be really sth. else like “=”, e.g. “/”, but yet still only ONE character
// 1.3 25.10.2007 Shifting result in 1.1 was Problem of configuration of home-key when pressed twice. Made it safe now
// CloseFile workaround 13.20+2
var orgDoc;
var sourceDoc;
var maxColEqual = 0;
var pos1 = 0;
var myDocNo;
var MYSIGN = “=”;
var MYALIGN = “L”; //(L)eft or (R)ight
sourceDoc = UltraEdit.document[getActiveDocumentIndex()];UltraEdit.outputWindow.showOutput = true;
UltraEdit.outputWindow.clear();
//UltraEdit.outputWindow.write(“Debug: Start”);
UltraEdit.perlReOn();
//ZUM TEST ALLES MARKIEREN UND KOPIEREN STATT MOVEN:
//UltraEdit.activeDocument.selectAll();
UltraEdit.selectClipboard(8);
UltraEdit.activeDocument.cut();
UltraEdit.newFile();
orgDoc = UltraEdit.activeDocument;
orgDoc.paste();
orgDoc.top();pos1 = getColOfFirstChar();
//UltraEdit.outputWindow.write(“Debug: ” + pos1);
stripEqualRemoveLeadingSpaces();maxColEqual = getMaxColEqual();
stuff(pos1, maxColEqual, MYALIGN);UltraEdit.selectClipboard(8);
orgDoc.selectAll();
orgDoc.copy();
//UltraEdit.closeFile(); //13.20+2 does not work
closeFile();//UltraEdit.document[3].setActive(); //CRASH. Still a bug !!!
UltraEdit.selectClipboard(8);
sourceDoc.paste();
UltraEdit.selectClipboard(0);///////////////////////////////////////////////////////////////////////////////////////////////////
function closeFile() {
UltraEdit.selectClipboard(9);
orgDoc.copyFilePath();
orgDoc.top();
orgDoc.paste();
orgDoc.selectToTop();
var CurrentFileName = orgDoc.selection;
orgDoc.deleteText();
UltraEdit.closeFile(CurrentFileName,2);
UltraEdit.clearClipboard();
UltraEdit.selectClipboard(0);
}function stuff(pPos1, pMaxCol, pAlign) {
var col;
var spaces = ” “orgDoc.top();
//go through once again and stuff spaces, depending on the position of the equal-sign and the calculated maxPosition
while ( (orgDoc.findReplace.find(MYSIGN)) && ! orgDoc.isEof() ) {
orgDoc.key(“LEFT ARROW”); orgDoc.key(“RIGHT ARROW”); //unmark selection
col = orgDoc.currentColumnNum; //getCol();
orgDoc.key(“HOME”);
if (pAlign == “R”) {
orgDoc.write(spaces.substring(0,pMaxCol – col + pPos1));
}
else
{
orgDoc.write(spaces.substring(0,pPos1));
//reposition in front of sign and stuff here
orgDoc.findReplace.find(MYSIGN);
orgDoc.key(“LEFT ARROW”);
orgDoc.write(spaces.substring(0,pMaxCol – col));
}
orgDoc.key(“END”);
}
}function getMaxColEqual() {
//get the mostright equal-sign in the selection. This is the orientation for the stuffing-spaces at the beginning of the line.
var max = 0;
var col = 0;orgDoc.top();
orgDoc.findReplace.replaceAll = false;
orgDoc.findReplace.regExp = false;
while ( (orgDoc.findReplace.find(MYSIGN)) && ! orgDoc.isEof() ) {
col = orgDoc.currentColumnNum; //getCol();
orgDoc.key(“END”);//continue search in next line
if (col > max) {
max = col;
}
}
return max;
}function stripEqualRemoveLeadingSpaces() {
//ONE space before and after equal-sign. cut all leading spaces.
orgDoc.top();
orgDoc.findReplace.replaceAll = true;
orgDoc.findReplace.regExp = true;
var strFind = “s*” + MYSIGN + “s*”;
orgDoc.findReplace.replace(strFind, ” ” + MYSIGN + ” “);
orgDoc.findReplace.replace(“^s*”, “”);
}function getColOfFirstChar() {
//determins in which column the line starts with content. V1.3: maybe do it twice since HOME-key might toggle between Col0 and start of first char
orgDoc.findReplace.regExp = true;
orgDoc.key(“HOME”);
if (orgDoc.currentColumnNum == 0) {
orgDoc.key(“HOME”);
}
return orgDoc.currentColumnNum; //ab 13.10
}function getActiveDocumentIndex() {
var tabindex = -1; /* start value */for (i = 0; i < UltraEdit.document.length; i++)
{
if (UltraEdit.activeDocument.path == UltraEdit.document[i].path) {
tabindex = i;
break;
}
}
return tabindex;
}ldmParticipantHere is a link to the same plug-in for VIM:
http://www.vim.org/scripts/script.php?script_id=294
Is it hard to make the same plugin for the EmEditor as well?
Thank you!ldmParticipantStefan,
I’ve got it!
Thanks!ldmParticipantStefan, the issue is not with the RegEx syntax, but how use the RegEx expressions inside of the Java Scripts (please see my previous post).
How should I let to Java know that I wrote a regular expression and not just a string?
Thank you!ldmParticipantThanks!
ldmParticipantIt works! Great! Thank you!
ldmParticipantToadLoadin & Stefan! Thanks a lot!
But now I need one more tip please :-)
Does JavaScript supports Regular Expressions?
Let’s say I need to replace a text, which matches the pattern ^(;[ ]*[ ])(.*) with this one: 1[2]
How would I do so?
Thank you!ldmParticipantArthurZ,
Opening a file in the Read-Only mode insure that you will not change it occasionally. In this mode the Editor works as a Viewer while preserving all highlights, tags and other settings.
A possibility to pass a Read-Only flag/switch/parameter from a command line is also might be very useful since it allows opening the files in the Viewer(Read-Only) mode automatically by just passing a file name to the script.
Thank you!ldmParticipantWould you probably like to add a command-line switch allowing to open a file in the read-only mode?
ldmParticipantThank you Yutaka!
What about my previously post? Here is it:
“I’ve double checked the “Close on Exit” option – it’s unchecked.
When the running script (configured via EmEditor External Tools) exits, the Output Panel remains open, but all it’s STDOUT strings disappear from the Output Panel.
If I put `pause` in the end of the script, it remains in the memory and its STDOUT strings present i the EmEditor Output Panel until exit of the script.
I’m using the v11.0.0 of the EmEditor on the windows 7 64-bit machine.”ldmParticipantHere is another issue…
When I run a program from the External Tool, which is configured to use the Output Panel, I’m receiving the following message: “Do you want to terminate the current tool job?”
What does it mean?
Thank youldmParticipantYutaka,
I’ve double checked the “Close on Exit” option – it’s unchecked.
When the running script (configured via EmEditor External Tools) exits, the Output Panel remains open, but all it’s STDOUT strings disappear from the Output Panel.
If I put `pause` in the end of the script, it remains in the memory and its STDOUT strings present i the EmEditor Output Panel until exit of the script.
I’m using the v11.0.0 of the EmEditor on the windows 7 64-bit machine.ldmParticipantThe problem is so that when the script, whose STDOUT was redirected to the EmEditor Output Panel, exits then also its STDOUT disappear from the Output Panel.
Is it possible to configure the Output Panel in such way so that nothing disappear from the Output Panel until the user clears it?
In another words, I’m talking about an option to clear the Output Panel window manually (not automatically with an exit of the script).
Thank youldmParticipantIn the Output Panel, there is an ‘Display as Output Bar’ option for Standard Errors, but this option does not exist for Standard Outputs… Why? This option allows displaying Standard Errors in the EmEditor Output Panel. But how is it possible to display the Standard Outputs, which was issued by an external application, in the EmEditor Output Panel?
Thank you!ldmParticipantThanks!
ldmParticipant“The Projects plug-in is already displayed as side-bar” – correct!
So, is it possible to re-arrange the projects (move them up or down) in the Projects’ plug-in side-bar?ldmParticipantIn the External Tool Properties, there are the following options:
– Input (with a down-dropped menu)
– Output (with a down-dropped menu)
– Standard Error (with a down-dropped menu)
Honestly, I read the help file related sections, but there are no more details there… Would you please give more explanations why these options are needed and how to use them?
Thank you in advance for your support! - AuthorPosts