/bundles/plugins-trunk/SideKick/macros/JumpToEndOfFunction.bsh
Unknown | 23 lines | 20 code | 3 blank | 0 comment | 0 complexity | 67db104c7c191466a19da2104a891e51 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- void JumpToEndOfFunction(JEditTextArea textArea)
- {
- int position = textArea.getCaretPosition();
- // Select the current asset
- sidekick.SideKickActions.selectAsset(view);
- // Search for the first occurrence of '{'
- Selection[] selection = textArea.getSelection();
- String s = null;
- if (selection == null || selection.length == 0) {
- return;
- }
- int start = selection[0].getStart();
- s = textArea.getSelectedText(selection[0]);
- for (int i = s.length() - 1; i >= 0; i--) {
- if (s.charAt(i) == '}') {
- textArea.setCaretPosition(start + i);
- return;
- }
- }
- }
-
-
-