Summary: | percentage (%) sign doubles when pasted | ||
---|---|---|---|
Product: | [Applications] konversation | Reporter: | Orcan Ogetbil <orcanbahri> |
Component: | general | Assignee: | Konversation Developers <konversation-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | carlosdgtorres, hein, wordsizzle |
Priority: | NOR | ||
Version: | 1.1 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Orcan Ogetbil
2008-11-27 03:14:23 UTC
This is actually not a bug, but a feature. In Konversation, a single % will trigger text formatting options such as bold (%B), italics (%I), and colors (See Insert menu -> IRC Colors). The only way to display a plain "%" in the text is to "escape" it by typing two % ("%%"). Konversation knows that when you copy and paste a "%" sign, you want to really display a "%" so it automatically escapes it. I forgot to mention, if you don't want this behavior, you can turn it off in Settings menu -> Configure Konversation -> Behavior -> Chat Window -> Disable variable expansion checkbox. Thanks for the quick reply. I thought about % being an escape character. I should have looked at the documentation, I guess. But what fooled me was, when I type "50% of dogs are male" with a single % and hit ENTER my messages is posted properly on the channel. The % sign doesn't gets lost, which is not the case for most implementations of an escape character. Anyhow, you are contradicting yourself :) Let me demonstrate: You are saying that % is an escape character. That means that you are expecting the user to type %% to display a single %. That's fine. But then you shouldn't double the number of % signs that are copied from the input box. Those are already doubled by the user. I am pretty sure there is a bug somewhere, but not necessarily the way I reported in the first place. Should I open another one? No, it's fine to keep this report open. Personally, I think this is a bug as well; I have to look at the code, but I doubt it's so "smart" as to double the percent sign intentionally, and if it were, that'd be an example of the kind of trying-to-outguess-the-user pseudo-smartness I don't really like, especially when it doesn't actually work. Variable expansion only hits when an actual variable is named (e.g. %B for bold), otherwise, typing a single % is fine, so there's no reason to double it in the example provided here. And if the copied input box text *would* include something like %B, auto-escaping would still be wrong to do because the chances are the user does want bold in the text. I actually can't think of any scenario in which auto-doubling the percent sign on copy would make sense. Reopening. Anyone against me removing the code that does this? It's just 6 lines but it's more of a bug than a feature imo. IIRC it was a workaround against some Qt 3 bug. psn added it I think; he would know more then. As it is it's definitely annoying. SVN commit 969744 by psn: Don't double % on paste. BUG: 176209 M +0 -6 ircinput.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=969744 |