jVi NEEDSWORK/TODO list

Test Infrastructure
  - What's needed is a Document in a JEditorPane. With that and the current
    stuffBuf like behavior, should be easy to write tests.
  - Define best way to set up input/expect data.


Document Locking
  - Take a read lock during pumpChar
  - Upgrade to write lock when modifying (probably automatic in swing document)
  - May have special situations where want to manually upgrade to write lock.


New
  - set REUSE flag for tagstack stuff ^] & ^t .
  - When create/open textView sync up with shares as needed;
    See syncTextViewInstances and its comment for more info.
  - Use jVi bindings for commit dialog test area
    See org.netbeans.modules.mercurial.ui.commit.CommitPanel;
    It uses JTextArea's setWrapStyleWord and setColumns and setTab
    There's example in jVi standalone for doing wrap in JEditorPane.
  - PositionsBag vs OffsetsBag for HighlightsLayer. Currently both blockmode
    and search highlighters are OffsetsBag. Maybe search should be positions?
  - For ins_ctrl_g() do no_mappings dance.
  - after [DOWN] vm.viewLine gets called 5 times.
  - test without freezer.
  - implement fdoclose=all


Bugs
  - See sourcforge...
  - getRecordedLine() and :command issues
    colon characters should come through typebuf? (see in cleanup below)
  - ^F/^B count
  - Handing of no_mapping/allow_keys.
    What does allow_keys really do?
    Edit handling of no_mapping/allow_keys.
  - g/foo/s/bar/baz
    Problem is that substitue is executed fully each time,
    would like devise a way to parse s command once for a given g.
    At a minimum, don't get the regexp again. (there's a regexp cache now)
  - Search issues; get it all up to vim7.
    Verify options SEARCH_FOLD,SEARCH_PEEK etc.
    support SEARCH_OPT, SEARCH_NOOF, SEARCH_PEEK
  - substitute command add more features
    - more of the s///flags
  - Create JUnit testing infrastructure. Create tests.
  - in jVi-standalone, wrapped lines and TAB chars, eg. following one line
        asdf asdf asdf asdf asdf asdf asdf asdf asdf asdfxxxxx{space..}
        aaa{tab}#sd asdf asdfhasdklfjh asdklfjhasdf asdfkljhasdf asd
        asdfasdf asdf asdf asdf
    If curson on '#' (2nd view line) after left/right motion, then gj/gk
    don't go to the correct column. How far off and where it goes is
    dependent on the number of {space} chars at the end of the first view
    line. The problem does not appear in NB.


NetBeans Embedding
  * If using non-modal command line, the command completion doesn't
    get keys. In particular up/down/CR.
  - {begin,end}undo issue and atomic lock stuff.
    stop using atomic lock for programmatic changes,
    to do this must automatically undo anything that was done
    that caused a problem.
    - example bug: create multi-line ^V block, do "Ix{ESC}". This requires
      two undo.
  - auto add a bunch of ^W bindings, for example ^Wc to close a window
    See play/fs-dobj for some examples.
    Some NB issues that need fixing:
        - Multikey shortcut doesn't override single key shortcut
          Adding multi-key shortcut via layer.xml doesn't remove single key
        - Shortcut missing in Options menu
          adding binding, eg Alt-U, in layer.xml doesn't show up in shortcuts
          display in options. (but shortcut as part of a new action does).
          And the action's generated layer.xml seems same
    Following is (may be) related:
        - Adding an multi-key binding doesn't remove single key binding.
          There a bug filed a while ago
  - Consider org.netbeans.spi.editor.typinghooks in editor lib 2,
  - find out how to catch/bypass the dialog ESC handling, so that jVi
    operates more comfortably in a dialog.
    - It does work in some dialogs, for example "new watch" seems to
      have a keybinding for ESC, when jVi not active ESC dismisses that
      dialog.
  - ^W^W Eval Window requires click
  - diff window
    - ^W^E for diff window requires click
    - :q in diff window


