GitSavvy icon indicating copy to clipboard operation
GitSavvy copied to clipboard

Auto complete available when writing commit comments

Open LozmindaSnr opened this issue 3 years ago • 4 comments

Would it be possible/how difficult would it be, to have some of the Sublime Text 3 functionality when writing comments for the commit? Mainly the autocomplete? I often need to reference function/variable names and having auto complete would save a few key presses ! (One day I'll learn python, but at the moment there's no point me being given the outline of how to do it, not yet anyway, so am fairly helpless/useless !) I use this plugin almost everyday, great stuff ! Thank you

LozmindaSnr avatar Aug 23 '21 19:08 LozmindaSnr

I actually have/wrote a plugin that restores the autocomplete functionality from Sublime Text 3 completely. It's not even very difficult, but unpublished atm.

Doing this just for the GitSavvy commit message view is maybe overkill. I don't think it should be part of the GitSavvy suite as taking over the tab key is somewhat hostile.

kaste avatar Oct 08 '21 19:10 kaste

Oh, that's a pity. It would be really helpful for me though (I realise I'm being totally selfish here) could I see the code maybe? could you point me in the right direction if the code is somewhere? (Like on github?) I have quite detailed commit messages things like: myclass::Variable renamed to otherClass::otherVar etc etc. Often all this info is below this banner

##To make a commit, type your commit message and press CTRL-ENTER. ##To cancel the commit, close the window. To sign off on the commit, ##press CTRL-S. ##"" at the very first char to see the recent log ##"fixup" to create a fixup subject (short: "fix") ## "squash to create a squash subject (short: "sq") ##"#" to reference a GitHub issue (or: "owner/repo#") ##In the diff below, [o] will open the file under the cursor. )

but it still means I've got to scroll down, copy paste etc, esp if the function names are complicated eg AssignBlank_toSmallTexture().

Unless there's a better way I'm not understanding, which maybe true, I'm a noob.

It would save me a few seconds every commit, it all mounts up ! Thanks for betting back to me, I appreciate you've probably got a lot on, bon courage !

LozmindaSnr avatar Oct 14 '21 22:10 LozmindaSnr

I've found a really easy solution for this: In Sublime Text 3 in the Settings under Preferences just change:

"auto_complete_selector": "meta.tag - punctuation.definition.tag.begin, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",

to:

"auto_complete_selector": "",

and voilà auto complete works for ST3 commit messages. As yet (I implemented this change about 6 months ago, but forgot about this post) there hasn't been any bad side effects. Also I don't know about ST4..

LozmindaSnr avatar Nov 06 '23 16:11 LozmindaSnr

Hm, autocomplete always worked on ST3 for me. ST4 dropped that so I had to reimplement it which was really disappointing at that time. The plugin is at https://github.com/kaste/abbrev-autocomplete Just uploaded, but it is as I said for ST4 and requires python 3.8.

kaste avatar Nov 06 '23 21:11 kaste