This is a patch to add vim-like tagstack capability to
NEdit. When you make a successful call to "Find
Definition", the current window position is pushed into
a LIFO stack before make jump, where you can later
return the position by popping the tagstack.
patch v1 for 5.3. original release
readme for tagstack patch v1
Logged In: YES
user_id=121553
I like the idea a lot -- in fact, I do this already with a set
of macros and the mark functions. I'd like to see it
built-in, though, since my way is pretty awkward to set
up and has its shortcomings (only 10 locations and
potential interation problems with other macros).
I'd actually like to see it go further. I'd like the option of
making more of the search operations push to the
tagstack. I often need to search for a definition then
return to my location, and I always forget to set a mark
before I do the search.
Really, I'd love to see a browser-like history, which
wouldn't be so much more difficult than a stack, but first
things first...
Logged In: YES
user_id=411637
I forgot to mention explicitly this tagstack is cross-window.
bookmarks are currently local to windows, so it won't work
most of the time, especially on serious projects using
modular languages.
on pushing the search operations, I guess might be better to
maintain a separate stack, else it might make the tagstack a
bit too crowded and probably confusing. hmm...
I had done some experiment with the history list, but put it
aside after awhile. maybe I should look at it again.
Logged In: YES
user_id=75224
I have actually implemented the same functionality, but I
never got around to provide a proper patch. If your patch is
included I'll be happy to scrap my work.
I have a few nitpicks:
- in menu.c you shouldn't provide the 'pop-tagstack' and
'clear-tagstack' action routines. New action routines should
use underscore, and existing action routines with dashes are
only there for backward compatibility.
- in tags.c you have defined a static function
normalizePathname, but not provided a definition for it.
Logged In: YES
user_id=411637
AFAIK, YunLiang Yu also had done some work on it awhile
back, but it was never 'officially' released. And I didn't
want to wait.
Please don't scrap your patch, submit it. I am sure there
are things we can learn from each other. To me, it was never
about competition.
Now only I've come to understand why there are two flavors
of action routine names. Thanks for the information.
Patch v1.1 has the clean up.
tagstack patch v1.1 for 5.3. with housekeeping
v 1.2: updated to CVS -D 27-Mar-03
Logged In: YES
user_id=11321
I do like the idea, but it's hard for me to weigh an opinion here without adding the patch and trying it.
Maybe if we could write up a UI spec, that describes all the new user-visible functionality (just a few paragraphs, really) for this. E.g., how do I "return to the position"? Is there a web-browser like "Back" button?
Then we can discuss on the group what a good UI will be for this, before it hits CVS. Otherwise, the UI tends to churn a lot in code. The idea is to churn the UI with words first.
Logged In: YES
user_id=411637
There's no fancy window or any GUI appearances for now,
just a plain Shift-Ctrl-D to do the opposite of Ctrl-D, so I
don't have to run through the long window list to find my way
back. Quite honestly, I couldn't have written those code as
fast, if not because of the patch.
It'd be nice if we could have a more complete design to
handle tags manipulation. But in some way, it's fixing a bug.
updated for NEdit-5.5
Logged In: YES
user_id=411637
Uploaded patch for NEdit 5.5
Logged In: YES
user_id=411637
Uploaded tagstack-v1_0.menu - a macro implementation of the
tagstack feature.
Two macros are implemented: 'find tag' and 'pop tag', which
are bound to Ctrl-] and Shift-Ctrl-] respectively.
Use nedit's -import option to apply the macro, then save the
default preferences to keep them:
nedit -import tagstack-v1_0.menu
macro v1.0: a macro implementation of tagstack
this is great!
is there a way to remap the keys from ctrl+], ctrl+shift+] to ctrl+d, ctrl+shift+d ??
thanks
v1_2 doesn't work with nedit 5.6 (i.e. the current CVS HEAD) - any chance to have an updated version?
It should probably be changed to get the new ignoreModify flag into account?
View and moderate all "patches Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Patches"
the patch is so old that I am not even sure I can update it to HEAD. Beside I'd really recommend you try the macro version. And it's actually a much more portable solution than patching the core. The only issue that NEdit doesn't have good system to import/setup the macros & their menus easily. Have you tried it?
Patch updated to NEdit 5.7+
FYI, this patch can found on the github branch below:
https://github.com/tksoh/nedit-git/commits/tagstack
@tksoh
I am intrigued by this patch, and think it is a good candidate for porting to nedit-ng, but have a few questions :-).
you said that unlike bookmarks, it is "cross-window", I assume that means that it will activate the appropriate window if you moved away since?
Bookmarks have a mechanism to seemlessly move the bookmark if the text is edited after the bookmark is made. For example if your text buffer just has "Hello world" and you bookmark position 6, it points to the start of "world".
if you then type some text between the two words, for example, making it "hello friendly world", the bookmark is then seemless adjusted to still point at world.
Does this tag stack have any similar mechanism?
Last edit: Evan Teran 2020-12-16
On your questions:
Scott originally suggested making a GUI for it. Back then, I wanted to keep it minimalist, and let the menu do the work, since that makes the patch a lot easier to maintain not having to worry about all the corner cases. But perhaps something to think about if we are to port it into nedit-ng.
@tksok nice!
it sounds like it works perfectly as one would expect. So regarding GUI/minimalist. My personal opinion is that it's ok to introduce new features with minimalist GUIs because we can always add a nice GUI for the feature after it's in.
I definitely think this feature would make a nice addition to NG.
Perhaps we can start by porting the current implementation into NG, and then work on the GUI along the way as further enhancement?
@tksoh That's exactly what I was thinking. Since it's a port of your patch efforts, you can take the lead on this effort if you like. I'll be more than happy to help though, especially regarding how the Qt code factors in if you need it.