Forum Replies Created
- AuthorPosts
- VladMember
Yutaka wrote:
I optimized on beta 27. Please let me know if that is acceptable. Thanks!Regexp replace speed is indeed dramatically improved in Beta 27. I used the “catalog.htm” file provided in previous posts. I cannot scroll it because of ridiculously long lines, but it doesn’t matter. Replace “.+?” with nothing (match case, use regexp). It’s done in about 5 seconds! Previously it would take minutes.
HOWEVER, there is something seriously wrong with Undo. After replacements were done I hit Ctrl-Z. It took about 10 minutes. This is not right.
And there is no improvement for other patterns.
The following replacement (to split long lines) still takes too much time (>5 minutes. It takes a few seconds in jEdit or Vim which I keep just for such jobs):
Find: (<table|<tr)
Replace: n1VladMemberIt would be nice to have correct colorizing for Python triple-quoted strings. They can include unescaped newlines and quotes. They are used for documentation and thus occasionally contain unmatched ‘ (it’s, that’s, etc.).
This is an old request: http://www.emeditor.com/forum/viewtopic.php?t=562VladMemberThis is a new bug only in version 7.
My actual script, which was ok with version 6, looks like this:#language="Python"
if 0:
pass
else:
Window.alert('ok')
It has windows line endings and ends with 3 newlines
Now this gives error message:
invalid syntax
Line 8Line 8 is the end of file. Remove the last line and it runs fine. Other variations of the number of trailing line endings and indents give errors similar to the first post. This is quite mysterious.
VladMemberWhat does “Right Side means Right All” do? There is nothing in Help.
Macro Reference in Help has so many Objects for Configuration Properties that it is hard to understand what is going on. May be it’s better to move them all in a separate node.
VladMemberThis is almost fixed in beta 16. Still cannot do the following, emeditor hangs:
find: (.*)
replace: [1]The problem seems to be .* expression
VladMemberI gave it a try: http://en.wikipedia.org/wiki/EmEditor
Let’s see how long it will last.VladMemberIt’s easy to add highlighting for numbers and other custom strings. This is defined in Properties -> Highlight (1). Example for numbers:
#Keyword color=1,word=on,rightall=off,case=on,insidetag=off,regexp=on
(?![a-zA-Z_])[0-9]+.*(?![a-zA-Z_])
I don’t think it’s possible to highlight blocks spanning several lines.
VladMemberthe common Windows Ctrl-F4 way of closing documents is dangerous. It’s easy to confuse Ctrl-F4 with Alt-F4, which closes the application. I never use Ctrl-F4 because of this danger.
Ctrl-W is the same as Ctrl-F4 in most Windows applications, including Firefox.
You can also close tab with mouse middle click (wheel click).
Close button on tabs is unnecessary and is a waste of space.
VladMemberIf you installed official Python distribution from http://www.python.org you should also install Python for Windows extensions:
home page: http://starship.python.net/crew/mhammond/win32/
download page: http://sourceforge.net/project/showfiles.php?group_id=78018Make sure to select installer version corresponding to your Python version, that is pywin32-210.win32-py2.5.exe if you have Python 2.5.x
If everything was installed correctly you should be able to run this python script:
import win32api
import win32com.client
WshShell = win32com.client.Dispatch(‘WScript.Shell’)
WshShell.Run(‘notepad.exe’)
win32api.Sleep(1000)
WshShell.SendKeys( ‘everything is ok{ENTER}’ )VladMemberSee EmEditor Help – Dialog Boxes -Search Only Word check box: “A word is defined as a string that begins and ends with any of these characters: A – Z, a – z, 0 – 9, or an underscore.”
To do what you want you can use regular expression: bιb
b matches word boundaryIn JavaScript:
document.selection.Replace(“bιb””,””,eeFindNext | eeFindReplaceCase | eeReplaceAll | eeFindReplaceRegExp);VladMemberIt’s all my fault! It was me who requested change from something like “dot matches newline” to “regexps match newline” because I got confused several time using regexps like [^a-z]. And it was different depending on whether I searched in single or multiple files.
Now [^a-z] and s match newlines if “regexps match newline” is off, but only if “additional lines to search …” is not 0. If you set “additional lines to search …” to 0 you should get single line searches. I am not sure though, this is confusing.
Perhaps this is a bug and “additional lines to search …” should be disabled when “regexps match newline” is disabled?
VladMemberWe can do better than installing a dozen plugins or macros. The Execute Extension plugin can be configured to insert tags, but configuring it is a pain. Here is a script version of tagger, it generates popup menu with tags to insert:
// TAGGER.JSEE -- tagger and clip library, inserts strings around selected text or at the cursor.
// Usage: modify tables of tags at the start of file as you see fit.
// To add tags for other configurations: add new tables of tags and edit switch statement at the end.
// format: [string to insert before selection, string to insert after selection, optional menu label]
////////////////////////////////
HTML_TAGS = [
['<br>', '', ''],
['<p>', '</p>', ''],
[' ', '', 'space'],
['', '<hr>', ''],
['<!-- ', ' -->', 'comment'],
['', '', '-----------'], //menu separator
['<b>', '</b>', 'bold'],
['<i>', '</i>', 'italic'],
['<u>', '</u>', 'underline'],
['<pre>', '</pre>', ''],
['<blockquote>', '</blockquote>', 'blockquote'],
['<big>', '</big>', 'big'],
['<small>', '</small>', 'small'],
['<sup>', '</sup>', 'superscript'],
['<sub>', '</sub>', 'subscript'],
['<center>', '</center>', 'center'],
['', '', '-----------------'],
['<a href=#>', '</a>', 'Link'],
['<a name=>', '</a>', 'Mark'],
['<img src="" alt="" width="" height=>', '', 'Image'],
['', '', '--------------'],
['<table>', '</table>', 'table'],
['<tr>', '</tr>', ''],
['<td>', '</td>', ''],
['<ul>n', 'n</ul>', 'unorderd list'],
['<ol>n', 'n</ol>', 'orderd list'],
['<li>', '', ''],
['<dl>n', 'n<dl>', 'definition list'],
['<dt>', '', ''],
['<dd>', '', ''],
['', '', ''], //these are ignored
['', '', ''],
['', '', ''],
['', '', '']
];
////////////////////////////////
TEXT_TAGS = [
['Dear Collector:', '', ''],
['I would like to sell my kidney.', '', ''],
['Which way is to the soup kitchen?', '', ''],
['', '', ''],
['', '', '']
];
////////////////////////////////
UNIVERSAL_TAGS = [ //these should always be available
['', '', '--------------------'],
['/*', '*/', '/**/'],
['u03B2', '', 'beta'],
['', '', '']
];
/////////////////////////////////////////////////////////////////
function createMenu(tags) {
tags = tags.concat(UNIVERSAL_TAGS);
menu = CreatePopupMenu();
//populate menu
L = tags.length;
for (i=0; i<L; i++) {
if (tags[i].length!=3 || (tags[i][0]=="" && tags[i][1]=="" && tags[i][2]=="")) continue;
if (tags[i][2].slice(0,6)=="------")
menu.Add( '', 0, eeMenuSeparator );
else
menu.Add( tags[i][2] || tags[i][0] || tags[i][1], i+1 );
}
//display menu
result = menu.Track(0);
//insert tags
if (result!=0) insertTags(tags[result-1][0], tags[result-1][1]);
}
function insertTags(text_before, text_after) {
document.selection.Text = text_before + document.selection.Text + text_after;
// to do: restore selection
}
switch( document.ConfigName ) {
case("HTML"):
createMenu(HTML_TAGS);
break;
case("Text"):
createMenu(TEXT_TAGS);
break;
default:
createMenu(HTML_TAGS);
}
March 7, 2007 at 11:24 pm in reply to: How can I have syntax highlighting with some words taking precedence over others? #4226VladMemberI want to have some regular expression that colors text according to it’s rules but I also want to have some specific words, that happen to be matched by the regular expression, to have different colors.
You can define “specific words, that happen to be matched by the regular expression” as regex words and put them after the regular expression that matches them. I once tried that with a Python syntax file that has >200 keywords. If they are all defined as regex, there is a noticeable screen redrawing, but the editor is still usable, which shows that the colorizer is extremely efficient.
I agree that it would be much more useful if the non-regex keywords were colorized _after_ regex keywords.
- AuthorPosts