-
-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Ability to use $EDITOR to write comments #1380
Comments
It's good to hear that you're making use of comments/tags. I don't always know what functionality folks are using and am sometimes tempted to remove things. As for the editor, I've always wanted to replace readline with a builtin multiline editor. I think I'll finally bite the bullet and do it for the version after the upcoming v0.12.4 release. In the case of comments, I can imagine clicking on the comment in the main view and you can just start editing right there instead of down in the prompt.
The current readline functionality works by running readline in a subprocess and emulating a vt52 console. I've always thought about doing that for other programs, but I suspect it would be pretty finicky. |
I've pushed a change to get this working in the main prompt. Here's a capture of it in action: multiline-comment.mp4So, when you enter The top-of-tree is still unstable, but if you have some time to give it a go, I'd be interested in your feedback. Thanks. |
Yeah sure I can check it out. Is there a link to a nightly build for Linux I can find or should I just build from sources. My initial thoughts are, already looks a lot more useable for multiline comments than before. Seems reasonable to only show abt 3-5 lines of the the block since you can see what was commented there above anyways. I think I would maybe consider making it so the first line of the comment is on a new line, it seems a little strange to see the test on the same line as the comment, could you edit the :comment part? Otherwise looks good except I don't know EMACS keybinds yet, but I'm since I was mostly looking for multiline paragraph writing keybinds won't make a massive difference. |
The bins workflow produces binaries on any changes. Here's a recent one: https://github.com/tstack/lnav/actions/runs/13395971018
That's possible, I can experiment with it.
Yes, it's still the same command prompt. So, you could change the
They're basically the same as the readline hotkeys, but there are a couple more. I need to wire up |
Interesting, yeah I don't know about what's easier to implement, but if that's glitchy and hard to get working I'd think that just having it be there but not considered part of the command prompt anymore is fine. I don't think people would often want to change the command away from |
I'm not sure if it's from these changes or not but, I'm also wondering is |
It's not terribly hard to get working. Making the
It's these changes, I haven't gotten around to restoring that yet.
The completion logic is opening the popup on the 2nd line with "comment" selected for some reason. Not sure why it's suggesting that, probably not hard to fix. |
Just thought I'd add that I have a script called
|
Hmm, I thought the comment was already pre-populated when you type out |
Hmm, yeah it doesn't seem to populate the comment for me, maybe not on the latest or maybe bug in my environment. |
Thanks for the heads up on that. I’m out right now, I will follow up later |
Ah I see you get the comment there if you use tab complete (I didn't realise that existed good to know). I guess what makes my script special then is I can bind a key to it so that I don't have to type Edit: |
Ah, yes, the prefill only working on tab-complete is the bug. I tried a really old version (v0.10.1) and there it would work when pressing space.
I think this is working again on top-of-tree. |
Just FYI: as mentioned in #1396, pressing |
Sounds maybe useful for writing comments, definitely super useful for writing lnav scripts tho and playing around with sql queries! |
:comment
and:tag
functionality is awesome. It's super useful to be able to write comments to both keep landmarks for yourself to know where you are, as well as to call out potentially buggy behaviour. I've also found them useful for documenting buggy behaviour with logs by using a script that writes out the logs and comments in a markdown file.For this second purpose, having the ability to edit longer comments in an editor of choice instead of command line would be super useful. Especially with the support for markdown and newlines. It would be a lot less tedious to handle new lines. And a text editor may have syntax highlighting for markdown.
Hopefully this isn't too hard to implement, I'm not sure how curses is with allowing editors to take over.
The text was updated successfully, but these errors were encountered: