Re: [Github-comments] [geany/geany-plugins] Markdown: Update using known GeanyDocument when available (#1064)
I do not, I just noticed that it was giving invalid/NULL and that I had a valid document pointer already available. Probably one of the callbacks the plugin uses gets triggered early before the document list is fully initialized or something, but I didn't spend much time trying to understand it. -- 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-plugins/pull/1064#issuecomment-776546128
Re: [Github-comments] [geany/geany-plugins] Markdown: Update using known GeanyDocument when available (#1064)
It can definitely return NULL for lots of reasons, but if it returns a pointer it should be valid since it tests it and returns NULL if not valid. -- 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-plugins/pull/1064#issuecomment-776557816
Re: [Github-comments] [geany/geany-plugins] Markdown Plugin (Feature Request): Keep scroll position on reload (#1055)
After a little more research I think it might be possible to do it fully within JS by loading the scroll position from the browser's localStorage (or maybe just sessionStorage) when the DOM is finished loading and saving it before the page is unloaded. If I can get that working, it should do the trick for both Webkit1 and Webkit2 and allow to remove some code from the plugin. Basic theoretical untested code: ```js document.addEventListener('DOMContentLoaded', () => { const pos = localStorage.getItem('mdScrollPos'); if (pos) window.scrollTo(pos.x, pos.y); }); window.onbeforeunload = () => { localStorage.setItem('mdScrollPos', { x: window.scrollX, y: window.scrollY, }); }; ``` To make it have different scroll positions saved per file rather than one global scroll position for all files will require to pass the filename through the template to JS so it can keep track of which scroll position to load/save. It might also require a bit of JS code to prune/vacuum the localStorage to get rid of scroll positions older than a certain date and/or above a certain number, but that might be overkill. Next time I'm working on the plugin I'll try and see if it works. -- 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-plugins/issues/1055#issuecomment-776559476
[Github-comments] [geany/geany] Codes worked on other terminals but not on Geany (#2749)
I tried to run the following codes on Geany and it reported errors. The same codes worked fine on Google Colab. Can anyone help me here? Thanks. import re match=re.search(r'\d\s*\d\s*\d', 'xx1 2 3xx') match.group() -- 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/2749
Re: [Github-comments] [geany/geany] Underscores missing with certain fonts, such as the default "Monospace Regular" font (#2386)
Posting to a closed issue, as I don't want to open yet another issue for this. My setup: geany 1.36 (built on Mar 22 2020 with GTK 3.24.14, GLib 2.64.1) on Ubuntu 20.04.2 I can confirm the problem, not only with Default Monospace font (set to DejaVuSansMono.ttf), but also with quite a few other fixed-type fonts on my system. Considering the number of people being affected by this (myself included), would you guys consider changing the default `line_height=0;2;` so there is no need for users to fiddle with config files ? -- 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/2386#issuecomment-776885308
Re: [Github-comments] [geany/geany] Codes worked on other terminals but not on Geany (#2749)
Normally support questions should rather go to the [mailing list](https://www.geany.org/support/mailing-lists/#geany-users) (or [IRC](https://www.geany.org/support/irc/)). In any case, we'll need more information than "Geany reported errors". What is your OS, Geany version, etc? A wild guess: you're on Windows, and you didn't install Python separately (Geany doesn't come with it), or the way you installed Python did not put it into the system's search directories so that the default Geany configuration can find it. In the latter case, you can either get Python into the PATH, or adjust Geany's Python [build commands](https://www.geany.org/manual/current/index.html#set-build-commands-dialog) to look in the right place. -- 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/2749#issuecomment-776970629
Re: [Github-comments] [geany/geany-plugins] Markdown: Update using known GeanyDocument when available (#1064)
@b4n commented on this pull request. > @@ -192,7 +193,7 @@ static gboolean on_editor_notify(GObject *obj, > GeanyEditor *editor, SCNotification *notif, MarkdownViewer *viewer) { if (IS_MOD_NOTIF(notif)) { -update_markdown_viewer(viewer); +update_markdown_viewer(viewer, NULL); ```suggestion update_markdown_viewer(viewer, editor->document); ``` -- 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-plugins/pull/1064#pullrequestreview-587994423
Re: [Github-comments] [geany/geany-plugins] Markdown: Update using known GeanyDocument when available (#1064)
What your change suggests to me is that you'd encounter cases where `document_get_current()` doesn't return the document for which the signal was fired for. This sounds weird for the `activate`/`new`/`open`/`reload`/`filetype-set` signals you're using, and definitely something that should be fixed if it's indeed not in sync (e.g. the signal is fired before the changes that make `document_get_current()` return the right value happen) -- unless there is an actual reason for that, but still. I'm sympathetic to the base idea of using the document for which the signal was fired though. But it really seems like it should be strictly equal to `document_get_current()`. -- 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-plugins/pull/1064#issuecomment-776978500
Re: [Github-comments] [geany/geany-plugins] Markdown: Update using known GeanyDocument when available (#1064)
@b4n commented on this pull request. > { - GeanyDocument *doc = document_get_current(); + if (!DOC_VALID(doc)) Wouldn't simply `doc == NULL` work here? Do you really get non-NULL doc pointers that have `doc->valid == FALSE`? -- 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-plugins/pull/1064#pullrequestreview-588000690
Re: [Github-comments] [geany/geany] Underscores missing with certain fonts, such as the default "Monospace Regular" font (#2386)
@dregrad, We don't collect statistics about the number of Geany installs, but Github stats show about 10 clones _per day_ but that doesn't count the number of installs from distro repositories. So we can't compare the number of people who have problems with the number who use Geany. But the number who report problems is I think less than 10 and therefore only likely to be a small proportion of users. Increasing the default line height setting adds useless spacing between lines for everyone, and that reduces the number of lines, for example for me line spacing of `0;2` reduces the number of lines on screen from 81 to 71, a significant difference thats not necessary here since I'm using a different font where underscores are always visible. Also `0;2` isn't necessary in all cases, its something that worked for someone who posted it, in many cases `0;1` works, it does here if I change my font to Deja-Vu Sans Mono and `0;0` does not work, but as I said above `0;0` works for my normal Hack font [Unpaid advertisement: Hack is a font designed for code and provides great readability for that]. To summarise if we changed the default setting: Setting | Who | Result | Fix --||--|- `0;0` | Majority | Works | None needed `0;0` | Minority | No underscores at some font sizes | Change font or font size or edit `filetypes.common` `0;1` | Majority | Lose lines | Edit `filetypes.common` to get lines back `0;1` | Some of the Minority | Works | None needed `0;1` | Rest of the minority | No or dim underscores | Change font or font size or edit `filetypes.common` `0;2` | Almost everybody | Lose even more lines | The majority for whom less than `0;2` works edit `filetypes.common` to get lines back `0;2` | Very unlucky few | No or dim underscores | Change font or font size or Edit `filetypes.common` It seems to me that says the current situation works best for the greatest number of users and the default setting should not change. Perhaps the Ubuntu package should set `0;1` if the distro continues to default to a faulty font so it works for almost all and doesn't impact too negatively on many. @dregad you could ask there. -- 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/2386#issuecomment-777087784
Re: [Github-comments] [geany/geany] Underscores missing with certain fonts, such as the default "Monospace Regular" font (#2386)
As an aside, I also switched to (a slashed-zero variant of) Hack but stuck with ``` [styling] line_height=1;1; ``` in Geany because it gives me vertical spacing consistent with that in `xfce4-terminal` with the same font. -- 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/2386#issuecomment-777127361
Re: [Github-comments] [geany/geany] Underscores missing with certain fonts, such as the default "Monospace Regular" font (#2386)
@bencaradocdavies so long as you put that in your user `filetypes.common` it will continue to override the default set in Geany so it doesn't matter what the default changes to. -- 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/2386#issuecomment-777135697