Macro Editing: Find & Highlight Text with EmEditor - A Comprehensive Guide

Macro Editing: Find & Highlight Text with EmEditor - A Comprehensive Guide

Timothy Lv8

Macro Editing: Find & Highlight Text with EmEditor - A Comprehensive Guide

Viewing 8 posts - 1 through 8 (of 8 total)

  • Author
    Posts
  • November 23, 2008 at 12:14 am #6648
    masha
    Member
    Hello
    How to change color and style of given lines or characters ?
    I want to to highlight and/or underscore some words and lines as a result of some analysis performed in my macro (and external tools executed from the macro).
    November 23, 2008 at 2:29 am #6652
    webern
    Member
    EmEditor has an ability to highlight words with RegExp.
    Also you may check Macro Reference for three Highlight objects and three Font objects.
    November 23, 2008 at 10:37 am #6654
    masha
    Member
    Is it possible to highight lines having their numbers ?
    For example, my macro runs Lint or compiler, parses its output and got an array of line numbers.
    Then I want to see them underlined (or with red background) in editor.
    November 24, 2008 at 7:19 pm #6663
    Yutaka Emura
    Keymaster

    masha wrote:
    Is it possible to highight lines having their numbers ?

    For example, my macro runs Lint or compiler, parses its output and got an array of line numbers.
    Then I want to see them underlined (or with red background) in editor.
    If you want to highlght line numbers so they become mouse-clickable, you need to write a single-line JavaScript macro:
    document.HighlightTag = true;
    and run this macro when you need it.
    You might need to adjust the Tag Format in the Edit tab of Customize dialog box (on Tools menu).
    November 24, 2008 at 10:12 pm #6666
    masha
    Member
    No, it is not what I want.
    I have array of integers in my macro, let’s say [10,12,20,34,41].
    And I want to have different look of those lines in the editor window.
    For example, if the numbers could be lines with compiler warnings.
    it is weird to click each line in output window to find it in editor window (altought sometimes it is useful too). Much better to have the lines highlihted in the editor window.
    Also, some tools (notably Visual C++ run with /analyze command line switch) may output a few lines numbers for each error or warning, thus make unuseful location the errors by the tag regexp.
    May by the solution is to write a plugin to hook the points where emeditor calls WinAPI to draw the text. But it seems to be a quite complex hack.
    November 25, 2008 at 12:56 am #6668
    Yutaka Emura
    Keymaster
    masha wrote:
    No, it is not what I want.
    I have array of integers in my macro, let’s say [10,12,20,34,41].
    And I want to have different look of those lines in the editor window.
    For example, if the numbers could be lines with compiler warnings.
    it is weird to click each line in output window to find it in editor window (altought sometimes it is useful too). Much better to have the lines highlihted in the editor window.

    Also, some tools (notably Visual C++ run with /analyze command line switch) may output a few lines numbers for each error or warning, thus make unuseful location the errors by the tag regexp.

    May by the solution is to write a plugin to hook the points where emeditor calls WinAPI to draw the text. But it seems to be a quite complex hack.
    OK. In Configuration Properties, select Highlight (1) tab, and then you can enter a regular expression to highlight certain numbers. For instance, ^[0-9]+? will select first numbers at each line.
    November 25, 2008 at 8:13 am #6670
    masha
    Member
    I do not need to hightlight the numbers itself, i want to highlihg the lines.
    having [10,12,20,34,41] I want to highligt tenth, twelfth, twentieth, thirtyfourth and fourtyfirst LINES, but not the numbers.
    I know that the could be regexp like (10|12|20|34|41), but there is no the numbers in the text.
    November 25, 2008 at 9:48 pm #6676
    Yutaka Emura
    Keymaster
    masha wrote:
    I do not need to hightlight the numbers itself, i want to highlihg the lines.
    having [10,12,20,34,41] I want to highligt tenth, twelfth, twentieth, thirtyfourth and fourtyfirst LINES, but not the numbers.
    I know that the could be regexp like (10|12|20|34|41), but there is no the numbers in the text.
    In this case, you cannot change the color of particular line numbers. Howerver you can toggle bookmarks on particualr lines if you would like. Bookmarks can be set by using SetBookmark Method (Selection Object) if you write a macro.

  • Author
    Posts

Viewing 8 posts - 1 through 8 (of 8 total)

  • You must be logged in to reply to this topic.

Also read:

https://techidaily.com
  • Title: Macro Editing: Find & Highlight Text with EmEditor - A Comprehensive Guide
  • Author: Timothy
  • Created at : 2024-10-15 17:15:26
  • Updated at : 2024-10-17 16:45:44
  • Link: https://win-unique.techidaily.com/macro-editing-find-and-highlight-text-with-emeditor-a-comprehensive-guide/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Macro Editing: Find & Highlight Text with EmEditor - A Comprehensive Guide