Menu

#39 Are they bugs of xnedit?

1.4
closed
nobody
None
2025-01-13
2024-10-29
SweetTyler
No

1) While I edit some files containing long lines (BTW, I set line wrap to off), if I drag the right border of xnedit window from left to right, sometimes the characters close to this border are not refreshed correctly, as shown in the attached snapshot. This is also possibly caused by the operation system, but I am not sure.
2) When I tried to edit a large file (376269036 bytes, 7235944 lines), xnedit could load the file, but when I tried to delete a few lines, then xnedit crashed with error "Segmentation fault (core dumped)". I am not sure if this was due to the file is too large for xnedit, or it's a bug.

1 Attachments

Discussion

  • SweetTyler

    SweetTyler - 2024-10-31

    Additional info:

    I can reproduce the first one with xnedit-1.5.3.
    If I use xnedit-1.5.3 then xnedit doesn't crash when editing the same large file, so the second one is a bug in the latest version.

     
  • Pyrphoros

    Pyrphoros - 2024-11-01

    Can you always reproduce the crash?

     
  • SweetTyler

    SweetTyler - 2024-11-01

    Yes. I can always reproduce the crash with two text files. Please try with the following steps:

    1) Copy the following line

    19892 5620 5600000 19940000 5620000 19892000

    7091513 times to create a file named "aa.xps" (368758676 bytes).

    2) Type "xnedit aa.xps", and after xnedit load the file, select the first 30 lines with Shift+ Down arrow" and hit the delete key.

     
  • Pyrphoros

    Pyrphoros - 2024-11-03

    The crash should be fixed now.

    The rendering bug still remains. I was not able to reproduce it yet, these types of bugs can also depend on the window manager/desktop environment, so I will have to try it on different platforms.

     
  • SweetTyler

    SweetTyler - 2024-11-03

    Thank you for the fix!

    Regarding the rendering issue, I strongly suggest you disregard my report (and close the ticket), as I’m using X2Go—a remote desktop tool for Linux that’s not widely used. If you’re unable to reproduce the issue, it’s most likely not related to an xnedit bug.

     
  • SweetTyler

    SweetTyler - 2024-11-10

    I found if I increase a bit the range between leftclip and rightclip in function

    static void redisplayLine(textDisp *textD, int visLineNum, int leftClip,
    int rightClip, int leftCharIndex, int rightCharIndex)"
    ...
    leftClip = max(textD->left, leftClip)-5;
    rightClip = min(rightClip, textD->left + textD->width)+5;
    ...

    Then the first issue I reported would be solved. I don't understand the code so I am not sure if 5 is the optimal value.

     
  • SweetTyler

    SweetTyler - 2024-11-11

    Not a right solution - above modification causes another issue.

     
  • SweetTyler

    SweetTyler - 2024-11-11

    It seems if I change:

        redisplayLine(textD, line, left, left+width, 0, INT_MAX);
    

    to
    redisplayLine(textD, line, 0, INT_MAX, 0, INT_MAX);

    in functionTextDRedisplayRect(...), everything works fine.

     
  • Pyrphoros

    Pyrphoros - 2024-11-11

    This works as a workaround, however it forces a full repaint of the whole line which has some impacts on performance.

    When I have time, I will try to reproduce this issue with X2Go.

     
  • SweetTyler

    SweetTyler - 2024-11-11

    OK. Thank you so much.

    A better one I've found is:
    redisplayLine(textD, line, left-10, left+width, 0, INT_MAX);

    It's not necessary to try X2go since I'll use something else in the future.

     
  • SweetTyler

    SweetTyler - 2024-11-17

    The best solution is redisplayLine(textD, line, left-5, left+width, 0, INT_MAX), where "5" comes from "textNmarginWidth" defined in text.c as below:

    {textNmarginWidth, textCMarginWidth, XmRInt, sizeof(int),
      XtOffset(TextWidget, text.marginWidth), XmRString, "5"},
    

    it seems when redisplay a line, the margin is not taken into account. If I what I think is correct, then this is a bug anyway.

     
  • Pyrphoros

    Pyrphoros - 2024-11-18

    I've added your suggested code change.

     
  • SweetTyler

    SweetTyler - 2024-11-19

    Thanks for the fix.

     
  • Pyrphoros

    Pyrphoros - 2025-01-13
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB