Open hanzzzzz opened 8 years ago
See #20
I'm interested in the name of said "product" in Visual Studio so I can look for a screenshot. I'm sceptical that a thousands of lines file at a small fraction of a 1pt font will even register pixels let alone be usable. Even a file of 1080 lines would give less than 1px per code line, not counting spacing between lines and Geany's GUI around the editor, on a conventional LCD monitor.
That being said, as mentioned in the duplicated Issue, I'd probably accept a pull request to implement this.
VS 2015 is the product, it shows the scroll bar (as I described) when enabling Options / Text Editor / All Languages / Scroll Bars / Use map mode for vertical scroll bar
. For earlier versions of Visual Studio there is the 'Metal Scroll' extension which adds the map mode.
Sure it will not show every line of code, but showing the structure of the code is still possible, especially when showing the text colors in the map (green for comments etc.). This makes navigating really fast and comfortable if you know the structure of your code (more or less), as you can easily identify switch/case, nested loops, lists etc.
Below you can see an example of the VS 2015 map for different file sizes on a 1280x1024 display. The blue line shows the cursor position.
@hanzzzzz thanks for the screenshots. I think VS must do something special because the "text" size in the 1000 line file is roughly the same as that in 4600 line file. I'm almost certain that Scintilla (the editor widget in Geany) wouldn't look like that when zoomed out so far (if it's even possible).
Just tested, Scintilla won't zoom out much more than the current limit, not nearly enough enough to fit an entire multi-thousand-line file all at once. I think Scintilla limits to 1pt font size.
Another editor showing the whole file in its map mode is Kate, you might want to have a look at it. You can enable the map mode at
Settings / Configure Kate... / Editor Component / Appearance / Borders / Show scrollbar mini-map
I suspect if Scintilla could do sub-point-sized fonts, it would look like Kate's, which is quite useless IMO. Here's a screenshot of it with Geany's editor.c
open:
Of course the opinions might differ on the usefulness of this feature, but I (and at least raumkraut, too [#20]) use it very often and think that once you are used to it you might start to like it, too, as you get better in identifying functions and code structure in the minimap. Hence, I hope that this feature gets integrated into the overview plugin.
I agree it's a useful feature, but the Kate version is garbage compared to your screenshot from VS (if it is in fact showing a whole 4600 line file). In any case, I'm certainly not opposed to this feature, I just don't think it will be at all trivial to implement, likely requiring some kind of hack to do a screengrab from an off-screen Scintilla widget, doing some kind of image scaling, drawing it with GDK to another on-screen widget, and mapping between scaled pixel coordinates and Scintilla lines.
I'll leave this Issue open since Github default search only looks in open tickets, so it might avoid more duplicates. If anyone feels like working on this, post a comment here to let us know.
It looks like Visual Studio is doing (at least) two things, depending on how long the file is, relative to the scroll box:
FWIW, Kate's implementation, which I generally find good enough for most of my work, appears to perform the first trick, but not the second.
There should be an option to show the whole document at once in the overview instead of only showing a part of it. The reasons for my request are:
A product that shows my requested behaviour is Visual Studio 2015, in case that you need a sample.