[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#991702: kate: Regression in Ruby indentation in Bullseye



Package: kate
Version: 4:20.12.2-1
Severity: normal
X-Debbugs-Cc: jaroslav@thinline.cz

Dear Maintainer,

after upgrading from Buster to Bullseye, Kate text editor's behaviour
regarding Ruby indentation changed with significant regression

The bug can be reproduced like this (correct behaviour first):

- open new document, switch its indentation to Ruby
- type

if v =~ /re/i<enter>

- cursor correctly indents one tab to the right. All subsequent lines are indented as well until you type "end", which is immediatelly and automatically
de-indented:

if v =~ /re/i
    statement
end

- same example but with the regexp being case-sensitive, ie. no "i" at the end

if v =~ /re/<enter>

- cursor indents two tabs to the right, my guess would be the indenter doesn't consider that regexp to be complete (expecting at least one more letter).
Next line is de-indented to a single tab indentation, which is correct,
but indentation in most of the code after such block does not work correctly.
Final code looks like this:

if v =~ /re/
        statement
    statement
end

The following is more elaborate example of indentation errors caused by this regression. All indentation shown is done by the editor, nothing is adjusted
manually:

statement =~ /re/
        <two tabs, cursor is here, no text, just newline>
        begin
if v =~ /re/
        statement
    statement
end
rescue
    statement
    end
    <cursor stays here>

The following is the correct behaviour observed when the regexp
is case-insensitive (again, no manual indentation adjustment):

statement =~ /re/i

begin
    if v =~ /re/i
        statement
        statement
    end
rescue
    statement
end

I tried to find out the code responsible for this. Kate version in Buster had
a package kate-data containing indentation scripts, notably

/usr/share/kde4/apps/katepart/script/indentation/ruby.js

But I am unsure if that was actually in use. Trying to put that file
(and its dependencies found by looking at require statements in the script)
into ~/.local/share/katepart5/script/indentation as documented in

https://docs.kde.org/stable5/en/kate/katepart/dev-scripting.html

broke Ruby indentation altogether (no automated indentation was taking place)

I haven't been able to figure out where the indentation-related code
is stored now, so I wasn't able to try to fix this myself.

Any help or advice would be appreciated
Thanks


-- System Information:
Debian Release: 11.0
  APT prefers testing-security
  APT policy: (500, 'testing-security'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-7-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages kate depends on:
ii  kate5-data                               4:20.12.2-1
ii  kio                                      5.78.0-5
ii  ktexteditor-katepart                     5.78.0-3
ii  libc6                                    2.31-13
ii  libkf5bookmarks5                         5.78.0-2
ii  libkf5completion5                        5.78.0-3
ii  libkf5configcore5                        5.78.0-4
ii  libkf5configgui5                         5.78.0-4
ii  libkf5configwidgets5                     5.78.0-2
ii  libkf5coreaddons5                        5.78.0-4
ii  libkf5crash5                             5.78.0-3
ii  libkf5dbusaddons5                        5.78.0-2
ii  libkf5guiaddons5                         5.78.0-3
ii  libkf5i18n5                              5.78.0-2
ii  libkf5iconthemes5                        5.78.0-2
ii  libkf5jobwidgets5                        5.78.0-2
ii  libkf5kiocore5                           5.78.0-5
ii  libkf5kiofilewidgets5                    5.78.0-5
ii  libkf5kiogui5                            5.78.0-5
ii  libkf5kiowidgets5                        5.78.0-5
ii  libkf5newstuff5                          5.78.0-4
ii  libkf5parts5                             5.78.0-3
ii  libkf5plasma5                            5.78.0-3
ii  libkf5service-bin                        5.78.0-2
ii  libkf5service5                           5.78.0-2
ii  libkf5syntaxhighlighting5                5.78.0-2
ii  libkf5texteditor5                        5.78.0-3
ii  libkf5textwidgets5                       5.78.0-2
ii  libkf5threadweaver5                      5.78.0-2
ii  libkf5wallet-bin                         5.78.0-2
ii  libkf5wallet5                            5.78.0-2
ii  libkf5widgetsaddons5                     5.78.0-2
ii  libkf5windowsystem5                      5.78.0-2
ii  libkf5xmlgui5                            5.78.0-2
ii  libkuserfeedbackcore1                    1.0.0-3
ii  libkuserfeedbackwidgets1                 1.0.0-3
ii  libqt5core5a                             5.15.2+dfsg-9
ii  libqt5dbus5                              5.15.2+dfsg-9
ii  libqt5gui5                               5.15.2+dfsg-9
ii  libqt5sql5                               5.15.2+dfsg-9
ii  libqt5widgets5                           5.15.2+dfsg-9
ii  libqt5xml5                               5.15.2+dfsg-9
ii  libstdc++6                               10.2.1-6
ii  plasma-framework                         5.78.0-3
ii  qml-module-org-kde-kquickcontrolsaddons  5.78.0-2
ii  qml-module-qtquick-layouts               5.15.2+dfsg-6
ii  qml-module-qtquick2                      5.15.2+dfsg-6

Versions of packages kate recommends:
pn  sonnet-plugins  <none>

Versions of packages kate suggests:
pn  darcs            <none>
pn  exuberant-ctags  <none>
ii  git              1:2.30.2-1
pn  khelpcenter      <none>
pn  konsole-kpart    <none>
pn  mercurial        <none>
ii  subversion       1.14.1-3

-- no debconf information


Reply to: