Bug 462383 - Snippet popup appears when I type the `.`
Summary: Snippet popup appears when I type the `.`
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: plugin-snippets (other bugs)
Version First Reported In: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-29 07:45 UTC by Peter Tselios
Modified: 2024-11-17 08:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
katepartrc (1.73 KB, text/plain)
2022-11-29 07:45 UTC, Peter Tselios
Details
katerc (5.55 KB, text/plain)
2022-11-29 07:45 UTC, Peter Tselios
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Tselios 2022-11-29 07:45:02 UTC
Created attachment 154129 [details]
katepartrc

SUMMARY
When I enable the Snippets plugin, every time I use the `.` the snippets popup appears. This is extremely annoying and definitely breaks the workflow of anything you do. 

STEPS TO REPRODUCE
1.  Enable Snippets plugins
2.  Add a Snippet
3.  Start writing a document and then press `.`

OBSERVED RESULT
Snippets popup is presented every time you enter the `.`. 

Please note that only the relevant to the filetype of the document  snippets are presented. So, if you use adoc for example, it will present the snippets relevant  only to adoc, so this is working perfectly fine.

EXPECTED RESULT
Snippets popup should appear only when I press the Ctrl-Space, as documented: 
https://docs.kde.org/stable5/en/kate/kate/kate-application-plugin-snippets.html

SOFTWARE/OS VERSIONS
KDE Plasma Version: Every Plasma version after 5.21 for sure.

ADDITIONAL INFORMATION
This bug is present since at least Fedora 32 or 33. 

I have added 2 configuration files so someone could check if there are any settings that trigger this behavior. 
Also, please note that I deleted all kate*rc files to start from scratch, just in case I had a strange setting, but that didn't change a thing.
Comment 1 Peter Tselios 2022-11-29 07:45:26 UTC
Created attachment 154130 [details]
katerc
Comment 2 Peter Tselios 2022-11-30 11:22:16 UTC
An interesting point found in Reddit :)

https://www.reddit.com/r/kde/comments/z6usov/comment/iy9wstz/?utm_source=reddit&utm_medium=web2x&context=3
Comment 3 Bug Janitor Service 2023-10-16 20:11:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1321
Comment 4 Christoph Cullmann 2023-10-17 17:05:08 UTC
Git commit ebb30fb1bdb6813fa371fa98622002980cbfebce by Christoph Cullmann, on behalf of Gary Li.
Committed on 17/10/2023 at 19:01.
Pushed by cullmann into branch 'master'.

Do not popup snippets based on editor text with default implementation

M  +12   -0    addons/snippets/snippetcompletionmodel.cpp
M  +1    -1    addons/snippets/snippetcompletionmodel.h

https://invent.kde.org/utilities/kate/-/commit/ebb30fb1bdb6813fa371fa98622002980cbfebce
Comment 5 Bug Janitor Service 2024-11-06 18:08:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1644
Comment 6 Christoph Cullmann 2024-11-09 13:16:02 UTC
Git commit a8463f8761d35701803367c38b416dbb724e015e by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 09/11/2024 at 13:11.
Pushed by cullmann into branch 'master'.

Fix snippets not working unless completion is hard invoked

They should not be completely disabled unless someone hard presses
ctrl-space as it makes the experience very annoying. Overtime one can
get used to the annoyance but I am not sure its a good idea.

The new logic honors ktexteditor minimal word length and starts the
completion if the last char is a letter. This should avoid the issue
with snippet completion starting on pressing `.`. However, this might
still be too simplistic but we can refine on it instead of hard
disabling the feature
Related: bug 495416

M  +14   -8    addons/snippets/snippetcompletionmodel.cpp

https://invent.kde.org/utilities/kate/-/commit/a8463f8761d35701803367c38b416dbb724e015e
Comment 7 Waqar Ahmed 2024-11-17 08:07:24 UTC
Git commit 3a9e858c71cbd8a5021e73cb86fc52a7e5fa2b15 by Waqar Ahmed.
Committed on 17/11/2024 at 08:02.
Pushed by waqar into branch 'release/24.12'.

Fix snippets not working unless completion is hard invoked

They should not be completely disabled unless someone hard presses
ctrl-space as it makes the experience very annoying. Overtime one can
get used to the annoyance but I am not sure its a good idea.

The new logic honors ktexteditor minimal word length and starts the
completion if the last char is a letter. This should avoid the issue
with snippet completion starting on pressing `.`. However, this might
still be too simplistic but we can refine on it instead of hard
disabling the feature
Related: bug 495416
(cherry picked from commit a8463f8761d35701803367c38b416dbb724e015e)

M  +14   -8    addons/snippets/snippetcompletionmodel.cpp

https://invent.kde.org/utilities/kate/-/commit/3a9e858c71cbd8a5021e73cb86fc52a7e5fa2b15