NetBeans Platform Bugs
  - editor focus lost after next diff action changes file
  - in NB's diff window, delete-a-diff (make two side the same) and the next
    diff is offscreen. Hit the "next-diff" button, and a diff is skipped.
  - See umbrella bug for jVi in NetBeans
    Bug 179047 - jVi integration


Features
  - See sourcforge...
  - usage of shell variable in "external process" commands
  - options sidescroll, sidescrolloff
  - :brwose {command} for 'e', 'w'...
  - {sf} Add autocmd, at least a simple form of it.
  - Have an option(s) for multiline matching. E.g. handle \n in pattern
    and allow '.' to match newline.
    Create CharSequence that wraps multiple Segment, then can use Segment's
    partial return and scan whole file without gap content copying.
  - {sf} Support the vim search offset, also the "/test 1/;/test" stuff.
    Recent do_search/searchit rewrite better positioned for multi search stuff
  - :nomads, :winnr
  - There is now an internal findmatch which does a pretty good job with '%';
    it is either/or. Allow a fallback from platform to internal? For example
    for the '#'.
  - {sf} middle mouse button insert
  - :browse
  - persist jumplist
  - Handle tag file
      - tag generation in java
        - http://www.ars.net/jtags/
  - Standalone:
    - indent: integrate jindent or somesuch (or port vim)
  - for filter commands use a temp file
  - Use Character class for iswhitespace...


NetBeans Feature
  - rework status window issues.
    - when scroll clears status, give a few seconds; currently status line
      persists through several scrolls.
    - Could use a long timer, for example after 1st scroll, rewrite message
      with a timer.
    - clear message when change mode, for example, "^Gixxxx[ESC]"
  - Have option for jVi shortcuts, several ^W at least.
    See options.keymap: KeymapManager, KeymapModel, LayersBridge
    and editor.macros: MacroShortcutsInjector and MacrosKeymapManager.
    There's Utilities.keyToString,stringToKey
    Note: jvi has been made a friend in options.keymap
  - global shortcut key to attach/install jVi to any text component,
    in particular JTextArea for commit messages
        See [platform-dev] Re: Magic global accessibility keys
        in mail folder: Developement/NetBeans/Wiki
        [Action.this.]putProperty("OpenIDE-Transmodal-Action", true);
  * brace matching interface should give access to offsets
    see the '%' code in Normal
  - NB ":tog" has problems with debug... get it to interoperate with sliders.
  * Simplify adding ":" random colon commands.
    Require an escape key for these commands so jVi not poluted?
    Clean up module/package exports, make NB "fried" of jVi?


Anomalies
  - incomplete port of ^t, ^d in input mode
      - '^'^d (remove all indent) isn't supported
      - if cursor is before first non-blank, it is left at the
        first non-blank. Position within indent should be maintained.
      - Replace stack is ignored
      - 'start of insert' should be repositioned, its left alone.
  - Extend jVi jumplist (^O, ^I) implementation to work between files.
    This seems almost impossible, jump list is per window and jVi
    has a 1-1 on window-file; can not swap contents of window.


Documentation
  - Parse jVi docs for html, javahelp, per topic help. Per topic used for
    popup as NetBeans' doc popup; in NB have ":he x" list all matching *x*.
  - include notes, Murry doc
  - Add {jVi Xxx category} to vimhelp for options.
  - Add {works with :set} to vimhelp for options.
    Also vimhelp list of what works with :set.
    (may become moot if all things work with set)
  - Review javadocs
    - Role of AppView as Registry
    - Registering colon commands


