Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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).

    #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.

    #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.

    #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).

    #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.

    #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.

    #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.

    #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.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.