Creating new file - set cursor on it after saving

Something is missing in Far Manager? You have a great idea that should be heard? Write here.
Post Reply
KlepetoX
Posts: 129
Joined: Sun 08 Jan, 2012 08:23
Location: Czech Republic
Has thanked: 2 times
Been thanked: 1 time

Creating new file - set cursor on it after saving

Post by KlepetoX »

When I create a new archive or new folder, then cursor is set on the new folder/file. But if I create new file with ShiftF4, the cursor is not set on the new file after saving. Why? If FAR doesn't know it, how can I create macro to replace std. ShiftF4?
User avatar
HaRT
Moderator
Posts: 10937
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 224 times
Been thanked: 362 times

Creating new file - set cursor on it after saving

Post by HaRT »

Use CtrlF10 from within the editor.
Фар есть инструмент, а не нянька. © 2009 DrKnS
KlepetoX
Posts: 129
Joined: Sun 08 Jan, 2012 08:23
Location: Czech Republic
Has thanked: 2 times
Been thanked: 1 time

Re: Creating new file - set cursor on it after saving

Post by KlepetoX »

Thanks, works fine with macro

Code: Select all

Keys("F2 CtrlF10 Esc")
on my CtrlEnter which closes editor with saving. It's my fault that I have never noticed CtrlF10 shortcut.
joric
Posts: 7
Joined: Sun 29 May, 2022 01:15
Been thanked: 1 time

Creating new file - set cursor on it after saving

Post by joric »

Thanks! Did it by adding this file (Edit.F2.lua) to Far3/Profile/Macros/scripts, now every F2 sets cursor to edited file:

Code: Select all

Macro {
  description="Editor: set cursor to file";
  area="Editor";
  key="F2";
  action=function()
    Keys("F2 CtrlF10")
  end;
}
Post Reply

Return to “Suggestions and Ideas”