Bug 198540 - typing a closing bracket should not add another one when using auto brackets
Summary: typing a closing bracket should not add another one when using auto brackets
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-01 17:00 UTC by Frank Niethardt
Modified: 2018-08-14 12:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Niethardt 2009-07-01 17:00:02 UTC
Version:           2.9.94 (using Devel)
OS:                Linux
Installed from:    Compiled sources

I have seen this in NetBeans and it's a real improvement:

When you use "auto brackets" and literally write something like

Hello("World"); 

in Kdevelop you get:

Hello("World");)

in NetBeans:

Hello("World");

So you have to be careful, to step over the closing bracket while using Kdevelop. In NetBeans you just can write this call, including the closing bracket and NetBeans just treat is as the already automatically set closing bracket.
Comment 1 Andreas Pakulat 2009-07-01 20:29:58 UTC
Yeah, I know its highly annoying, unfortunately nothing we can fix in kdevelop.
Comment 2 Frank Niethardt 2009-07-13 11:42:05 UTC
As told on #kate I have a IMHO simple idea to solve that problem. I didn't look in the code, yet, so I don't know how much effort it is.

Idea is to have a stack with all closing parts that are inserted while using auto brackets.
- if you just continue to write and type the contents of the stack, it will be ignored/replaced instead of added to the text and poped from stack
- if you move the cursor right as pressing -> the brackets are poped from stack, too
- if you make any more complicated move, the stack is cleared completely

I think this will handle most of the cases where you are annoyed of "auto brackets"
Comment 3 Jurian Sluiman 2010-02-15 01:17:40 UTC
I think this is the same I proposed in Milian's blog a while ago (http://milianw.de/blog/kate-love-highlightinterface-autobrace#comment-568). What's the difficulty with this issue and is it possible for the KDE4.5 release like Milian said some months ago?
Comment 4 Christoph Cullmann 2012-11-02 22:19:55 UTC
Git commit d51d4820a854985a833f28f1facac9d9287466ab by Christoph Cullmann.
Committed on 02/11/2012 at 23:11.
Pushed by cullmann into branch 'master'.

