Bug 382950

Summary: Indenter: Lua "function " keyword picked up in string
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: FeepingCreature <default_357-line>
Component: indentationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph, devel, waqar.17a
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description FeepingCreature 2017-07-31 09:17:51 UTC
Steps to reproduce:

1. Open kate
2. Switch syntax mode to "Lua"
3. Type in "function " and press return.

What happens:

kate indents the following line, presumably because it interprets the string as a function declaration.

What should happen:

Not that.
Comment 1 Dominik Haumann 2019-01-30 21:29:20 UTC
@Jonathan, since you are the author of the lua.js, could you have a look into this?
https://phabricator.kde.org/source/ktexteditor/browse/master/src/script/data/indentation/lua.js

I guess with functions like document.isCode(), isString(), isComment() etc. this probabl can easily be fixed. See API in:
https://phabricator.kde.org/source/ktexteditor/browse/master/src/script/katescriptdocument.h

See also: https://docs.kde.org/stable5/en/applications/katepart/dev-scripting.html