patchGNU nano - Patches: patch #10303, Extra row in the help bar for...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #10303: Extra row in the help bar for high-res X display windows

Submitter:  Joe Jamison <joejamison>
Submitted:  Sat 07 Jan 2023 07:57:28 PM UTC
   
 
Priority:  3 - Low Status:  Wont Do
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  None

Tue 10 Jan 2023 03:02:34 PM UTC, comment #2: 

Thanks for the patch.  But...  Conditionalizing the number of help rows on the number of columns the terminal has seems wrong to me.  I would have expected the help rows to be conditionalized on the number of rows (LINES) the terminal has: when this number is high, it might be fine to use an extra row for the help lines.

However, using three rows for the help lines would break the pairing of two similar shortcuts in the upper and lower help line, so I will not apply your patch.

(You might be interested in another approach -- see patch #8900.)

Some comments on details of your patch.  You use two extra variables, `max_entries` and `entry_cols`.  These are strange and unfitting names to me.  The two variables have the exact same purpose, so they should be named the same.  Fitting names could be `helprows` or 'rows_of_help`, or similar, because it holds the number of shown help lines.  Furthermore you have a spurious change in changes_something() in src/nano.c -- it looks like you made a mistake during rebasing?

Benno Schulenberg <bens>
Group administrator
Sat 07 Jan 2023 11:57:37 PM UTC, comment #1: 

I was doing some additional testing, and it turns out that this patch will cause a SIGFPE with certain window sizes and help bar function numbers.  On winio.c, removing a decimal from entry_cols truncs itemwidth to the next-smallest integer to prevent an unsigned overflow.  This could be replicated with certain resolutions, by opening the Help Screen (^G), and then performing a text search (^W).


After applying the original patch, update winio.c:2444 from:

    itemwidth = COLS / ((number + 1) / entry_cols);

to:

    itemwidth = COLS / ((number + 1) / (entry_cols - 0.01));

A replacement patch is attached.

(file #54201)

Joe Jamison <joejamison>
Sat 07 Jan 2023 07:57:28 PM UTC, original submission:  

When using nano on a high-resolution X display, there can be room for the help bar to be expanded an additional row.  If the window has more than 160 columns, this patch will enable nano to add a third line of shortcuts.

Joe Jamison <joejamison>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by joejamison (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-03-12 bens Open/ClosedOpen Closed
    2023-01-10 bens Priority5 - Normal 3 - Low
        StatusNone Wont Do
    2023-01-07 joejamison Attached File- Added 0001-Extra-row-in-the-help-bar-for-high-res-X-display-windows.patch, #54201
    2023-01-07 joejamison Attached File- Added 0001-Extra-row-in-the-help-bar-for-high-res-X-display-windows.patch, #54197

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code