remove auto bracket feature in kate
the auto bracket plugin is much more versatile
added to it feature to auto-complete { for tex, too
Related: bug 241104

M  +0    -5    doc/kate/configuring.docbook
M  +0    -1    ktexteditor/configinterface.h
M  +0    -10   part/dialogs/editconfigwidget.ui
M  +0    -4    part/dialogs/katedialogs.cpp
M  +10   -86   part/document/katedocument.cpp
M  +0    -10   part/plugins/autobrace/autobrace.cpp
M  +3    -2    part/syntax/data/modelines.xml
M  +0    -23   part/utils/kateconfig.cpp
M  +0    -5    part/utils/kateconfig.h
M  +0    -5    part/variableeditor/variablelineedit.cpp

http://commits.kde.org/kate/d51d4820a854985a833f28f1facac9d9287466ab
Comment 5 Dominik Haumann 2018-08-14 12:15:57 UTC
Git commit 857a277110d514065392d670382d2cc5a13bb244 by Dominik Haumann.
Committed on 14/08/2018 at 12:15.
Pushed by dhaumann into branch 'master'.

Relicense modelines.xml to MIT license

Summary:
This change relicenses the modelines.xml file to MIT license.
Please everyone, explicitly state that you agree with the relicense change
to MIT and accept this revision so that we can proceed.

The authors are extracted from below:
- Alex Turbov <i.zaufi@gmail.com>
- Christoph Cullmann <cullmann@kde.org>
- Volker Krause <vkrause@kde.org>
- Dominik Haumann <dhaumann@kde.org>
- Martin Walch <walch.martin@web.de>

Changes to the file in syntax-highlighting.git
==============================================

commit 1cf26801aeeb8b8ca681a39f5f2c654769048630
Author: Christoph Cullmann <cullmann@kde.org>
Date:   Mon Jul 24 15:25:27 2017 +0200

    strip leading/trailing whitespaces from keywords

    command: perl -pi -e 's@<item>\s*(\S+)\s*</item>@<item>\1</item>@gi' *.xml

    remaining issues:

    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/4dos.xml" line 281 keyword with leading/trailing spaces: " DATE /T "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/ample.xml" line 2896 keyword with leading/trailing spaces: " Afall, Bfall, Qfall, Qbfall, Tfall, Tbfall "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/ample.xml" line 2898 keyword with leading/trailing spaces: " Arise, Brise, Qrise, Qbrise, Trise, Tbrise "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/ample.xml" line 2903 keyword with leading/trailing spaces: " Asim_model Property in Element Statements "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/ample.xml" line 2987 keyword with leading/trailing spaces: " Requirements for DRACULA II "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/ample.xml" line 3012 keyword with leading/trailing spaces: " Ioh1, Ioh2 "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/ample.xml" line 3014 keyword with leading/trailing spaces: " Iol1, Iol2 "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/ample.xml" line 3068 keyword with leading/trailing spaces: " Spike Model Data "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/ample.xml" line 3195 keyword with leading/trailing spaces: " Tphz, Tplz, Tpzh, Tpzl "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/ample.xml" line 3207 keyword with leading/trailing spaces: " Voh1, Voh2 "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/ample.xml" line 3209 keyword with leading/trailing spaces: " Vol1, Vol2 "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/asn1.xml" line 36 keyword with leading/trailing spaces: " OCTET STRING "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/coldfusion.xml" line 199 keyword with leading/trailing spaces: " String formatting "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/freebasic.xml" line 29 keyword with leading/trailing spaces: " For Input "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/freebasic.xml" line 30 keyword with leading/trailing spaces: " For Output "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/freebasic.xml" line 31 keyword with leading/trailing spaces: " For Binary "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/freebasic.xml" line 32 keyword with leading/trailing spaces: " For Random "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/freebasic.xml" line 132 keyword with leading/trailing spaces: " Byte PTR "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/freebasic.xml" line 133 keyword with leading/trailing spaces: " Dword PTR "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/freebasic.xml" line 134 keyword with leading/trailing spaces: " Qword PTR "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/freebasic.xml" line 135 keyword with leading/trailing spaces: " Word PTR "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/freebasic.xml" line 369 keyword with leading/trailing spaces: " OPTION BASE "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/freebasic.xml" line 370 keyword with leading/trailing spaces: " OPTION PRIVATE "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/gnuplot.xml" line 88 keyword with leading/trailing spaces: " data style "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/gnuplot.xml" line 89 keyword with leading/trailing spaces: " function style "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/php.xml" line 2253 keyword with leading/trailing spaces: " date_time_ set "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/progress.xml" line 298 keyword with leading/trailing spaces: " NOT ENTERED "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/progress.xml" line 609 keyword with leading/trailing spaces: " SERVER SOCKET "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/pug.xml" line 28 keyword with leading/trailing spaces: " else if "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/sql-postgresql.xml" line 689 keyword with leading/trailing spaces: " BIT VARYING "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/sql-postgresql.xml" line 696 keyword with leading/trailing spaces: " CHARACTER VARYING "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/sql-postgresql.xml" line 701 keyword with leading/trailing spaces: " DOUBLE PRECISION "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/sql-postgresql.xml" line 727 keyword with leading/trailing spaces: " TIMESTAMP WITH TIMEZONE "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/stata.xml" line 147 keyword with leading/trailing spaces: " clpatt [ern] "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/stata.xml" line 379 keyword with leading/trailing spaces: " gr [een] "
    "/home/cullmann/kdesrc/frameworks/syntax-highlighting/data/syntax/stata.xml" line 759 keyword with leading/trailing spaces: " pc prop "

commit 8b59d5aec5fd5c4ea8346d1451ad5ee2bc8c93ea
Author: Volker Krause <vkrause@kde.org>
Date:   Sat Nov 19 12:59:34 2016 +0100

    Sync syntax definitions from ktexteditor

    Hopefully the last time before this will become the official location.

commit 04b9a7a8afcc113a881e014b9841b1e11abb5d38
Author: Volker Krause <vkrause@kde.org>
Date:   Sun Sep 25 12:51:16 2016 +0200

    Make syntax definition versions integers

    This follows an equivalent change in ktexteditor.

commit 569c2bb6569edf3d5451ef7fb99062ed27ec2432
Author: Volker Krause <vkrause@kde.org>
Date:   Sun Sep 25 12:19:09 2016 +0200

    Move syntax definition files into their own sub-directory

    Puts them on the same level as the themes, which is more consistent.

commit dd72de85bff71db86df7b19b12deec306894f58d
Author: Volker Krause <vkrause@kde.org>
Date:   Wed Sep 7 10:51:59 2016 +0200

    Move data files out of 3rdparty, as this will become the official source

commit 7af3457977a7141e7d7472b80c175aaad3ace822
Author: Volker Krause <vkrause@kde.org>
Date:   Wed Apr 13 19:39:15 2016 +0200

    Add syntax data files from upstream.

Changes to the file in ktexteditor.git
======================================

commit cda999c901a9b38439f1d3ffc4c4fc3ae717061c
Author: Volker Krause <vkrause@kde.org>
Date:   Sat Nov 19 12:50:33 2016 +0100

    Use syntax definitions from KF5::SyntaxHighlighting

    REVIEW: 129384

commit 354fda8b563ea6fcf66813f02aadae3349aa25c6
Author: Dominik Haumann <dhaumann@kde.org>
Date:   Sat Oct 15 22:11:18 2016 +0200

    Add modeline 'auto-brackets'

    And remove modeline 'auto-insert-doxygen' since it's not implemented

commit 857097d0b8ba6f8b67f40d75a178fdc87a05f8b3
Author: Dominik Haumann <dhaumann@kde.org>
Date:   Fri Sep 9 14:34:03 2016 +0200

    Highlighting definition files: round version up to next integer

    Ideally, the version attribute should have been a integer revision
    right form the beginning. The problem with the string-based variant
    is that it is unclear whether e.g. version "1.1" < "1.10", and some
    people even introduce more minor versions such as 1.10.1 etc.

    Simply using an integer will solve this problem. For now, KTextEditor
    supports the old behavior for compatibility, though. We will evaluate
    a final change for KDE Frameworks 6 again.

commit ae154b945b2cbef8d302960c16da7bc66e77e88a
Author: Dominik Haumann <dhaumann@kde.org>
Date:   Sun Jun 19 15:24:02 2016 +0200

    Add modeline 'folding-preview' of type bool

commit ea03089e51bf3cc04db5b50fe2422b984515b282
Author: Dominik Haumann <dhaumann@kde.org>
Date:   Sat Jun 18 22:53:13 2016 +0200

    Add modelines 'scrollbar-minimap' [bool], and 'scrollbar-preview' [bool]

commit 752ddb60ddc91ad63c54339f0849c7c7fe0fc41e
Author: Martin Walch <walch.martin@web.de>
Date:   Wed Sep 10 23:29:49 2014 +0200

    Clean up all kateversion numbers according to XML validation

    Since KDE 3.0, it is possible to update Kate highlighting files on a per
    user basis using a download dialog in the configuration menu, without
    the need to update the whole installation of KDE. To indicate
    compatibility, there is an attribute "kateversion" in the language
    element of the highlighting files. However, those values have become a
    mess over time.

    This patch is a radical clean-up of the kateversion values, setting each
    of them to the lowest possible value that makes sure that compatibility
    is only indicated if the update validates with the shipped definition
    file (language.dtd).
Related: bug 338787, bug 241104
    REVIEW: 120133

commit d1640b3b8c8ccaebc502466a4b37411a44a89d98
Author: Christoph Cullmann <cullmann@kde.org>
Date:   Sat Jul 26 15:41:46 2014 +0200

    sync hl files with 4.14 branch, some changes seem to have been lost in frameworks :/

commit ae41649fd8b65891a44d12fff5e42ad333b61e16
Author: Alex Merry <alex.merry@kde.org>
Date:   Sun Mar 23 16:58:19 2014 +0000

    Replace '@since KDE 4.x' with '@since 4.x' and remove inaccurate ETA

    Reviewed by: dhaumann@kde.org

commit 0d58f34ebf7bbca4d26f97a2cd3cb0024fa9b522
Author: Christoph Cullmann <cullmann@kde.org>
Date:   Mon Jan 6 20:53:23 2014 +0100

    Move ktexteditor code to the src directory.

commit e36c3caa32685120a3b3c709e6a1b19c644a8a6a
Author: Christoph Cullmann <cullmann@kde.org>
Date:   Mon Jan 6 20:53:23 2014 +0100

    Initial import from the monolithic kate.

    This is the beginning of revision history for this module. If you
    want to look at revision history older than this, please refer to the
    techbase wiki for how to use Git history grafting. At the time of
    writing, this wiki is located here:

    http://community.kde.org/Frameworks/GitOldHistory

    If you have already performed the grafting and you don't see any
    history beyond this commit, try running "git log" with the "--follow"
    argument.

    Branched from the monolithic repo, kate frameworks branch, at commit
    099c019f596b9037a7246215d7cf7d05a03ee8ed

Changes to the file in kate.git
===============================

commit 45672fc34028930d1e86d6a1cd252c1941d87024
Author: Christoph Cullmann <cullmann@kde.org>
Date:   Sat Jan 11 15:56:39 2014 +0100

    remove ktexteditor part, is in KF5::TextEditor now ;)

