How to make Far3 editor to highlight a specific word?

Here you can discuss about your favorite plug-in.
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

How to make Far3 editor to highlight a specific word?

Post by kamil »

I used to have this nice editor plugin, that was highlighting all the visible occurrences of a specific word when I just pressed "Alt" having a cursor on it.
It was also drawing a crossed lines while pressed ctrl+shift (so I could easily find the cursor).
The plugin was called CRest: http://plugring.farmanager.com/plugin.php?pid=311&l=en

Unfortunately this plugin does not seem to be quite compatible with the recent version of Far, to which I switched some time ago because it has some other great features...

But the highlight word function was very useful for me and I really miss it, so do you maybe know any other way to have such a functionality with the recent Far3?
Max Rusov
Posts: 3651
Joined: Wed 23 Nov, 2005 11:11
Location: Москва-Питер
Has thanked: 2 times
Been thanked: 19 times

Re: How to make Far3 editor to highlight a specific word?

Post by Max Rusov »

You can try EdtFind
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

Re: How to make Far3 editor to highlight a specific word?

Post by kamil »

Perfect - thank you very much!
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

How to make Far3 editor to highlight a specific word?

Post by kamil »

Hello again :)

I was using a lot the "Pick Word" function of EdtFind plugin

Unfortunately it does not work anymore with the latest builds of Far (x64)
Now it only highlights the word that the cursor is at, but never the other occurrences of it.

I checked that it stopped working in Far.x64.3.0.5821.2250.278be7df57b43fa31263715b84f65b5fc6d07c1e.7z (Jun 14, 2021)
It was still working in Far.x64.3.0.5820.2249.956e9deb51627996b6cf7e115ecd7a0914b505af.7z (Jun 12, 2021)

I am not sure what is the problem.
Can anyone please help me to get this function working again?
Or do you know another Plugin that can do it?
Last edited by kamil on Wed 07 Sep, 2022 19:41, edited 3 times in total.
Shmuel
Posts: 6815
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 41 times
Been thanked: 526 times

How to make Far3 editor to highlight a specific word?

Post by Shmuel »

Try any/both of the following:
  1. %FARHOME%\Addons\Macros\Editor.ColorWord.moon - copy it to %FARPROFILE%\Macros\scripts and restart Far.
  2. Plugin LF Search.
User avatar
citRiks
Posts: 1733
Joined: Fri 25 Oct, 2019 18:18
Has thanked: 610 times
Been thanked: 102 times

How to make Far3 editor to highlight a specific word?

Post by citRiks »

kamil,
for reference, you may try this as well:
https://github.com/dr-dba/far-lua-editor-color-word
It has some dependencies on other Lua modules, thus being less easy to install for a newcomer.
though, as the author of it, i may help you if needed
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

How to make Far3 editor to highlight a specific word?

Post by kamil »

Shmuel wrote: Wed 07 Sep, 2022 19:53 Try any/both of the following:
  1. %FARHOME%\Addons\Macros\Editor.ColorWord.moon - copy it to %FARPROFILE%\Macros\scripts and restart Far.
  2. Plugin LF Search.
Thanks, but:
  1. This macro does not seem to be doing anything for me. Is it supposed to highlight word under cursor, when I press F5? It does nothing. I can see it installed in my Macro Browser plugin (can even execute it from there, but also does nothing).
  2. How do I highlight the word under cursor using LF Search?
Last edited by kamil on Thu 08 Sep, 2022 09:15, edited 1 time in total.
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

How to make Far3 editor to highlight a specific word?

Post by kamil »

citRiks wrote: Thu 08 Sep, 2022 07:13 kamil,
for reference, you may try this as well:
https://github.com/dr-dba/far-lua-editor-color-word
It has some dependencies on other Lua modules, thus being less easy to install for a newcomer.
though, as the author of it, i may help you if needed
OK, thanks - I will be happy to try.