Ctrl-W commands
  - implement more windows options
    eadirection, winfixheight,...
  - win_split, win_move
    more complete implementation that doesn't depend on reflection
    - See Bug 198657 - APIs to work with Modes
                       (implement jVi window split/move/... commands)
  - win_move has problems, nb issues
  - study core.windows in detail
      - look interesting
        Central.userDroppedTopComponentsAroundEditor
        Central.userDroppedTopComponentsIntoEmptyEditor
        - from WindowDnDManager.performDrop
          also from performDrop:
        WindowDnDManager.dragStarting # EditorView impl a TopComponentDroppable

          In performDrop, when moving ed to a different mode,
            droppable is a DefaultSplitContainer$ModePanel
            and the ViewElement seems to be the ed after which to put dragged ed

                if(viewElement instanceof EditorView)  IS FALSE
          so enter,
                } else if(viewElement instanceof ModeView) {
          and does
                controller.userDroppedTopComponents(modeView,
                        tcArray, ((Integer)constr).intValue());
          which ends up in Central.userDroppedTopComponents(...
                updateViewAfterDnD(
                            moveTopComponentsIntoMode(mode, tcs, index));


Mappings
  - handle_redo and mappings interactions
    the pump loop should probably incorporate redo issues
  - put mapping error msg into output window
  - map command to generate map-cmds for current mappings
    A button, Current, in the mappings dialog, 
  - ^V issues, should prevent mapping
  - add p_mmd option (currently hardcoded)
  - keybinding for *everything* possible and a big default mapping.
    F-keys, keypad. Include multiple modifiers at once.  Ctrl,Shft,Alt,Meta
    - when specify a mapping for a key, and key is not "caught"
      ask if the key(s) should be caught.
      - NOTE: if auto-catch, then in :map list output make it clear which
              keybindings have been taken away.

  - map {lhs} <Nop>
  - allow space chars in right hand side?
  - accept '\' escapes
    maybe part of globally handling escapes


Options
  - vim's :options command (brings up dialog)
  - Have "DEFAULT" button for all options/properties
  - Tool tips in property dialog


Cleanup
  - Consider getting rid of 
        Misc.xlateViKey(ViManager.getInsertModeKeymap(), c, G.getModMask())
    would just handle ^T (or whatever) in the redobuf? Other issues?
    ^< and ^> might be a problem.
  - test numbered marks
  - command entry to
      - bypass widget completely when possible
      - handle all input and manipulate combo box directly
      - just get rid of combo through history handling... in progress 2020/01/19
  - Reduce public methods
    - in ViMan there's all the mouse stuff is public. Create a class which
      bounces to them and give it to Caret impl, then they can be private.
    - ViFactory is a candidate for a Factory implementation that acts as
      a base class with protected things like access to curwin.
    - Further hide things in "G"; some of the methods expose too much, G.curwin()
  - to GetChar::docRemove pass object that knows how to get/work with the
    removed text rather than getting the removed text directly, then don't
    have to construct the removed text if not needed.
  - at end of do_pend... when save current vis area do vi_curswant
  - use CountDownLatch for commandLine/glass wait
  - change curswant to also track x position
    Probably need methods either take char pos or "X" float.
    This is a MUST for multi-width fonts.
  - jViFeature handling. Make more things features. Separate file/class?
  - in ViTextView there is replaceString,deleteChar,insertText
    should be in Buffer


Performance
- The biggest performance hit is from swing's document change operations.

  This is clearly seen with the block mode operation profiling. For these,
  I think the change text lines could be constructed in a separate string and
  swapped in en masse. The trick is to preserve the marks.

  This same technique could work with '>>' and '<<'.
- lazy creation of colon commands (probably not a big issue)


Blue Sky

  - Multithread
      - Do long running ops in separate thread
      - Have the main jViThread not be the EventThread.
      - event thread used to queue keyboard input for use by jVi thread.
        jVi thread can then do "getc" where/when it wants to.
        ^C can have better effect.
      - implement ^C (when there's separate thread for long running things....)
  - Commands that take a program, e.g. '!', '=', have some way to hook
    them to other loaded classes.
  - implement and extend EditorPane, Document and AbstractDocument.Content 
    tuned for vi. Make sure to always be able to go native.
    . do getChar from cache'd segment?
  - Implement a virtual cursor (use WCursor as a virtual cursor) so that
    cursor movement and/or searching can occur without queuing up redraw.
    Then have an update method.
  - how to display control characters. Could extend view somehow and graphically
    fix them up. NB is going to implement something.



Copyright © 2022 Ernie Rael
Contact jVi support