commit bf6269cc925747cd7beb789b4e9f3ba908cb1f27
Author: Christoph Cullmann <cullmann@kde.org>
Date:   Sat Jan 4 16:36:00 2014 +0100

    Fold KTextEditor and KatePart.

    KTextEditor will stay the public API, KatePart the implementation.

    This avoids to have always to jump through rings for any further extension and is the preparation
    to have a sensefull KTextEditor Framework, that shall stay BC for KF 5.x and allows to use the
    KTextEditor API without additional stuff required.

commit 4cf0561cb23ef61d821f89394c574e5ccc9e6bb1
Author: Alex Turbov <i.zaufi@gmail.com>
Date:   Sat May 4 09:46:41 2013 +0400

    added 'indent-pasted-text' mode variable

commit 67e142c70749a79cf0e291d6c8c67ef58a22dde5
Author: Alex Turbov <i.zaufi@gmail.com>
Date:   Tue Nov 6 00:54:18 2012 +0400

    fix broken boolean values higlighting

commit d51d4820a854985a833f28f1facac9d9287466ab
Author: Christoph Cullmann <cullmann@kde.org>
Date:   Fri Nov 2 23:11:59 2012 +0100

    remove auto bracket feature in kate
    the auto bracket plugin is much more versatile
    added to it feature to auto-complete { for tex, too

commit cc9bdc3e76a8d78549cb0832afd0133bc50878e7
Author: Alex Turbov <i.zaufi@gmail.com>
Date:   Mon Oct 29 06:26:21 2012 +0400

    remove deprecated modeline

commit 248a727afba44bacf38e7c783ae35003bc0691c3
Author: Dominik Haumann <dhaumann@kde.org>
Date:   Sat Oct 27 16:10:44 2012 +0200

    add remove-trailing-spaces, merge Boolean True/False

commit 5b6d7fca32468767fba9bfe2b4fac59ec64b43b0
Author: Alex Turbov <i.zaufi@gmail.com>
Date:   Thu Mar 15 20:07:45 2012 +0400

    version bump

commit 1a5b5531bc4fad0708de026762a5be40d7fd0046
Author: Alex Turbov <i.zaufi@gmail.com>
Date:   Thu Mar 15 19:49:27 2012 +0400

    fix modeline hihglighting according Dominik notes

commit adda725180dae109afa2bc1aa1f712534ee759bd
Author: Dominik Haumann <haumann@kate-editor.org>
Date:   Thu Mar 15 14:50:35 2012 +0100

    adapt attribute names everywhere

commit 8d8f93db2f8d0bc8ecc4e5475e8042dedde6e1ab
Author: Alex Turbov <i.zaufi@gmail.com>
Date:   Thu Mar 15 17:04:59 2012 +0400

    rename styles

commit d71ded1afedfc569bec885aba84a8f91b896b2de
Author: Alex Turbov <i.zaufi@gmail.com>
Date:   Tue Mar 13 13:07:04 2012 +0400

    Added highlighting for kate modelines. Note that deprecated modelines
    are not included to provoke users to avoid them.

Test Plan: make && make test

Reviewers: vkrause, cullmann, martinwalch, turbov

Reviewed By: vkrause, cullmann, turbov

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D14824

M  +2    -2    data/syntax/modelines.xml

https://commits.kde.org/syntax-highlighting/857a277110d514065392d670382d2cc5a13bb244