[New plugin] Columns++
-
@Coises said in [New plugin] Columns++:
If you wanted to replace, say, Definition: with Definition-n: where n is 1 for the first replacement and increments by 1 each time, you’d use:
Find what: Definition:
Replace with: Definition-(?=match):I tried it in the “Search in indicated region” window. It is replacing the strings for me visually with “Definition-(?=match):”. It’s somehow not resolving the instruction.
Besides, when I click on “Undo”, it performs two undos, so I cannot go back to the previous “Definition:” string list. -
@Thomas-Knoefel said in [New plugin] Columns++:
I tried it in the “Search in indicated region” window. It is replacing the strings for me visually with “Definition-(?=match):”. It’s somehow not resolving the instruction.
Almost certainly this is because I left out an important instruction: Regular expression must be selected in the Search Mode box. Formula replacements are only done in regular expression mode.
Besides, when I click on “Undo”, it performs two undos, so I cannot go back to the previous “Definition:” string list.
I can’t reproduce this, but I might not understand. You’re finding that after doing an action in Search in indicated region, using the Notepad++ Undo command reverts both the action from the dialog and whatever action you did previously?
Does this happen regardless of how you do the Undo command (toolbar, menu, Ctrl+Z) and regardless of whether the dialog is still open?
-
@Coises said in [New plugin] Columns++:
I left out an important instruction: Regular expression must be selected in the Search Mode box.
… yeah, with that it works!
@Coises said in [New plugin] Columns++:
You’re finding that after doing an action in Search in indicated region, using the Notepad++ Undo command reverts both the action from the dialog and whatever action you did previously?
That’s correct. It will jump back as if I had hit “Undo” twice. I suggest moving further discussions of these smaller issues to your Plugin’s issue list to avoid cluttering this thread.
PS: I did some additional tests and it played out that’s all fine with your Plugin. It was a misbehavior of N++. A new restart fixed the problem.
-
Columns++ version 0.7.3-alpha does not introduce any new features, but it fixes a couple potentially annoying misbehaviors:
-
Improved exception handling: Exceptions from the Scintilla C++ interface will now be passed to Notepad++ in a way that allows it to report them as such, and uncleared error status codes from outside Columns++ will no longer cause exceptions in Columns++.
-
An error in handling parentheses in regular expression replacement strings was fixed.
-
A design flaw that could cause formula substitutions in regular expression replacement strings to be misinterpreted as part of a special sequence (such as a $n capture group reference) was fixed.
-
-
Columns++ version 0.7.4-alpha fixes the Align numeric command and the Numeric aligned option of the Calculate… command to take into account numbers formatted as times, based on the settings in the Time formats dialog.
There are no other changes to the plugin. I updated the help, and added to the readme to mention a couple special cases where Columns++ can be useful even for documents that aren’t arranged in columns: search with numeric formulas in regular expression replacement strings and sorting using multiple columns or regular expression capture groups.
-
Columns++ version 0.8-alpha uses its own copy of Boost.Regex, rather than accessing the copy in Notepad++ through the Scintilla interface. The main reason for this is that the Scintilla interface doesn’t support access to capture groups beyond 9; but it also makes the code cleaner and, based on my limited tests, faster. Here’s the changelog, including that and other new features:
-
References in formulas and sort keys to regular expression capture groups beyond 9 work now.
-
When matching regular expressions in column selections or search regions, lookbehind assertions do not recognize any text beyond the boundary of the selection within the row or the segment of the search region in which a match is attempted. (In previous versions of Columns++, as in Notepad++, the text potentially examined by lookbehind assertions always extended to the beginning of the document.)
-
Changed the way Search in indicated region behaves when no region is indicated, nothing is selected and a search is initiated; if Auto set is checked (the default), the search region is set to the entire document. The old behavior (raising a dialog requesting a rectangular selection) may be obtained by unchecking Auto set.
-
Made some refinements in how find and replace strings in Extended search mode are processed, including fixes for potential bugs and adding \Uxxxxxx (note: capital U) accepting up to six hexadecimal digits to specify any valid Unicode code point.
-
Added dropdown arrows to the Count and Replace All buttons in Search in indicated region to support additional operations: Select All, Count Before, Count After, Select Before, Select After, Replace Before, Replace After and Clear History.
-
Regular expressions using \K will work for incremental find and replace in Search in indicated region providing focus does not leave the dialog between finding a match and replacing it.
-
Added an Align… command to the Columns++ menu to support aligning column text on any character, character string or regular expression.
Help has been updated.
-
-
Hi Sir,
I am getting a weird behavior in Columns++ > Elastic Tab Stops: the end of line chars get kinda of “narrowed down” (don’t know it it is the correct definition of such behavior) or they lose the last char of each couple (basically CRLF -> CL) when I activate Elastic tab stops. Disabling Ets eol chars return normal.
(Columns++ Installed version: 1.0.6)
Is it a feature/wanted behavior?Look at the screenshots:
-
@wonkawilly said in [New plugin] Columns++:
Is it a feature/wanted behavior?
It’s not so much a “feature” as a “known side-effect.”
In the Columns++ | Profile… dialog there is a setting:
Apply monospaced font optimizations (Yes, No or Best estimate)
and beneath that, a check box:
Don’t show expanded mnemonics for non-printing characters when monospaced.The defaults are Best estimate and checked.
Don’t show expanded mnemonics… only applies when the first setting is Yes, or when it is Best estimate and the best estimate is Yes.
What that setting does is to replace the reversed-type black boxes for non-printing characters, like BEL or NBSP, with a single
!
in a black box. The reason is that “monospaced font optimizations” depend on every character being the same width; they speed up processing in larger files if that is true, but things get even slower than they would be without the optimizations if there are characters (like the black blobs with control character mnemonics) that aren’t the same width as everything else.I don’t know why the CR and LF are converted to C and L instead of being an exclamation point, like all other non-printing characters, but that’s what happens. I know of no way to change that while still controlling the width of other non-printing characters.
Knowing that it’s not abnormal, if this still bothers you, there are two things you could do to avoid it:
-
If your files rarely or never contain non-printing characters (except end-of-line characters), you can uncheck Don’t show expanded mnemonics for non-printing characters when monospaced and the display of line-ending characters will return to normal.
-
I’ve recently discovered that monospaced font optimizations are only necessary if you do not have Use DirectWrite checked in the Notepad++ options at Settings | Preferences… | MISC.. Recent versions of Notepad++ default that setting to checked (it was unchecked when I first released Columns++). Starting with version 1.1, Columns++ will always use “No” as the Best estimate when DirectWrite is enabled. In version 1.0.6, if you have DirectWrite enabled, or if you never enable elastic tabstops on files that are large enough to make response sluggish, you could set Apply monospaced font optimizations to No.
The nature of the Plugins Admin in Notepad++ is that the plugins listing is only updated when Notepad++ is updated (and even then, with some lag, depending on how long it takes to finalize a release). In the Columns++ | Help/About… dialog you’ll find links to the “newest” and “latest stable” releases, which you can install directly. Right now, 1.0.6 is latest stable; newest, 1.1.1, incorporates the DirectWrite/Best estimate fix along with some other significant fixes and improvements. I expect to release a 1.1.2 version within a day or two. If all goes well that version will be promoted to stable in time to get it into the Plugins Admin list for the next release of Notepad++.
-
-
@Coises said in [New plugin] Columns++:
1.0.6
I understand it now, thank you so much for the explication.
-
@Coises Just moved to Notepad++ x64 and reevaluating my plugins.
The Elastic Tabstops part of Columns++ looks very good as a replacemnt/addition to Plugin Elastic Tabstops.There seems to be 1 thing missing, or I can’t find it:
“Selection Only”I use the current Elastic tabstops as a monospace font “text aligner” with “tabs to spaces” instead of tabs, so being able to restrict to “Selection Only” makes life simpler, otherwise it means placing in another document and copying back.
Will you be adding “Selection Only”?
Cheers Pete
-
@Pete-Run said in [New plugin] Columns++:
There seems to be 1 thing missing, or I can’t find it:
“Selection Only”I use the current Elastic tabstops as a monospace font “text aligner” with “tabs to spaces” instead of tabs, so being able to restrict to “Selection Only” makes life simpler, otherwise it means placing in another document and copying back.
Will you be adding “Selection Only”?
I don’t expect to add an option to align tabs only in the selection. I designed the Elastic tabstops feature to make it appear to the user that the entire document is always instantly aligned, while deferring some processing until needed to keep it responsive wherever possible. I think it would complicate processing a lot to have an option to work only on a selection; I’d have to be pretty convinced that there was a good reason for it.
I don’t follow your description of your use case. However, admittedly I haven’t used the Elastic Tabstops plugin much since it was rewritten and taken over by a new maintainer, then almost immediately abandoned. I used the old version quite a bit, but it blocked me from updating to 64-bit Notepad++.
Convert tabs to spaces on the Columns++ menu takes the selection into account if there is one. If you mean that you need to align tabs in a sequence of lines without regard to tabs elsewhere in the same document, that will usually happen automatically, unless you’ve chosen the Tabular profile or otherwise set Profile… | Line up elastic tabstops throughout entire document checked. The exception is if there is no intervening line without tabs between sections you want aligned independently; in that case, you could add a blank line just until you convert and then remove it again.
-
@Coises Many thanks for the prompt and informative response.
I found this here: https://github.com/dail8859/ElasticTabstops/releases
v1.3.1 Latest (this is the version I was running on NPPx32)
Add ability to ignore extensions
Rebuild for Notepad++ v7.7 64-bit compatibilityHowever, although it works on x32 bit, it gets access violation on x64.
I did notice this for v1.3
Changelog:
Limit updates to only the current view region. This can lead to a significant performance increase for large files such as TSV, or when doing Search/Replace. Note: that this may case columns to change sizes while scrolling.
Fix issue with specifying extensions
Fix tab widths for proportional fonts
Allow elastic tabstops to be calculated for files using spaces as indentationSo “Selection Only” was considered and impletmented as an improvement by the previous developer.
For my purposes I can manage with a bit of copy/paste, so thanks for the plugin
Cheers Pete
P.S. see next post for different suggestion. -
@Coises I have posted this separately as it is a related but different issue.
Image 1 shows normal tabbed lines with lines with NO Tabs.
Image 2 shows 1 “overly” elasticated, possibly as expected it treats the end of the no tab line as a tab position.
Image 3 shows “neatly” elasticated with blank lines inserted “around” simple “Text with NoTab lines”.So my request would be an option to “Elastically Ignore” lines with no tabs.
I could think of many situations where in 1 document Tabulated information is separated by some textual explanation/detail (e.g. the old * reference) that would not easily fit tabularly. Even many small tables.
In this instance I would then convert tabs to spaces, so I have a workaround; just adding extra blank lines, but that would take a long time for many small tables. I suspect a simple replace command would fix that though. I feel an addition to my macro coming on! Please do not think I am a programmer, despite being in IT since 1970, I’m now 75, my programming expertise ends at butchering other peoples “scripts” and tinkering with recorded macros, but great fun.
Thanks again for the plugin
Pete -
@Pete-Run said in [New plugin] Columns++:
So my request would be an option to “Elastically Ignore” lines with no tabs.
Columns++ | Profile… | Do not allow text following the last tab on a line to span columns. should not be checked for the example given.
(I would guess that you chose the built-in Tabular profile and then unchecked Line up elastic tabstops throughout the entire document. For mixed presentations like your example, Classic or General is usually a good starting place; Tabular is specifically most useful when the entire document is a single tab-separated-values table. Of course, you can use any combination of options you like, and save the them as a custom profile if desired.)
-
@Pete-Run said in [New plugin] Columns++:
I did notice this for v1.3
Changelog:
Limit updates to only the current view region. This can lead to a significant performance increase for large files such as TSV, or when doing Search/Replace. Note: that this may case columns to change sizes while scrolling.
[…]
So “Selection Only” was considered and impletmented as an improvement by the previous developer.I think you’re misremembering something. What is described in the changes you quoted was limiting analysis to the visible part of the file (plus, if I recall correctly, a few lines before and after). As noted, this caused the columns to change width when scrolling.
One of my design goals was to get as much as possible of the performance improvement without the visual jumps. To that end, I separate calculating the tab positions from applying them; it turns out actually applying the tab positions to each line is the slowest part of the whole process. So I calculate tab positions for the whole file, but only apply them as necessary: to the visible part and to anything enclosed in a rectangular selection (since rectangular selections don’t work as intended if the lines aren’t correctly laid out — another problem from the old implementation I wanted to avoid).
As far as I know, the dail8859 ElasticTabstops never had a “selection only” option. I think you might at some point have installed the mariusv ElasticTabstops which has this ini file option:
sel_only=1 or 0 (default 1)
; the active range for applying elastic tabstops will be the current selected lines or all the fileI still don’t quite understand your use case. What is it you are trying to do that would be easier if elastic tabstop positions were shown only for selected lines?
-
@Coises said in [New plugin] Columns++:
@Pete-Run said in [New plugin] Columns++:
So my request would be an option to “Elastically Ignore” lines with no tabs.
Columns++ | Profile… | Do not allow text following the last tab on a line to span columns. should not be checked for the example given.
AhHa, I am not sure that I understand “Do not allow text following the last tab on a line to span columns” but that works niceley, thanks.
I still don’t quite understand your use case. What is it you are trying to do that would be easier if elastic tabstop positions were shown only for selected lines?
I only occasionally use NPP for NPP shortcuts.xml, some Lua, AHK etc. I was brought up on IBM mainframe early Text editors and JCL etc, so I am at home with text editors so am happy to use it for text manipulation, especially when Ms Word macros are lacking.
My main gripe with tabs in textual situations is that they can “mess up/misalign” when copied between applications, hence my desire to sometimes use monospace fonts with spaces rather than tabs and of course in tables a word processor, but many situations do not afford tables.
So, thanks again for your Columns++ and Elastic Tabs which helps keep my text aligned in different scenarios.