After some more thinking about it, we can fix #3454 very easily by ourselves by checking whether the tag originates from a source file with a known/common C/C++ extension - if not, always set "local" to FALSE.
The first patch adds `is_c_source` flag to TMSourceFile to indicate whether the file has one of the known C/C++ extensions, the second patch uses this flag and for C/C++ sources sets "local" to TRUE only when this flag is set (in addition to ctag's isFileScope flag).
@b4n Does this fix look OK to you?
Fixes #3454.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3490
-- Commit Summary --
* Add a flag to TMSourceFile indicating whether it's a C/C++ source file
* For C/C++ only mark tag as local if it originates from a source file
-- File Changes --
M src/tagmanager/tm_ctags.c (7)
M src/tagmanager/tm_source_file.c (18)
M src/tagmanager/tm_source_file.h (2)
-- Patch Links --
https://github.com/geany/geany/pull/3490.patchhttps://github.com/geany/geany/pull/3490.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3490
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3490(a)github.com>
Having 2 files, *xx.foo* and *something.c* open as C (assume the *.foo* was a header or something):
<details><summary><em>xx.foo</em></summary>
```c
int xx_foo(int n);
```
</details>
<details><summary><em>something.c</em></summary>
```c
int main(void)
{
xx_foo(); // (1)
}
```
</details>
At `(1)`, neither autocompletion nor "go to tag" works, but calltip does.
Quick code look suggests that the `TMTag->lang` probably is wrong (I guess using the ctags-detected language (none?) instead of the actual parer's language?).
Causes real issues with a codebase full of `.hdl`s loaded as C++ (which are auto-generated headers included in just as auto-generated `.hxx`es).
@techee if you have insight that'd be amazing, otherwise I'll try and look at this deeper when (read: if :grin:) I get time.
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3454
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/issues/3454(a)github.com>
Depends on #2355 for docs.
* Add *Project patterns* to open dialog file filters
* Re-use "File patterns" string in Find in Files dialog vs "Files" for clarity
* Show ungrouped filetypes first in open dialog file filter (fixes #2296 - see [this comment in particular](https://github.com/geany/geany/issues/2296#issuecomment-5337963…)
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2356
-- Commit Summary --
* Add *Project patterns* to open dialog file filters
* Show ungrouped filetypes first in open dialog file filter
* docs: Document Open dialog options
* Update filter docs
* Re-use "File patterns" string in Find in Files dialog vs "Files"
-- File Changes --
M data/geany.glade (2)
M doc/geany.txt (40)
M src/dialogs.c (29)
M src/search.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/2356.patchhttps://github.com/geany/geany/pull/2356.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2356
When using *Tools->Config Files* to open a user file that doesn't exist.
This fixes the first line of `geany.css` being wrongly uncommented (and the rest unchanged) due to toggle comment being used and CSS not having a line comment.
Split out from #3396 as it's independent of it.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3450
-- Commit Summary --
* Don't comment global content unless it is Conf
-- File Changes --
M src/ui_utils.c (3)
-- Patch Links --
https://github.com/geany/geany/pull/3450.patchhttps://github.com/geany/geany/pull/3450.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3450
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3450(a)github.com>
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?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2296
I've just noticed that typenames don't get colorized for newly opened documents (this is from editor.h):
<img width="467" alt="Screenshot 2023-09-01 at 20 49 40" src="https://github.com/geany/geany/assets/713965/8255c38b-096b-400b-a035-f772cc…">
However, when Geany gets restarted and this file is opened from the session list (and not manually), colorization works:
<img width="467" alt="Screenshot 2023-09-01 at 20 50 16" src="https://github.com/geany/geany/assets/713965/1c614c29-bd50-4566-8f01-4c7b8d…">
I've bisected this to the commit updating Scintilla to version 5 just after the 1.38 release.
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3550
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/issues/3550(a)github.com>
When filetype is changed to a compatible filetype (such as C->C++ and then possibly back to C), colorization is lost. It seems that with Scintilla 5, when language-specific highlighting changes, SCI_SETKEYWORDS has to be called again to take effect.
By setting keyword_hash to 0 we force Geany to call sci_set_keywords() in document_highlight_tags() which fixes the problem.
Fixes #3550
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3553
-- Commit Summary --
* Fix keyword colorization on filetype change
-- File Changes --
M src/document.c (3)
-- Patch Links --
https://github.com/geany/geany/pull/3553.patchhttps://github.com/geany/geany/pull/3553.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3553
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3553(a)github.com>
Hi,
When I open Geany and I have single screen, the vimode plugin works fine. When I split the screen, either horizontal or vertical, the vimode plugin does work on the newly opened screen. It continues to open in the original screen.
Can you please help me resolve the issue. Here are the details:
16:11:04.448133: GLib-GIO DEBUG : _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
16:11:04.449198: Geany INFO : Geany 1.38, en_IN
16:11:04.449203: Geany INFO : GTK 3.24.33, GLib 2.72.4
16:11:04.449216: Geany INFO : OS: Linux Mint 21.2 (victoria)
16:11:04.449219: Geany INFO : System data dir: /usr/local/share/geany
16:11:04.449221: Geany INFO : User config dir: /home/salil/.config/geany
16:11:04.547968: Geany INFO : Loaded GTK+ CSS theme '/usr/local/share/geany/geany.css'
16:11:04.548445: Geany INFO : Loaded GTK+ CSS theme '/usr/local/share/geany/geany-3.20.css'
16:11:04.551359: Geany INFO : System plugin path: /usr/local/lib/geany
16:11:04.555505: Geany INFO : Added filetype Arduino (64).
16:11:04.555510: Geany INFO : Added filetype Swift (65).
16:11:04.555513: Geany INFO : Added filetype Graphviz (66).
16:11:04.555516: Geany INFO : Added filetype Kotlin (67).
16:11:04.555518: Geany INFO : Added filetype Groovy (68).
16:11:04.555521: Geany INFO : Added filetype Genie (69).
16:11:04.555524: Geany INFO : Added filetype Cython (70).
16:11:04.555526: Geany INFO : Added filetype Meson (71).
16:11:04.555529: Geany INFO : Added filetype CUDA (72).
16:11:04.555531: Geany INFO : Added filetype Clojure (73).
16:11:04.555534: Geany INFO : Added filetype JSON (74).
16:11:04.555537: Geany INFO : Added filetype Scala (75).
16:11:04.555539: Geany INFO : Added filetype TypeScript (76).
16:11:04.555542: Geany INFO : Added filetype Nim (77).
16:11:04.562060: Geany INFO : Loaded libvte from libvte-2.91.so.0
16:11:04.573804: Geany INFO : unknown : None (UTF-8)
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1273
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany-plugins/issues/1273(a)github.com>
Vimode is not working. When you enable this plugin, I work immediately in insert mode. You cannot switch to normal mode or selections. Esc and ^c don't work. This problem is fixed only by turning off NumLock on the keyboard. But I need it! I don't want to turn NumLock on and off all the time. Obviously this is a bug that needs to be fixed.
Package:
geany-common/jammy,jammy,now 1.38-1 all
geany-plugin-addons/jammy,now 1.38+dfsg-1 amd64
Distro:
Linux Mint 21.2 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
WM:
cinnamon-common/victoria,victoria,now 5.8.4+victoria all
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1271
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany-plugins/issues/1271(a)github.com>
`foreach_ptr_array()` was reading one element past the end of the array. This was not usually noticeable because the resulting garbage pointer was not actually used, and it's highly unlikely there is protected or foreign memory right after the array, but there is actually no such guarantee, and it's bad nonetheless.
This actually resulted in Valgrind complaining, and hence me noticing:
==1217514== Invalid read of size 8
==1217514== at 0x49120B9: keyfile_action (stash.c:271)
==1217514== by 0x49130BB: stash_group_load_from_key_file (stash.c:308)
==1217514== by 0x48F179D: settings_action (keyfile.c:396)
==1217514== by 0x48F2D5E: read_config_file (keyfile.c:1245)
==1217514== by 0x48F3FAB: configuration_load (keyfile.c:1278)
==1217514== by 0x48F5393: load_settings (libmain.c:917)
==1217514== by 0x48F667F: main_lib (libmain.c:1154)
==1217514== by 0x109141: main (main.c:27)
==1217514== Address 0x910a3f0 is 0 bytes after a block of size 16 alloc'd
==1217514== at 0x48406C4: malloc (vg_replace_malloc.c:380)
==1217514== by 0x5B2C717: g_realloc (gmem.c:201)
==1217514== by 0x5AF2AA3: g_ptr_array_maybe_expand (garray.c:1640)
==1217514== by 0x5AF4066: g_ptr_array_add (garray.c:1962)
==1217514== by 0x4912247: add_pref (stash.c:491)
==1217514== by 0x491331E: stash_group_add_integer (stash.c:531)
==1217514== by 0x48F3857: init_pref_groups (keyfile.c:339)
==1217514== by 0x48F42A1: configuration_init (keyfile.c:1500)
==1217514== by 0x48F6661: main_lib (libmain.c:1146)
==1217514== by 0x109141: main (main.c:27)
==1217514==
or:
==1217514== Invalid read of size 8
==1217514== at 0x48EA315: keybindings_foreach (keybindings.c:768)
==1217514== by 0x48EC9B4: load_user_kb (keybindings.c:817)
==1217514== by 0x48EFBDC: keybindings_load_keyfile (keybindings.c:846)
==1217514== by 0x48F6756: main_lib (libmain.c:1206)
==1217514== by 0x109141: main (main.c:27)
==1217514== Address 0xd570830 is 0 bytes after a block of size 32 alloc'd
==1217514== at 0x484582F: realloc (vg_replace_malloc.c:1437)
==1217514== by 0x5B2C717: g_realloc (gmem.c:201)
==1217514== by 0x5AF2AA3: g_ptr_array_maybe_expand (garray.c:1640)
==1217514== by 0x5AF4066: g_ptr_array_add (garray.c:1962)
==1217514== by 0x48ECC43: keybindings_set_item (keybindings.c:180)
==1217514== by 0x48ECD92: add_kb (keybindings.c:295)
==1217514== by 0x48EE686: init_default_kb (keybindings.c:518)
==1217514== by 0x48EFB7C: keybindings_init (keybindings.c:751)
==1217514== by 0x48F6698: main_lib (libmain.c:1160)
==1217514== by 0x109141: main (main.c:27)
The problematic code was setting the new value for the item pointer after incrementing the index, but before validating it was still in the valid range.
Fix this by moving the item assignment in the condition expression. This requires using a comma operator and a logical AND to make sure the expression does not contribute to the test (allowing e.g. NULL values) yet being dependent on the index validation passing.
Note that this change, as implemented here, slightly affects behavior: `item` will point to the last *actual* node of the array (not out of bounds) after the loop, but also it will not be set at all if the array has no items. Before this change, the value was NULL for no items, and garbage otherwise.
As the value after the loop was effectively only usable for empty arrays, it sounds safe enough to assume no caller depended on an empty array leading to initializing `item`, so we can drop this special case. And unsurprisingly no caller in Geany itself depend on that.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3536
-- Commit Summary --
* Fix out-of-bounds read in foreach_ptr_array()
-- File Changes --
M src/utils.h (3)
-- Patch Links --
https://github.com/geany/geany/pull/3536.patchhttps://github.com/geany/geany/pull/3536.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3536
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3536(a)github.com>