#5 FR for Show It: Add "search" and "go to line"

v1.0 (example)
open
nobody
GUI (1)
5
2013-09-20
2013-05-28
Simon Sobisch
No

Having text functions like "find" [CTRL]+[F] and "go to line" [CTRL]+[G] in "Show It" would be really useful.

Related

Discussion: Missing Support for COBOL 2002 (level 78, EXIT SECTION/PERFORM, length of section names, BASED/ALLOCATE/FREE)

Discussion

  • KrisDS
    KrisDS
    2013-07-27

    r120: Added "go to line" to the GUI. Shortcut is "meta+L" (should be "ctrl+L on Windows).

     
  • Simon Sobisch
    Simon Sobisch
    2013-07-29

    The Function works fine if called from the menu but no combination of key-presses works (I've tried [Alt]/[Ctrl]/[Win], all with/without [SHIFT]) - the same applies to meta+O, meta+R, meta+W.

    Simon

     
  • KrisDS
    KrisDS
    2013-07-29

    Thanks for the report. I changed it now so that you can use either CTRL+<somekey> or META+<somekey>. Can you try again from the latest source and let me know if that works for you ?

     
    • Simon Sobisch
      Simon Sobisch
      2013-07-29

      Just got ANT on my system for the first time and tried r124 (as expected: doesn't work) and r125 (as expected: [Ctrl] worked fine). It just looks kind of weird because [Meta] is set as first accelerator and therefore is shown in the menu (this could really confuse windows users...).

      Not sure if a rewrite of setAccelerators() doing item.setAccelerator on the first keyStrokeDefintion depending on System.getProperty("os.name") would be useful (skip meta depending on "Windows").

      Simon

       
  • KrisDS
    KrisDS
    2013-07-30

    You're right that the discrepancy between the menus and the actual accelerators might be confusing. So another attempt at this in r127: I now set it up as "meta <key>" on Mac OS X, "ctrl <key>" on others. So it's platform dependent, with using CTRL as the default on everything except Mac. This way there is only one way of doing it on each platform, and no more mismatch between what the menus say and what the user should type.

     
    • Simon Sobisch
      Simon Sobisch
      2013-07-30

      Works fine now. You may want to support other mac versions, too, by changing

      -       if ("Mac OS X".equals(os))
      +       if (os.toUpperCase().indexOf("MAC") == 0)
      

      Just an idea, not a request.

      Simon

       
  • KrisDS
    KrisDS
    2013-09-11

    Basic search functionality has been added in [r158]. Check the changelog for the details.

    Simon, please let me know if this makes for an acceptable implementation of the search functionality. If so, feel free to close this issue.

     

    Related

    Commit: [r158]


    Last edit: KrisDS 2013-09-11
    • Simon Sobisch
      Simon Sobisch
      2013-09-19

      The search function in r158 has two issues:
      - The positioning is not correct (I'd expect it to position [and mark/highlight]) the stuff that was to be find)
      - As COBOL words are not case-sensitive the find function shouldn't default to or even be case-sensitive neither [while a checkbox "case-sensitive" in find dialogue would be nice]

      We can close this ticket after these two are done (and add another low-priority one for Regex ;-)

      Simon

       
  • KrisDS
    KrisDS
    2013-09-20

    [r160] adds further tweaks to the search action:

    • It's now case-insensitive (sorry, no checkbox toggle)
    • It is using regular expressions
    • And the highlighting has been improved
     

    Related

    Commit: [r160]

    • Simon Sobisch
      Simon Sobisch
      2013-09-23

      Looks good but the bug with the wrong position [and mark/highlight] is still there. I've discovered the reason:

      • with each line the position moves 1-2 chars more to the right side (continuing to the next line, if the line isn't long enough)
      • if source file has MAC line ending, position is correct (but source view shows only one line, maybe this only "reverts" the bug)

      Simon