Obviously the changes shown so far aren't intended to work or compile. Anyone want to hold my hand to start on this patch for #2068 though? I thought I'd take advantage of this new GitHub "draft pull request" feature and make it a little easier for someone to help me get started on it.
So I'm not at all sure how to approach this patch yet. Am I in the right ball-park as far as which files I'm editing? You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2140
-- Commit Summary --
* start on issue #2068 * add more code to work with
-- File Changes --
M data/filedefs/filetypes.common (3) M src/highlighting.c (6) M src/sciwrappers.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/2140.patch https://github.com/geany/geany/pull/2140.diff
I'm just gonna face the fact that I don't know how to do this...
Closed #2140.
codebrainz commented on this pull request.
@@ -96,7 +96,8 @@ enum /* Geany common styling */
GCS_LINE_HEIGHT, GCS_CALLTIPS, GCS_INDICATOR_ERROR, - GCS_MAX + GCS_MAX, + SCI_SYMBOL_FOLDING_MARGIN_WIDTH
`GCS_MAX` needs to be last since it tells the length on the enumeration. New enumerator should be named something like `GCS_FOLDING_MARGIN_WIDTH` or whatever is appropriate.
I generally look at an old commit which does something similar and try to copy it as much as possible. For example 443ee99e7eed299be1955e453b8cd2675ecbd356 looks kind of similar.
Reopened #2140.
@codebrainz thanks I'll take a closer look
Getting a lot closer, but I still don't understand the code well. What's the next step?
I think I'm confused about this for more than reason. I'm doing something with SYMBOL_MARGIN_WIDTH but the symbol margin as I understand it is the left-hand pane, in which the width is already resizable.
Correct me if I'm wrong, but it would make more sense to try this with the line number margin, which currently does not have a resizable width.
No, the Scintilla symbol margin has no connection to the sidebar pane. Its the margin between the line numbers and the folding where symbols marking lines go.
Maybe the confusion is that the word "symbol" is overloaded. To Scintilla it means icons, to Geany it means programming language identifiers.
Certainly try another one first if its confusing :)
ok
So what's the folding margin being referred to by @DevynCJohnson in https://github.com/geany/geany/issues/2068#issue-403895742?
Correct me if I am wrong, but I do not see a way to change the width of the folding margin. It also appears that fold.on.open does not work in Geany. Could a feature be added so that users have access to setting the properties that would normally be seen in a SciTEGlobal.properties file? For instance, I am needing to change fold.margin.width=24 and fold.on.open=1.
The thing on the right of the line number pane where the "-" signs are? Or does the folding margin include that plus the line number pane? And what vars should I be looking for to start on that and make the width of it user-configurable? Is the goal to have the width set by click-dragging and the value updates in filetypes.common, or the user has to manually edit a configuration file like @DevynCJohnson mentioned?
I did try finding the answer on my own first, btw :) For example I changed lineNumberWidth to 80, just to see what would happen. Nothing happened. To be sure I'm trying the latest changes, I'm installing to a "test" directory, using the '-i' and '-c' options, and uninstalling and re-installing after each code change.
https://github.com/geany/geany/blob/770cda40646e8ebfe6591df03356e2bcb71b875c...
The thing on the right of the line number pane where the "-" signs are?
Yes, the one where you click to open/close [folding](https://www.geany.org/manual/current/index.html#folding). I presume thats what the OP meant.
I did try finding the answer on my own first, btw
No problem, only comment on your experiment is to maybe only fiddle with things in the Scintilla API, since thats all you will be able to change in the final product, not internals of Scintilla :).
The Scintilla margin API is [here](https://www.scintilla.org/ScintillaDoc.html#Margins)
And its set in Geany [here](https://github.com/geany/geany/blob/770cda40646e8ebfe6591df03356e2bcb71b875c...) (HINT: found by getting Geany to "find in files" for SCI_MARGIN which is shown in the Scintilla API) but notice that the width is hard coded 12 to show it and 0 to hide it. So what you need to do is to have a setting that changes the hard coded 12 to a setting value.
@andy5995 pushed 1 commit.
65e968a571f8882508ab80d2dcbeb99c9f3ea6ba soft-code setting for width of folding margin
@andy5995 , Thanks for this change! I downloaded ( https://github.com/geany/geany/pull/2140.patch ) and applied the patch. This is exactly what I was wanting. Now, I can easily modify filetypes.common, add `folding_margin_width=`, and then apply the width I desire.
Hey that's great to hear @DevynCJohnson . :) Thanks for testing and letting me know it worked for you. I'll see if I can get it reviewed and merged in soon.
@andy5995 I've had a look, the only thing is that having moved `sci_set_folding_margin_visible` to the file where its (only) used and made it static the `sci_` prefix should be removed so nobody goes looking for it in sci_wrappers.c.
@andy5995 sorry second thought, if I read it correctly the code does not set width to 12 if it does not exist in filetypes.common. Remember thats a file thats saved to user configs everywhere and those won't be updated with a new entry so the code has to handle it.
@andy5995 pushed 1 commit.
880b929317b338e1350e5758e0df0430c0fec03a remove sci_ prefix from function
Merged #2140 into master.
github-comments@lists.geany.org