[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] alternative anchoring: allowing to set multiple "bookma

From: Brand Huntsman
Subject: Re: [Nano-devel] alternative anchoring: allowing to set multiple "bookmarks"
Date: Thu, 8 Nov 2018 19:32:35 -0700

On Thu, 8 Nov 2018 19:36:21 +0100
Benno Schulenberg <address@hidden> wrote:

> Furthermore, those editors most likely want to offer the most
> versatile mechanism possible, not caring much about how much code or
> memory this requires.  Nano is a *simple* and small editor.  It
> offers basic and simple features.  And when it offers something that
> is a little more advanced, it offers a simple version of it.

You keep using "simple and small" to justify half-assing features. Nano is 
growing larger and not actually gaining useful features that anyone other than 
yourself can use. Do it right or don't do it at all.

For the record, Marco's version is better and more useful, but I wouldn't use 
either one. I place numerous markers in my files, similar to your XXX example. 
Your incomplete anchoring is worthless for my use case, it doesn't even 
preserve the anchor after returning to it. I also open the same file in a 
second instance and neither of these patches preserves the anchors across 
instances, nor do they preserve anchors if I close nano.

These three macros require ZERO code and are more useful than both patches:

bind key1 "${home home}XXX marker XXX${enter left comment}" main
bind key2 "${whereis}XXX marker XXX${enter}" main
bind key3 "${wherewas}XXX marker XXX${enter}" main

Everyone can customize their own marker text and even add syntax highlighting 
if they wanted to go that far.

What would be nice is if nano could get a toggle in the search prompt that 
wouldn't save the query to history and doesn't persist across searches like 
regex/case toggles do. The toggle should also clear the regex/case toggles for 
the current search, so macros could run in a known state. As I've said before, 
more effort should be spent on scripting than on worthless features that could 
be implemented via proper scripting.

Btw, v2 of your(benno) patch has so many issues. This patch will most likely be 
pushed to master despite no one wanting it, so I must point out its problems. 
All of which can be fixed by checking if the anchor line is actually still in 
the file before jumping to it. And also by checking if anchor_x is less than 
length of anchor line, which might have been shortened.

Set anchor anywhere in line, delete line, go to another line and jump to 
anchor. Statusbar tells me it jumped to the anchor, it clearly did not.

In the above case, the cursor moves to anchor_x on current line, but sometimes 
it also jumps to a random line. Typing causes random issues, such as text 
before cursor vanishing.

Set anchor anywhere in line, delete line, undo the delete, jump to anchor. It 
jumps to first line. Now move cursor down, first line is now last line in file. 
Repeat that but set the anchor on the second page of file, the jump clears edit 
window, only showing the anchor line.

Set anchor at end of a long line, delete line, go to another shorter line and 
jump to anchor. It places cursor at an unreachable position in current line and 
then crashes nano when you move cursor.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]