the source code display right-margin indicator is off by 1 unit compared to VisualStudio and geany; their column index starts at index 1, CL's at zero. This affects both the vertical column indicator and status bar.
Is the 1-based source column index "correct", i.e. CL's zero-based index is a bug worth a fix, or is the 0-vs-1 index considered subjective? (rows definitely start at 1).
If it's a bug, is a fix preferable in ./LiteEditor/cl_editor.cpp or at a lower-level in ./patches/stc.cpp ?
cheers,
-- p
right-margin indicator column 0- or 1-indexed?
-
- CodeLite Expert
- Posts: 231
- Joined: Sat Nov 24, 2012 8:04 pm
- Genuine User: Yes
- IDE Question: c++
- Location: Los Angeles
- Contact:
right-margin indicator column 0- or 1-indexed?
main: Debian Jessie x64 + custom wxTrunk
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: right-margin indicator column 0- or 1-indexed?
I don't think that 0 based col is a bug. However, it should also reflect to the right margin indicator - this should be fixedpetah wrote:If it's a bug, is a fix preferable in ./LiteEditor/cl_editor.cpp or at a lower-level in ./patches/stc.cpp ?
A fix should go into cl_editor.cpp
the ./patches/* files are no longer used under linux (only windows/mac atm) and it will be removed in the next release of wxWidgets
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Expert
- Posts: 231
- Joined: Sat Nov 24, 2012 8:04 pm
- Genuine User: Yes
- IDE Question: c++
- Location: Los Angeles
- Contact:
Re: right-margin indicator column 0- or 1-indexed?
ok, just to be clear:
- the status bar text "ln, col" should remain unchanged
- the vertical line right-margin indicator should be nudged one unit to the right
If so I should have a fix shortly.
-- p
- the status bar text "ln, col" should remain unchanged
- the vertical line right-margin indicator should be nudged one unit to the right
If so I should have a fix shortly.
-- p
main: Debian Jessie x64 + custom wxTrunk
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: right-margin indicator column 0- or 1-indexed?
I tested gedit and it seems that COL should start from 1petah wrote:the status bar text "ln, col" should remain unchanged
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Expert
- Posts: 231
- Joined: Sat Nov 24, 2012 8:04 pm
- Genuine User: Yes
- IDE Question: c++
- Location: Los Angeles
- Contact:
Re: right-margin indicator column 0- or 1-indexed?
it's a grey area I think; Geany's col starts at 0 while nano's at 1 (don't have Windows up to test VS).
gcc reports an error at col 1 when putting a syntax error ("%") so I guess 1 does make more sense.
-- p
gcc reports an error at col 1 when putting a syntax error ("%") so I guess 1 does make more sense.
-- p
main: Debian Jessie x64 + custom wxTrunk
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: right-margin indicator column 0- or 1-indexed?
Also: clang API uses COL 1 + vim..
Eran
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Expert
- Posts: 231
- Joined: Sat Nov 24, 2012 8:04 pm
- Genuine User: Yes
- IDE Question: c++
- Location: Los Angeles
- Contact:
Re: right-margin indicator column 0- or 1-indexed?
been using this patch without problems for a few weeks but can't vouch for it 100% cause I'm not entirely clear which sources are run-time generated and the setval(obj->getval()+1) pattern looks disturbingly recursion-prone if it's not a strict MVC.
It never happened to me but pls double-check the patch before application.
cheers,
-- p
It never happened to me but pls double-check the patch before application.
cheers,
-- p
You do not have the required permissions to view the files attached to this post.
main: Debian Jessie x64 + custom wxTrunk
-
- CodeLite Expert
- Posts: 231
- Joined: Sat Nov 24, 2012 8:04 pm
- Genuine User: Yes
- IDE Question: c++
- Location: Los Angeles
- Contact:
Re: right-margin indicator column 0- or 1-indexed?
if the column numbering is still up for debate, here's a patch fixing only the right edge column position.
Btw many editors (like Geany) will exhibit the same bug if they're based on Scintilla/wxStyledTextCtrl.
cheers,
-- p
Btw many editors (like Geany) will exhibit the same bug if they're based on Scintilla/wxStyledTextCtrl.
cheers,
-- p
You do not have the required permissions to view the files attached to this post.
main: Debian Jessie x64 + custom wxTrunk