<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>298793</bug_id>
          
          <creation_ts>2012-04-25 09:35:21 +0000</creation_ts>
          <short_desc>Simple snippet replaces more text than has been selected</short_desc>
          <delta_ts>2012-11-04 20:54:53 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kate</product>
          <component>plugin-snippets</component>
          <version>unspecified</version>
          <rep_platform>Ubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Romek">roman.konieczny</reporter>
          <assigned_to name="KWrite Developers">kwrite-bugs-null</assigned_to>
          <cc>christoph</cc>
    
    <cc>mail2lx</cc>
    
    <cc>roman.konieczny</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1249454</commentid>
    <comment_count>0</comment_count>
    <who name="Romek">roman.konieczny</who>
    <bug_when>2012-04-25 09:35:21 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249505</commentid>
    <comment_count>1</comment_count>
    <who name="Milian Wolff">mail</who>
    <bug_when>2012-04-25 12:13:28 +0000</bug_when>
    <thetext>confirmed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271851</commentid>
    <comment_count>2</comment_count>
    <who name="lxg">mail2lx</who>
    <bug_when>2012-07-02 21:06:26 +0000</bug_when>
    <thetext>I have the same bug (in Kdevelop). I&apos;m using the following snippet:

   Translate::t(%{selection})

and it always &quot;eats&quot; some or all of the trailing characters.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271852</commentid>
    <comment_count>3</comment_count>
    <who name="lxg">mail2lx</who>
    <bug_when>2012-07-02 21:10:49 +0000</bug_when>
    <thetext>Sorry, forgot to explicitely mention that it does *not* work with one-line selections for me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1312487</commentid>
    <comment_count>4</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2012-11-04 20:50:22 +0000</bug_when>
    <thetext>Git commit 860e9f13f9c73563166b01f988f7e55aee9b29c3 by Christoph Cullmann.
Committed on 04/11/2012 at 21:49.
Pushed by cullmann into branch &apos;master&apos;.

some fixes for template interface usage in snippets
still %{selection} inserts one space too much, but at least doesn&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1312490</commentid>
    <comment_count>5</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2012-11-04 20:54:53 +0000</bug_when>
    <thetext>Ah, I see, the &quot;space&quot; is wanted in the implementation, then this is fixed now.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>