On Tue, Jan 24, 2017 at 09:11:12PM +0100, Enrico Forestieri wrote:
> On Tue, Jan 24, 2017 at 12:00:02PM +0000, Guenter Milde wrote:
> > On 2017-01-24, Enrico Forestieri wrote:
> > > On Mon, Jan 23, 2017 at 10:14:39PM +0000, Guenter Milde wrote:
> > 
> > >> Below is an incomplete patch (see FIXME).
> > >> Could someone with more C++ knowledge complete and test, please?
> > 
> > > This would be a step forward. However, I am more radical and would like
> > > that the automatic transformation of -- and --- to \textendash and
> > > \textemdash be removed. If I enter -- I want to get --, otherwise
> > > strange things and obscure bugs can happen. For example:
> > > 1) start a new document and input "--" and you get \textendash
> > > 2) now enter another "-" and you get \textemdash
> > > 3) now enter another "-" and everything gets replaced by "-"
> > 
> > This could be changed to gets replaced by "----"
> 
> I don't know how easily, didn't have a look at the sources.

This seems to have been done on purpose. But I don't understand why.
The attached patch corrects this glitch and I am going to commit it
because I really don't see any rationale behind this behavior.

-- 
Enrico
diff --git a/src/Text.cpp b/src/Text.cpp
index 8d08baa..77bface 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -1057,11 +1057,6 @@ void Text::insertChar(Cursor & cur, char_type c)
                        par.eraseChar(pos - 1, 
cur.buffer()->params().track_changes);
                        c = 0x2014;
                        pos--;
-               } else if (par.getChar(pos - 1) == 0x2014) {
-                       // convert "----" to "-"
-                       par.eraseChar(pos - 1, 
cur.buffer()->params().track_changes);
-                       c = '-';
-                       pos--;
                }
        }
 

Reply via email to