| Summary: | Simple snippet replaces more text than has been selected | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Romek <roman.konieczny> |
| Component: | plugin-snippets | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | christoph, mail2lx, roman.konieczny |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
confirmed I have the same bug (in Kdevelop). I'm using the following snippet:
Translate::t(%{selection})
and it always "eats" some or all of the trailing characters.
Sorry, forgot to explicitely mention that it does *not* work with one-line selections for me. Git commit 860e9f13f9c73563166b01f988f7e55aee9b29c3 by Christoph Cullmann.
Committed on 04/11/2012 at 21:49.
Pushed by cullmann into branch 'master'.
some fixes for template interface usage in snippets
still %{selection} inserts one space too much, but at least doesn't eat text :/
M +1 -1 part/snippet/katesnippetglobal.cpp
M +5 -26 part/snippet/snippetcompletionitem.cpp
M +2 -2 part/snippet/snippetcompletionitem.h
M +4 -2 part/snippet/snippetcompletionmodel.cpp
M +3 -0 part/snippet/snippetcompletionmodel.h
http://commits.kde.org/kate/860e9f13f9c73563166b01f988f7e55aee9b29c3
Ah, I see, the "space" is wanted in the implementation, then this is fixed now. |
I have very simple snippet: %{selection} When I use it on more than one selected line it replaces more than have been selected. E.g. for text like following: 1 2 3 4 5 running above snippet on selected lines 2 and 3 will result: 1 2 3 5 It means, line 4 has been cut. Reproducible: Always Steps to Reproduce: 1. Make simple snippet 2. Select a text 3. Run a snippet Actual Results: Removed more text than inserted. Expected Results: This snippet should result in same text as before running snippet. It works ok for one line selection.