I see it has 3 dependencies.
How do I install them?
Shmuel
Posts: 6815
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 41 times
Been thanked: 526 times

How to make Far3 editor to highlight a specific word?

Post by Shmuel »

kamil wrote: Thu 08 Sep, 2022 08:42 This macro does not seem to be doing anything for me. Is it supposed to highlight word under cursor, when I press F5?
Yes. and it must work out of the box. Probably you either didn't copy the file to the right location or didn't restart Far.
kamil wrote: Thu 08 Sep, 2022 08:42 How do I highlight the word under cursor using LF Search?
There is a "Highlight all" checkbox in the "Find" dialog.
One could write a macro that would invoke the dialog, activate the checkbox and press Enter.
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

How to make Far3 editor to highlight a specific word?

Post by kamil »

Shmuel wrote: Thu 08 Sep, 2022 09:30 Yes. and it must work out of the box. Probably you either didn't copy the file to the right location or didn't restart Far.
No, it does not work with a new Far.

Funny thing though - it works with build 5820, but not with 5821
It seems like the same problem EdtFind has (except it does not even highlight the word under cursor)
Last edited by kamil on Thu 08 Sep, 2022 10:57, edited 2 times in total.
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

How to make Far3 editor to highlight a specific word?

Post by kamil »

kamil wrote: Thu 08 Sep, 2022 08:54
citRiks wrote: Thu 08 Sep, 2022 07:13 kamil,
for reference, you may try this as well:
https://github.com/dr-dba/far-lua-editor-color-word
It has some dependencies on other Lua modules, thus being less easy to install for a newcomer.
though, as the author of it, i may help you if needed
OK, thanks - I will be happy to try.

I see it has 3 dependencies.
How do I install them?
OK, I managed to install it, but it has the same problem as the others:
  • On build 5820 it works fine
  • On build 5821 it only highlights one word (under the cursor), but not the others visible on the screen.
Shmuel
Posts: 6815
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 41 times
Been thanked: 526 times

How to make Far3 editor to highlight a specific word?

Post by Shmuel »

kamil wrote: Thu 08 Sep, 2022 10:54
Shmuel wrote: Thu 08 Sep, 2022 09:30 Yes. and it must work out of the box. Probably you either didn't copy the file to the right location or didn't restart Far.
No, it does not work with a new Far.
Funny thing though - it works with build 5820, but not with 5821
It seems like the same problem EdtFind has (except it does not even highlight the word under cursor)
I tested it today with Far3.0.6003 x64 with a new profile. It worked OK.
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

How to make Far3 editor to highlight a specific word?

Post by kamil »

I see there was this change in 5821:

Code: Select all

drkns 14.06.2021 19:10:39 +0100 - build 5821

1. Removed the workaround for plugins that erroneously add transparent editor highlighting.
   Transparency is now taken into account.
   If your plugin/script suddenly stopped working - fill the colors properly.

So how do I modify Editor.ColorWord.moon script to fill the colors properly?
Last edited by kamil on Thu 08 Sep, 2022 11:05, edited 1 time in total.
kamil
Posts: 44
Joined: Fri 13 Apr, 2012 19:19
Has thanked: 8 times

How to make Far3 editor to highlight a specific word?

Post by kamil »

Shmuel wrote: Thu 08 Sep, 2022 11:04 I tested it today with Far3.0.6003 x64 with a new profile. It worked OK.
I have just tried with Far.x64.3.0.6003.2853.85a28204fd6c62960664e4e2cc55047c3701a571.7z - still not working.

Maybe it has something to do with the windows console, that it works in some systems, but not the others?
Shmuel
Posts: 6815
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 41 times
Been thanked: 526 times

How to make Far3 editor to highlight a specific word?

Post by Shmuel »

In your 6003 installation rename Far.exe.example.ini to Far.exe.ini then change the line
;UseSystemProfiles=1 to UseSystemProfiles=0 then run the Far.
Post Reply

Return to “General Plug-In Discussions”