GNU nano - Bugs: bug #62269, [Wish] a way to save and restore...
You are not allowed to post comments on this tracker with your current authentication level.
bug #62269: [Wish] a way to save and restore anchors
Submitter: | Shi Yanling <sylphenix> | ||
Submitted: | Fri 08 Apr 2022 02:42:52 PM UTC | ||
Severity: | 1 - Wish | Status: | None |
Assigned to: | None | Open/Closed: | Open |
( Jump to the original submission )
Wed 22 Jun 2022 07:20:07 AM UTC, comment #7: |
Benno Schulenberg <bens>![]() |
Wed 15 Jun 2022 07:05:32 AM UTC, comment #6: Just adding to the conversation that this functionality can be reasonably approximated via very simple macros which you can define in your nanorc. :)
|
Tasos Papastylianou <tpapastylianou> |
Sun 08 May 2022 02:33:30 PM UTC, comment #5: Interesting mechanism: an anchor at the first line "magically" making nano save the anchors (when --positionlog or 'set positionlog' is active). This "invisible" mechanism kind of fits the anchors that themselves are normally invisible too. But from a usability point of view... I doubt that anyone would like this.
|
Benno Schulenberg <bens>![]() |
Fri 06 May 2022 06:40:28 AM UTC, comment #4: Automatically saving/restoring anchors is better. But if there's an option to activate such feature, I won't turn it on by default. As my routine editor, I don't need it to save anchors in most cases, and do not want it to scan over all the lines every time I close a file. So I have to decide whether to turn the option on or not before I open a file.
|
Shi Yanling <sylphenix> |
Fri 15 Apr 2022 01:45:03 PM UTC, comment #3: Having two functions (one to save anchors, and one to reload them) would require two keybindings. Of course, the functions could be unbound by default, but that would make them undiscoverable -- unless they are mentioned listed the main ^G list of shortcuts, but I really don't want to burden that list with such exotic functions.
|
Benno Schulenberg <bens>![]() |
Mon 11 Apr 2022 02:19:40 PM UTC, comment #2: Thanks for thinking about my request. I didn't mean that automatically save anchors while saving a file and restore them when reopening the file. My thought was that have two functions, one could export anchors to a specified file, and the other one could import it later. The file is specified by user when the function is called. So that we could have the ability to manually export/import anchors just when we want to. I think it wouldn't add slowdowns to nano. I'm not sure that I can accomplish such a patch. But I'd like to have a try when I have time. |
Shi Yanling <sylphenix> |
Sun 10 Apr 2022 10:47:52 AM UTC, comment #1: Where should those anchors be saved? In another file in ~/.nano? I don't want to create any more state files for nano. Then maybe add them in ~/.nano/filepos_history, at the end of each line? That would create complications when an old filepos_history file does not yet contain any anchor data, but... it seems feasible to solve that. However, saving the anchors would require running through all of the lines of the file to see whether anyone has an anchor, which takes some time (not much, but still), and I am loathe to add any more slowdowns to nano. But you are welcome to provide a patch if this feature is important to you. No guarantees that it will be applied, though. |
Benno Schulenberg <bens>![]() |
Fri 08 Apr 2022 02:42:52 PM UTC, original submission:
I'm trying to code with nano. Anchors are very useful to me, since there are thousands of lines. But anchors can't be saved. When I reopen the code, I have to place those anchors again. I'd like to have the ability to import/export anchors. Or is there any good solution else? Thanks. |
Shi Yanling <sylphenix> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Your ability, Tasos, to think in macros is /fabelhaft/ (as the Germans say). :) But the need to first prepare a side buffer, give it a name, and save and close it afterward, and later having to open a side buffer and load the correct file and restore the anchors one by one... it's all far too many keystrokes and too much mental overhead for anyone to actually do this. Not simples at all. :)