Open kennypete opened 9 months ago
Sure, Jason, happy for you to do whatever with it - keep/amend away ☑️. I’ll send the PR tomorrow morning …
12 Dec 2023 at 21:17:
Hi, of course I would be happy to receive your PR. I've only been using vim for two or three years, so I don't know about a lot the stuff you've covered here, yet. I'm glad to have these improvements that I didn't know needed to be made.
Would you mind if I made my changes to your PR? I want to get that GitHub pair programming badge.
— Reply to this email directly, > view it on GitHub https://github.com/eggbean/resize-font.gvim/issues/1#issuecomment-1851500576> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/APN2VDZNWD7UXYSA54L5BSDYJAHKNAVCNFSM6AAAAABAQTPCPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRGUYDANJXGY> . You are receiving this because you authored the thread.> Message ID: > <eggbean/resize-font> .> gvim/issues/1/1851500576> @> github> .> com>
(sorry, edited and reposted)
Hi, of course I would be happy to receive your PR. I've only been using vim for two or three years, so I don't know about a lot the stuff you've covered here, yet. I'm glad to have these improvements that I didn't know needed to be made.
Could I ask what your reasoning is for point 4? Why make a parallel script using vim9script? I've not learnt anything about vim9script yet.
Would you mind if I made my changes to your PR? I want to get that GitHub pair programming badge.
vim9script because:
state()
, which is Vim-only, are used - and the number of those is increasing - a reason I used it with vim-tene, rather than vimscript)^^ I was tempted to suggest running with vim9script solely because I think you’ll find before 8.2.4807 the experience is iffy to the point of not bothering with it.
Likewise, I’m fairly new to Vim, having only used it for <3 years.
12 Dec 2023 at 21:28 :
Hi, of course I would be happy to receive your PR. I've only been using vim for two or three years, so I don't know about a lot the stuff you've covered here, yet. I'm glad to have these improvements that I didn't know needed to be made.
Could I ask what your reasoning is for point 4? Why make a parallel script using vim9script?
Would you mind if I made my changes to your PR? I want to get that GitHub pair programming badge.
— Reply to this email directly, > view it on GitHub https://github.com/eggbean/resize-font.gvim/issues/1#issuecomment-1851519667> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/APN2VD33XAMWEFCVZF4AYLTYJAIUDAVCNFSM6AAAAABAQTPCPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRGUYTSNRWG4> . You are receiving this because you authored the thread.> Message ID: > <eggbean/resize-font> .> gvim/issues/1/1851519667> @> github> .> com>
I like this, though there are some things that I think need hardening/fixing and some that will enhance it (most of which I have done, except part of point 5 and all of point 7). I have it ready for a PR, but did not want to send it unannounced with so many changes - here is my updated forked version.
<C-=>=
for the "FontSizeMinus" function when using a Windows version before that. It is a little clunky, but does the job.has("GUI_running")
returns 1 (at least in the version I use just for testing; I don't use Neovim other than for that). So, it's probably best to include a specific test for Neovim, i.e.,has('neovim')
, though it's only needed in the vimscript version because the new (see the point following) vim9script version's test will exclude it anyway. (NB: Neovim returns 801 forv:version
.)change_font_size_vim9script.vim
andchange_font_size.vim
test for version 8.2 with/without patch 4807. (Note that vim9script works before v9.0, not just wherehas('vim9script')
, so a good cut-off point, I think, is patch 8.2.4807: processing key eveints in Win32 GUI is not ideal, because that patch fixed<C-{whatever}>
. (Before that patch,<C-{whatever}>
mappings do nothing).maparg
to ensure users' existing mappings are not overwritten and usemap <silent> <Plug>
too. The problem for the vimscript version, however, is that<C-{whatever}>
does not work in version 8.2 before patch 4807 (in Windows at least, as noted). I did some testing using<F10>
to<F12>
, but it seems pretty flaky in Windows, and I don't want to burn more time testing it. (Using this Win64 zip version), amongst others in determining the points above in relation to version capability.)has('gui_gtk')
covers both 2 and 3, so is a simple refinement..vim/plugin
orvimfiles\plugin
directory, it would be better recommending using the packages approach (outlined at:h packages
). That is, using.vim/pack/{whatever}/start
(or.vim/pack/{whatever}/opt
, and calling it from your.gvimrc
, which is probably preferable in this instance too, especially if you use console and GUI. That's because it would mean you then only source the script(s) when using the GUI rather than relying on the test in the script itself to finish when using console Vim). I've not updated the README.md in relation to this, but you could consider it - check out this README of mine if you like.That's about it. It's your repository so, if you're okay with what I have done, and are happy for a PR, let me know (and I'll make it and you can consider the few loose ends like point 5 after that).
I love the concept, btw, having stuffed around changing font sizes in the past, so thanks for putting it out there. (I will be taking the vim9script into my
.gvimrc
and_gvimrc
directly because I prefer to have fewer plugins, and this is a pretty short script so only a small addition really.)