Replies: 4 comments 13 replies
-
I disliked it as well, originally. But now I have gotten very used to it. In fact, I have scripts that use the line/column position of the matching entries. So, if you decide to change this behavior, please have an option where the original behavior can be restored, or some other way to retrieve the line/column position of all matching entries. Maybe this needs its own discussion too 😟 |
Beta Was this translation helpful? Give feedback.
-
Wow! So, it can all be done in a macro. Maybe we will just go this way and close this discussion? 😀 Joking aside, I thought about toggling alignment, and decided that I would not like it. Thus, a macro implementation makes perfect sense to me. You will use it, and I will not. Everyone is happy. Your macro, as it is, has one minor issue. The keys which shift individual items, like So, what do you think about a new Plugin API which returns the actual, current state of annotation alignment, effectively, the value of Keys(IsAligned and "AltHome" or "CtrlClear") (Well, another line or two will be required to invoke the new API.) If you like the idea, could you please point me to an existing Lua API which retrieves some kind of state from a UI control? I've never implemented a Lua API, and my usual method of learning is implementing something following an existing pattern. |
Beta Was this translation helpful? Give feedback.
-
If adding new APIs to retrieve menu alignment from FAR, please consider it providing more data than a single bool. E.g. Left/Center/Right/Match/None. |
Beta Was this translation helpful? Give feedback.
-
It is good that you described all the shortcuts that are available in the results window. Now you would still need to add them to the help file in the @FindAllMenu section, and improve the translation of the program window (in Polish, instead of "Grey +" it should say "Szary+"), etc.. BTW - the space between "Grey +" and "Grey -" is a bit confusing, and should be unified everywhere to "Grey+" and "Grey-" - what do you think? |
Beta Was this translation helpful? Give feedback.
-
A new feature was recently added to Far, that allows you to vertically align all the matching entries using
Ctrl+Numpad5
/Ctrl+Clear
key. See PR #789 by @MKadaner for details.This discussion is to weigh the pros and cons of using
Ctrl+Numpad5
to toggle between center-aligned and left-aligned.Current Design
When you press
Ctrl+Numpad5
, the matching entries are center-aligned. PressingCtrl+Numpad5
again has no effect. You can pressAlt+Home
to restore the default left-alignment, andAlt+End
to right-align the items. You can also use a number of other keys likeAlt+Shift+Left
to manually align the items.Proposed Design
When you press
Ctrl+Numpad5
, the matching entries are center-aligned. PressingCtrl+Numpad5
again would align the items to the left (default alignment). Pressing it again would center-align the items. So,Ctrl+Numpad5
would work as a toggle between center and left alignment.This would allow you to quickly switch between center and left-alignment, without having to use a different key combination. It has some other benefits like being able to quickly check line numbers that may be hidden when the items are center-aligned.
Please see the original discussion starting from #789 (comment) for more information.
Macro for Testing Proposed Design
I have written a Lua macro that implements the proposed design. You can download it from
Editor.FindAll.ToggleAlignment.lua.zip
. Once you install the macro,Ctrl+Numpad5
will toggle the matching entries (annotation) alignment from center to left and vice-versa.Macro Installation Instructions
Editor.FindAll.ToggleAlignment.lua
from the attached archiveEditor.FindAll.ToggleAlignment.lua.zip
Editor.FindAll.ToggleAlignment.lua
to%FARPROFILE%\Macros\scripts
macro:load
to reload macros, or restart Far.Macro Source Code
The macro has a flag
ALWAYS_TOGGLE
. You can set it totrue
to test the behavior discussed in the first paragraph of #789 (comment). My preference is the default behavior with this flag set tofalse
.Attached Files
Editor.FindAll.ToggleAlignment.lua.zip
Beta Was this translation helpful? Give feedback.
All reactions