Menu

#185 Backspace and autocompletion

Moderate
closed-works-for-me
nobody
backspace (1)
5
2022-11-16
2014-12-20
No

I cannot use backspace to delete any character if the text has been autocompleted.
Eg: sout + tab -> System.out.println("").
I canot use backspace to delete any character in that line, however backspace works normally for other user entered lines.

Discussion

  • Prasanth Ravi

    Prasanth Ravi - 2014-12-20

    System --

    Netbeans 8.0.2
    OpenJDK 1.8.0_25
    Linux 3.16 x64

     
  • Prasanth Ravi

    Prasanth Ravi - 2014-12-20

    Edit:

    The backspace key is not deleting in non autocompleted terms too. It works intially, but then refuses to delete characters once the line has been completed and parsed I think.
    I wonder if this is a feature ?

     
  • Ernie Rael

    Ernie Rael - 2014-12-20

    I can not reproduce this. I did code completion while in input mode.

    Are you in input mode when you do the autocompletion?

    If you go into input mode after the autocompletion, you might be having an interaction with the 'bs' option. See

    Menu>Tools>Options>jVi>BufferModifications>'bs'

     
  • Prasanth Ravi

    Prasanth Ravi - 2014-12-20

    Yes, in insert mode.
    Yes, setting bs to '2' solved my problem, it was set to '0'.
    I wonder if setting it to '0' is advisable as the default option ? Because vim does not work that way by default.

     
  • Ernie Rael

    Ernie Rael - 2014-12-20

    Actually, vim default is '0'.

    Even with 'bs' set to '0' I can not reproduce what you are seeing.

    Are you using the arrow keys while in insert mode before doing the backspace? The arrow keys change the "start of insert" just like in vim.

     
  • Prasanth Ravi

    Prasanth Ravi - 2014-12-21

    No, I'm not using the arrow keys.
    Also I have fresh install of Netbeans 8.0.2 and jVi. Haven't made any changes. Should I post a screenshot or a video ?

     
  • Ernie Rael

    Ernie Rael - 2014-12-21

    I downloaded/installed 8.0.2, jdk 1.8.0_25, started NB (did not import settings from previous install)
    did File>NewProject>JavaApp
    In main(...) went into input mode and entered: sout+TAB+BS+BS+BS+BS+BS+BS

    Observed that things worked as expected: sout was expanded and the following backspaces did the right thing leaving:

    Syste");

    with the caret between the e and double quote.
    Note, I made no NB or jVi option changes.

    I'm on Win7, but hard to see how that would be an issue.

    If you want to pursue this, I can assist you in debugging it.

    Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
    Java: 1.8.0_25; Java HotSpot(TM) 64-Bit Server VM 25.25-b02
    Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b18
    System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
    User directory: C:\b\nb-test\nb-8.0.2\T1\userdir
    Cache directory: C:\b\nb-test\nb-8.0.2\T1\cachedir

     
  • Ernie Rael

    Ernie Rael - 2014-12-21
    • status: open --> open-works-for-me
     
  • Ernie Rael

    Ernie Rael - 2014-12-21

    Forgot to say that I installed jVi using the plugin manager. First installed the jVi update center, then installed jVi modules.

     
  • Prasanth Ravi

    Prasanth Ravi - 2014-12-22

    Sure, if you want more info on it.

     
  • Ernie Rael

    Ernie Rael - 2014-12-22

    Instructions for setting up jvi for debug at:

    https://sourceforge.net/p/jvi/nbvi/ci/default/tree/README

    The problem probably comes from the

    private static boolean
    ins_bs(char c, int mode, MutableBoolean inserted_space_p)

    method in Edit.java.

    It may be an issue with the complex "if" expression at the beginning of this method, or an unexpected value of the Insstart variable. Since it works with 'bs'=2 and not with 'bs'=0, the code

        || (!can_bs(BS_START)
            && (arrow_used
                || (G.curwin.w_cursor.getLine() == Insstart.getLine()
                && G.curwin.w_cursor.getColumn() <= Insstart.getColumn())))
    

    is suspect. When 'bs'=0, !can_bs(BS_START) is true; meaning you can not backspace over the start of the insert. Insstart (the start of insert) should point at or before the first character of "sout" in your original input. If it is not, then you will have the problem.

     
  • Ernie Rael

    Ernie Rael - 2022-11-16
    • status: open-works-for-me --> closed-works-for-me
     
  • Ernie Rael

    Ernie Rael - 2022-11-16

    Can't reproduce. No comments several years. closing.

     

Log in to post a comment.

MongoDB Logo MongoDB