Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#77 column markers

open
nobody
None
5
2003-03-11
2003-03-11
Vinodh Cuppu
No

This patch draws vertical line markers at 3 defined
column locations. This might be useful as indendation
guides, etc.

This patch was generated using nedit sources from cvs
as of 02/09/03. To apply this patch,
* gunzip the patch file if it has a .gz extension
* cd to nedit directory
* patch -p2 < nedit-columnMarkers-v0_1.diff
* make

To define the column markers,
* run nedit after compiling with the patch and save
preferences and find nedit.columnMarker*: in .nedit
file and edit those entries
* or add "nedit.columnMarker1: 10",
"nedit.columnMarker2: 20", "nedit.columnMarker3: 30" to
the .nedit file. (replace 10, 20, 30 with the columns
you want. Set it to -1 if you dont want that column
marker drawn)

Lines are drawn using the foreground color of line
numbers. If lines need to drawn in a different color,
define the line numbers color to be that. (use
"nedit*text.lineNumForeground: black" or something in
your .Xdefaults file and remember to do a xrdb -merge
~/.Xdefaults)

If you are a user and find this useful, let me know how
it can be improved. If you are developer and can
suggest any hints on how this can be sped up, please
let me know.

If it doesn't work, then
* you are using proportional fonts
* or you are not using the same fixed-width font for
all of the displayed fonts
* or linenumbers foreground color is not set correctly

Discussion

  • Joachim Lous
    Joachim Lous
    2003-03-11

    Logged In: YES
    user_id=82866

    Nice. Obviously everyone would like a GUI for it as well, but
    but we all understand that is a lot more work than the feature
    itself. There might be a nice shortcut, though: For the next
    version, provide a separate column value that would
    mean 'follow the wrap margin'; preferably including making it
    invisible if wrapping is off.

    That would provide an almost-complete 'free' GUI to the most
    common use case, only lacking the actual enable/disable
    switch which wouldstill be a resource. And to fix sthat one
    would only need a single checkbox in the wrap dialog.

     
  • Thorsten Haude
    Thorsten Haude
    2003-03-11

    Logged In: YES
    user_id=119143

    I want this!! Where is the patch??

     
  • Vinodh Cuppu
    Vinodh Cuppu
    2003-03-12

    v0.1 of patch. prototype functionality

     
  • Vinodh Cuppu
    Vinodh Cuppu
    2003-03-12

    Logged In: YES
    user_id=730969

    Fixed compile warnings that Thorsten Haude pointed out. Also
    fixed bug with markers not getting drawn if "show line
    numbers" is turned off. since the color settings of line
    numbers is used to draw the markers.

    Patch instructions from before still hold.

     
  • Vinodh Cuppu
    Vinodh Cuppu
    2003-03-13

    Thorsten's hairline at wrap margin patch

     
  • Vinodh Cuppu
    Vinodh Cuppu
    2003-03-13

    Logged In: YES
    user_id=730969

    Uploaded Thorsten Haude's hairline at wrap margin patch
    (hairline.2003-03-12.diff). This patch draws a hairline when
    a wrap margin is defined from Preferences->Wrap
    Margin->Margin for Wrap and Fill.

     
  • Thorsten Haude
    Thorsten Haude
    2003-03-13

    Logged In: YES
    user_id=119143

    Note that there is a line marked as C++ comment in
    hairline.2003-03-12.diff.gz. If your compiler would choke on
    this, you have to replace this with C comments.

    The line in question is still in doubt, I use a C++ comment
    to garuantee that this will be noticed.

     
  • Vinodh Cuppu
    Vinodh Cuppu
    2003-03-18

    Logged In: YES
    user_id=730969

    Merged in Thorsten Haude's hairline patch. When a wrap
    margin is set and wrap type is set to "Auto Newline" or
    "Continuous", a marker is drawn at the wrap margin. When
    wrap type is set to "no wrap", the line will not be drawn.
    There is a new radio button in Pref->Wrap->Wrap Margin,
    which turns on/off this feature.

    Fixed bug with marker lines not getting drawn when the
    cursor is on that column.

     
  • Thorsten Haude
    Thorsten Haude
    2003-03-18

    Logged In: YES
    user_id=119143

    Some coments:

    I would really like to see the wrap hairline whenever the
    wrap margin is set. Even is no automatic wrapping is done,
    the margin would be used for the Fill Paragraph function.
    In general, there must be some reason why the margin is set
    with no automatic wrapping.
    (Not even showing it at width of window would be pointless,
    though I would personnally not like it.)

    We agree that the line number's color is the natural choice
    for a hairline; however, now that there are two distinct
    functions (wrap margin and, err, everything else) it would
    seem natural to have more than one color. Yes, I know, not
    easily done, and since I will probably only use the wrap
    line, I won't try.

    Everything else is great, you found the best place for the
    pref widget.

     
  • Vinodh Cuppu
    Vinodh Cuppu
    2003-04-13

    Logged In: YES
    user_id=730969

    Uploaded nedit-columnMarkers-v0_3.diff.gz (version 0.3)
    Update to show wrap margin. Replaced check box with pull
    down menu with following entries : never, always and when
    wrap is enabled.

    'Never' will turn off showing the wrap margin. 'Always' will
    draw the vertical line at the wrap margin irrespective of
    wrap style (including no wrap). 'When wrap is enabled' will
    draw the vertical line when wrap style is set to auto
    newline or continuous.

     
  • Vinodh Cuppu
    Vinodh Cuppu
    2003-04-13

    Logged In: YES
    user_id=730969

    nedit-columnMarkers-v0_3.diff.gz was generated against CVS
    HEAD of 04/13/03.

     
  • Vinodh Cuppu
    Vinodh Cuppu
    2003-04-23

    Logged In: YES
    user_id=730969

    Uploaded nedit-showWrapMargin-v0_1.diff.gz (against CVS head
    04/17/03). This patch has the "show wrap margin" feature
    with it's own color preference (nedit.wrapMarginForeground).

    Fixes bug in v0.3 of columnMarkers patch where turning on
    line numbers would un-display wrap margin.

     
  • Thorsten Haude
    Thorsten Haude
    2004-10-02

    Logged In: YES
    user_id=119143

    The wrap margin part of this commited.

     
  • Thorsten Haude
    Thorsten Haude
    2004-10-09

    Logged In: YES
    user_id=119143

    Cancel that last comment.