After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 722720 - indentation-c-style: Change get_line_indentation() behaviour.
indentation-c-style: Change get_line_indentation() behaviour.
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: language-support-c-cpp-java
unspecified
Other All
: Normal normal
: ---
Assigned To: Naba Kumar
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2014-01-21 18:34 UTC by Carl-Anton Ingmarsson
Modified: 2014-01-25 12:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
indentation-c-style: Change get_line_indentation() behaviour. (2.60 KB, patch)
2014-01-21 18:34 UTC, Carl-Anton Ingmarsson
accepted-commit_now Details | Review

Description Carl-Anton Ingmarsson 2014-01-21 18:34:12 UTC
See attached patch.
Comment 1 Carl-Anton Ingmarsson 2014-01-21 18:34:14 UTC
Created attachment 266912 [details] [review]
indentation-c-style: Change get_line_indentation() behaviour.

Change it to not only search on the current line for the first right brace but
search until one is found or a right bracket is found.

This fixes indentation issues with c++11 type return value syntax such as:

auto testFunction()
  -> int {
  return 5;
}

Where the return type is put on another line different from the end right brace.
Comment 2 Sébastien Granjoux 2014-01-25 08:50:36 UTC
Review of attachment 266912 [details] [review]:

Thank you for your patch, you can commit it. Your code is simpler than the previous one, but it's difficult to be sure that there is no regression without some tests.
Comment 3 Carl-Anton Ingmarsson 2014-01-25 12:11:18 UTC
(In reply to comment #2)
> Review of attachment 266912 [details] [review]:
> 
> Thank you for your patch, you can commit it. Your code is simpler than the
> previous one, but it's difficult to be sure that there is no regression without
> some tests.

Yeah, hopefully it doesn't cause any regressions. The indentation code would really benefit from some tests.