kgrossjo / atom-man

Display a man page inside Atom.
MIT License
5 stars 1 forks source link

Support searching man for the word under cursor. #9

Open nekromant opened 7 years ago

nekromant commented 7 years ago

Subj. Many of APIs are documented in man, so searching them by typing the function name all the time is pain.

kgrossjo commented 7 years ago

Thank you for this suggestion, it makes a lot of sense. I think the code was quite out of date with respect to Atom APIs, so I've now rewritten the whole thing (mostly), in Javascript, and I've incorporated your feature wish. Would you like to check if the new version does the right thing?

Also, I think the output looks very ugly, and I'm thinking it might make more sense to show the output in a regular text editor. I've wanted to do that all along, but I wasn't able to format the text correctly. But now, Atom has decorators, and I think with these, I should be able to make things bold and so on, right in a text editor. What do you think?

nekromant commented 7 years ago

Thanks, it works! But with one minor annoying issue: If the word under the cursor is selected. e.g. printf("blah") (The bold marks the selection), there will be printf(" in the search box.

kgrossjo commented 7 years ago

I'm not clear what to do about this. Within man pages, you might find things like crontab(1) and crontab(5), referring to the man pages in section 1 and 5 of the manual, respectively. (crontab(1) describes the command, and crontab(5) describes the file format.)

kgrossjo commented 7 years ago

@nekromant I've now got a new view implementation, based on a text editor, not using the HTML output. On my system, I think it improves the way the ls man page looks. If you're interested, feedback would be great!

Edit: On macOS, the ls man page lists options, but each option letter is flush left, instead of intended the appropriate level of the descriptive text. Maybe on Linux, it's okay.