I tried removing files from /usr/share/geany/filedefs and editing filetype-extensions.conf but neither of those changes resulted in a shorter file pick list. I use less than 10 file types on a regular basis, but picking them out of that scrolling, out of window, file list is a pain. How do I shorten that list?
There is no "open dropdown", did you mean the recently used dropdown list? Menu->edit->preferences->files->recent files list length?
Presumably `Document->Set Filetype` menu.
While not an answer, I'm curious why you need to change the filetype manually so often as Geany will detect it from the file when opened.
@RufusVS I assume you mean the file filter in the Open dialog. Maybe you can use the 'All Source' option, 2nd from the top?
If you need more precision, the single-filetype file filters could be ordered to show filetypes that don't belong to a group above the grouped ones. This would be controlled from the `None` group defined in filetype_extensions.conf `[Groups]`. (This follows the design of showing ungrouped filetypes in the top-level of *Document->Set Filetype*, and the *Set Filetype* combo under *More options* in the Open dialog. Unfortunately the GtkFileChooser doesn't seem to support submenus for filetype groups, unlike *Set Filetype*).
To be specific, I am running Raspbian Buster on my Raspberry Pi and I like the geany editor. But when I select OpenFile, On the right hand side there is a pull down list that initially says "All files". If I pull down the list, it lists dozens of source file types, and it doesn't even let me scroll down to Python, for instance, it stops scrolling with "Go source file" at the bottom of my screen. "All files" and "All Source" are selectable, but if I have a couple python files in a directory with many html and php files, "All Sources" doesn't really help. So if this is GtkFileChooser dialog, the question is: where does it get that list of file types? Does it ask Linux/Raspbian? Is it embedded in the Geany source code? I would hope I wouldn't need to recompile my own copy of geany to eliminate this inconvenience. I'll look again for the filetype_extensions.conf file and see if I can't cut the unused out of the file.
Closed #2296.
Reopened #2296.
Ooops, accidentally closed the issue. Anyway, in the meantime I checked and I had already edited filetype_extensions.conf, commenting out languages I don't use, and it did nothing to change the dropdown list. Does Linux/Debian/Raspbian have an extension/association list like windows? Maybe that's where it's getting the list.
This doesn't sound like a Geany bug, but rather a problem with your Window Manager or perhaps GTK+. These menus that overflow are supposed to be scrollable using the arrow buttons at the top and bottom, see below:
![geany_ft_dropdown](https://user-images.githubusercontent.com/181177/65397561-f0a08d80-dd65-11e9...)
@RufusVS: the open dialog is created in the function ```create_open_file_dialog()```. It calls the function ```filetypes_create_file_filter()``` to create the filter and that function is filling the filter with all filetypes from the list ```filetypes_by_title```. This is filled on startup of Geany in the function ```filetypes_init()``` which calls ```filetypes_init_types()```. Then first built-in filetypes are set in function ```init_builtin_filetypes()```. And then filetypes are added from the application data directory and the config directory. On my Ubuntu machine these are ```/usr/local/share/geany/filedefs``` and ```/home/username/.config/geany/filedefs```.
So, if I understood it right you would have to remove some files from the directory as you did **AND** shorten the list in ```init_builtin_filetypes()```and re-build Geany. Also notice that if you remove some files in the directories it will only have an effect after re-starting Geany.
But as the others wrote the list should be scrollable and it seems to be some kind of Gtk issue.
if I have a couple python files in a directory with many html and php files, "All Sources" doesn't really help.
OK. Even if the Gtk scrolling issue was resolved on your system, I assume you'd still want to configure the list of file filters. ATM you can't do that. My idea would allow you to change the order:
the single-filetype file filters could be ordered to show filetypes that don't belong to a group above the grouped ones.
So *if* this was implemented, you might define: `None=HTML;PHP;Python`
Then the list would be something like: All files All source HTML PHP Python Abc Assembler C C++ D etc
@Rufusvs would that solve the issue?
Thank you for all responses. Since my last post, I did look at the source code and found out that all those file type are, in fact, hardcoded into the system, so there is no way to remove them other than edit and rebuild the source. LarsGit233 summarizes the search process I went throught quite well. Sorry I didn't post my disappointment earlier. Scrolling through 30 types when you only use 5 is an unacceptable solution.
@RufusVS
Scrolling through 30 types when you only use 5 is an unacceptable solution.
Twice I have suggested a change I could make so your frequent filetypes could be ordered near the top of the list. Could you take a look and comment please?
Hi ntrel. Sorry I didn't comment on the "bring to top" suggestion, but I think I tried that early on but it didn't work as expected. I'll revisit that and report back. Maybe not right away though.
@RufusVS You can't do that ATM, I could implement it though.
I'll have to download the install the latest. Thanks!
Closed #2296.
@rufusvs my pull request hasn't been reviewed or merged yet.
Reopened #2296.
github-comments@lists.geany.org