Improve block marking using arrow keys
Let's say we have a block of html code like this:
<p>
Some text that has a few lines that are approx 80-100 characters long.
</p>
and I want to block-mark this using the arrow keys. I start at the upper left corner (before <p>), shift+ctrl+down twice, and shift+ctrl+left once to get to the end of the first long text line. From here it’s fairly quick to go down a few lines to get to the bottom right corner of the block I want to mark, but, when I get to a line that is shorter the cursor jumps back left to the end of that line. This is especially annoying as the last line is always really short (</p>).
It would be a lot easier to mark blocks if the cursor simply moved straight down and ignored the length of lines. Currently I have to use the right arrow key to walk all the way out to column 100 manually, which is really slow.
Platform Information
Komodo Edit or IDE? Komodo IDE Komodo Version? 12 Operating System (and version)? MacOS Mojave 10.14.6
It seems the information in the status line is broken as well.

As seen in the picture the "Sel" only counts the columns that are present in the last line, the same for the "Col" number. As I continue to the right the counters stop when I pass the end of the bottom line.
I had a look at the code related to the status line and even though completely unrelated to the bug in question, may I suggest to apply this minor patch for the sake of readability:
KomodoEdit/src/chrome/komodo/content/statusbar.p.js
@@ -185,18 +185,12 @@
{
count += (selectionEnd - selectionStart);
selection.push(scimoz.getTextRange(selectionStart, selectionEnd));
}
}
selection = selection.join("");
- if (count) {
- // Just ensure the selection start and end are different,
- // otherwise we won't update the selection label below.
- // Note: it does not matter what the values are from here on.
- selectionEnd = selectionStart + 1;
- }
} else {
lineStart = scimoz.lineFromPosition(selectionStart);
//Components.interfaces.ISciMoz
if (selectionMode == scimoz.SC_SEL_LINES) {
// Line selection mode uses different settings from scimoz API
lineEnd = scimoz.lineFromPosition(selectionEnd);
@@ -210,13 +204,13 @@
lineEnd = scimoz.lineFromPosition(scimoz.positionBefore(selectionEnd));
}
count = selectionEnd - selectionStart;
selection = scimoz.getTextRange(selectionStart, selectionEnd);
}
- if (selectionStart != selectionEnd) {
+ if (count != 0) {
// character count
selectionLabel = lazy.bundle.formatStringFromName(
"selection.label", [selection.length], 1);
if (selection.length != count) {
// byte count
selectionLabel += lazy.bundle.formatStringFromName(
It seems the information in the status line is broken as well.
That might be related, definitely worth noting. Just a heads up, fixing this will likely need to come from the underlying component that is the editor, Scintilla, which is a third party C++ Library. If that's the column scintilla reports to us, we don't really have anyway to tell it that it's wrong. Still worth investigating but I want to try and explain that this issue isn't as simple as you might think.
may I suggest to apply this minor patch for the sake of readability
You'd need to submit a PR against the Komodo Edit code base with an explanation of what the patch resolves and at least a short vetting period where you used it and didn't notice an issue with it.
You'd need to submit a PR against the Komodo Edit code base with an explanation of what the patch resolves and at least a short vetting period where you used it and didn't notice an issue with it.
Ok, fair enough. I ran into some issues when building Mozilla. Created a new thread for that discussion: https://community.komodoide.com/t/failures-when-building-komodo-edit-from-source/4956