Skip to content
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: Second Long Line Marker / Long Comment Marker #2598

Open
brownbat opened this issue Sep 25, 2020 · 1 comment
Open

Feature Request: Second Long Line Marker / Long Comment Marker #2598

brownbat opened this issue Sep 25, 2020 · 1 comment

Comments

@brownbat
Copy link

Currently Geany already provides one long line marker, which I find extremely helpful.

I find it so useful, in fact, I can think of a few situations where I could use an extra one.

Primarily -- Python's PEP 8 recommends 72 characters for docstrings, though the real code's line limit is longer.

Additionally -- Others may be working in heavily indented code and could use a vertical indicator for some specific nesting level, to help keep their place.

So if possible, I'd love the ability to set two separate long line markers of different colors in settings. (The second one would be turned off by default of course), just so I can watch one column for comments and the other for code.

Thanks for the project, it's been a huge help!

@xiota
Copy link
Contributor

xiota commented Oct 27, 2021

This can be done with the GeanyLua plugin. Here is a script that implements the feature: column-markers. You can add as many column markers as you like.

The script sends messages to scintilla:

-- set multiple column marker mode
geany.scintilla ("SCI_SETEDGEMODE", 3, 3)

-- clear current markers
geany.scintilla ("SCI_MULTIEDGECLEARALL", 0, 0)

-- add new column markers, colors are in BGR order
geany.scintilla ("SCI_MULTIEDGEADDLINE", 60, 0xe5e5e5)
geany.scintilla ("SCI_MULTIEDGEADDLINE", 72, 0xf0c098) -- blue
geany.scintilla ("SCI_MULTIEDGEADDLINE", 80, 0xdd8add) -- purple
geany.scintilla ("SCI_MULTIEDGEADDLINE", 88, 0xe5e5e5)
geany.scintilla ("SCI_MULTIEDGEADDLINE", 96, 0x5161f6) -- red

Each document maintains it's own set of markers, and new documents are created with the default Geany marker. So the script needs to be run for each document. This can be done by editing event scripts located at ~/.config/geany/plugins/geanylua/events. I've found that activated.lua is currently the best script to use for this. To apply the setting to documents when Geany is first started requires signals that GeanyLua doesn't currently handle (geany-plugins#1112).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants