dail8859 / elastictabstops Goto Github PK
View Code? Open in Web Editor NEWElastic Tabstops plugin for Notepad++
License: GNU General Public License v2.0
Elastic Tabstops plugin for Notepad++
License: GNU General Public License v2.0
The size of indentation tabs should be what is defined in:
Settings > Preferences > Language > Tab Settings > Tab size
First of all: thank you for your plugin. I find it very useful and use it very often for editing my debug outputs ;-) I use also the compare plugin very often and with this error they can't work together :-(
Now the error:
I debugged the code and could find the reason for this exception:
A NULL pointer access in main() - beNotified(const SCNotification *notify)
so, with:
"
if (notify == NULL || notify->text == NULL)
return;
"
at the beginning of the function and everything went OK
One very useful application of elastic tabstops is to vertically align code comments on the right hand side
At the same time it's also common to use tabs at the start of the line to visually show a nesting level — these don't need to be elastic, it's fine if this tab size is fixed (though the value of this fixed tab size is configurable)
However, these two conflict like so — try to insert ⭾
at line 4 before //
, it breaks the code alignment by making all the statements inside the while
loop jump to the comment level
static int get_nof_tabs_between(int start, int end) {
unsigned char current_char = 0; // comment1
int tabs = 0; // comment2
while (xx) { ⭾// inserting a tab here would make the lines below jump too far to the right
if (current_char == '\t') {
tabs++;
}
start = editor.PositionAfter(start);
}
return tabs;
}
Would it be possible to have and option to have two independent "alignment points" for Elastic Tabstops that shouldn't affect each other?:
Hey, I love the logo! ❤️ It's very pretty, and it suggest that this plugin does exactly what I need...
... i.e. enabling tab stops (not tabs) to be moved around, making the all the tabs longer of shorter, without replacing them with spaces. Just like in a Word-like editor (which I'm definitely not going to use for reading TSV files).
Automatically or manually, any of these 2 options would work for me. I just need to read TSV files. (No I'm not going to use a spreadsheet app either). The post at https://community.notepad-plus-plus.org/topic/13795/aligning-columns promises exactly that, automatically.
However, ElasticTabstops do not seem to do ANYTHING for me, and I also haven't found any documentation ANYWHERE 😭
Notepad++ v7.8.4. 32-bit
Please help!
Most likely introduced by 6f18e87
Not an Issue! Only humble suggestions for enhancements.
Hello Justin (Dail8859),
First of all THANK YOU for your outstanding contributions.
I use and enjoy your elastic tabs and your surround selection. Thanks!
I am using notepad++ v7.7.1 32 bit and Elastic Tabstops v1.3 32 bit.
Suggestion 'a': could we have a config option to use commas (",") or maybe "any" configurable char(s) as separator(s), (not only Tabs)?
With a configurable "separator char" i would be able to switch to commas and see a COMMA separated file as nicely as I get to see the Tab Separated files today.
Suggestion 'b': Very often, i need to "normalize" a CSV file. Meaning: surround each comma separated field and add opening and closing double quotes to it.
(repeat for each row, whoe file or in-selection).
Use Case: I receive a csv file where only a few fields are surrounded by (").
Only those that already contain a comma as part of the content text.
(I realize this is totally compliant with the CSV specs, but I deal with applications that are not smart enough to allow for it, and they require that all text fields in all rows be surrounded by double quotes).
So, I need to go over all rows adding the limiting double-quotes manually.
If a plugin could "normalize" the csv file content ensuring all fields are enclosed in ("), that would be really handy.
One more time: kudos and thank you for your contributions!
Marcelo Finkielsztein
[email protected]
In some cases it might be preferable to not have a dependency on another binary for Elastic tabstops functionality. Such cases can include either security related reasons (e.g. DLL trust or code review policies) or high level of on-the-fly customizability.
When going through the codebase I was wondering whether there is any functionality present that could not be implemented with LuaScript (another Notepad++ plugin). I realized then that author of LuaScript and ElasticTabstops is the same person.
Therefore let me first thank you (@dail8859) for extremely useful plugins. Before going down the path of implementing Elastic tabstops functionality in Lua, a quick assessment of whether this is feasible (and possibly how it would perform in best case scenario) would really help.
Great tool for notepad++. This in combination with selected highlight makes finding numbers in tables easier.
My problem is that when I loaded my file, the data wasn't aligned. The plugin showed as enabled by default. It started working once I opened the settings and changed the padding from 1 to 15 and saved the settings. Then all the tabs lined up, albeit with a large spacing. Then I changed the padding back to 1 and it still lined up. It seems to work fine now, but that first time it appeared it wasn't working until I did the steps above. I had tried to restart notepad++, but that had no affect at the time.
My guess is there is some problem that occurs the very first time you install.
I use this plugin and it does a lot for me working with symbolic files, I find myself sometimes that to separate a block of variables from another I insert a nop or a comment line.
this confuses the alignment.
Can I put a string not to be considered in the configuration file? example exclude ";;" or exclude "//"
Thank you
I refer to the 64 Bit version - since np++ 8.3 Elastic Tabstops is no more functional! Installed on np++ 8.2.1 or below, when updating to 8.3 or 8.3.3 the ET plugin is neither visible under Plugins Admin at tab Installed nor installable at tab Available. I checked the folder ElasticTabstops in the np++ plugins folder, everything is there as before, but np++ does not pay attentention to the plugin anymore, I had to downgrade to np++ 8.2.1 in order use it. Now I stick on 8.2.1.
I tried to open tsv file to check what this plugin is doing.
I opened a file and saw no difference with or without plugin (tried to enable/disable plugin from his menu).
Also, in my Notepad++ I have Settings -> Preferences -> Language -> Tab Settings -> Replace by space option enabled, and I thought that this could be the reason and this is!
So, reproducer:
When you'll start switching file tabs, you'll see no effect of elastic tabstops.
When you'll disable Replace by space option, and repeat last same actions, you'll see that elastic tabstops took their effect.
I think ElasticTabstops should be agnostic of Replace by space option =)
Details:
Since my update yesterdey to notepad++ V8.3.3 I can't see the ElasticsTabstop Plugin anymore
Not sure if interoperation with another plugin concerns you, but I occasionally use the Compare plugin (from the Plugin Admin) to compare two files.
When ending the comparison, using their Clear Active Compare menu option, I get a number of dialog popups, all saying:
Plugin Exception
----------------------
An exception occurred due to plugin: ElasticTabstops.dll
Exception reason: Access violation
For background: The Compare plugin appears to work by splitting the NPP window into two views (akin to right-clicking a tab and choosing Move to new View), so the two compared tabs are side-by-side, then shifting the content of both tabs so that matching lines are aligned next to each other. When choosing to Clear Active Compare, that process is reversed, so the shifting of text is is undone and the tabs are moved back to the same view.
I get an Access Violation popup for every "unshift" that has to happen. A block of text unshifts, the AV popup occurs, I click OK, and the next block un-shifts, etc.
It doesn't appear to be fatal, insofar as NPP will continue to run and, if I click through all the dialogs, both Compare and ETS continue to work. It's just annoying to click through those dialogs, especially if there are a lot of text blocks that need to shift/unshift.
I'm running ETS v1.3 and Compare v2.0.0, currently against NPP v7.8.2 (32-bit).
This would be a really handy feature. The default one-character width is a bit tight.
hi @dail8859
as ElasticTabstops manual installation support has been requested a few times, and it is a much liked plugin, would there be a possibility to add your releases to nppPluginList, or is there anything that could speak against a large scale distribution via plugins admin ?
many thanks and best regards.
I'm frequently doing regular-expression search and replace in files of hundreds to thousands of lines, which often involves Horizontal Tabulators \t
, but rarely more than 5 in a line. If Elastic Tabstops is enabled, even simple replacements and replacements that do not change tab positions at all take a very long time. Notepad++ regularly doesn't respond any more, sometimes even crashes.
I have for now made it a habit to turn off the plugin before hitting Ctrl+H
before and turn it on again after I've finished my replace operations, because I really enjoy working with elastic tabstops. This works reliably, so the culprit definitely is the plugin.
I'm using Windows 7, running the latest versions of the editor and the plugin as available from inside the plugin manager.
Since V7.7 of notepad++ (64bit) the plugin (V1.3) will not work properly. Tabstops are not "elastic" on the fly. I have to disable and then enable the plugin again, to get the tabstops will be "elastic".
Tested with 7.9 and 7.9.1 on Win10 x64. I just installed ElasticTabstops and immediately noticed this.
When I start up notepad++ with a tab-delimited file, the plugin makes everything look nicely aligned. The moment I switch to another file tab (even if I switch back) or reload the file, it reverts to the original un-aligned view. Disabling/re-enabling the plugin doesn't help. Newly opened files are also not aligned. If I "Move to new instance" or "Open in new instance" then I get the aligned view (at least initially) but "Move to other view" or "Clone to other view" don't.
I really love your plugin; it makes some of my work really easy!
I noticed that if the number of line in a file is greater than 94, there are some issues with the way the Elastic Tabstops appears. I've given a sample screenshot below with irrelevant data so you can see the issue. The file size is 100 lines of the exact same rows (data doesn't matter), and when you put your mouse at the 100th line and click to "Enable" Elastic Tabstops, it will look offset like in the screenshot.
I often use Alt-C with left mouse click to select column mode and insert needed tabs. But with this bug, after line 94, the alignment goes all wacky. The workaround is to put the mouse further down the file and disable and re-name Elastic Tabstops.
First of all, thanks for this plugin; it works really well and is a huge help!
Description of the Issue
Opening a large file (or simply tab switching to a large file) with the plugin installed is much slower than opening it w/o the plugin.
Steps to Reproduce the Issue
Notes
If I may suggest two solutions;
Thank you
This plugin would be even more useful when you include a convert option or a save/export feature to convert all the extended tabstops to a mixture of regular tabs (current tab settings) plus padding with spaces. So by using the same tab settings it would look everywhere the same. Now it's only usable with Npp.
Could you allow for extensions to be ignored, using a pattern of ! .ext1 .ext2 etc. or something similar? I want to use the elastic tabstops for all files except a few
When printing a text file that has been written with ETS enabled, the resulting printout does not align the tabs to the elastic column positions.
I have to remember to use the Convert to spaces function, then print, then CTRL+Z the conversion to spaces, and my memory for doing so seems to be failing me (especially the undoing after printing).
If you could add support for printing the tabs as they are displayed in the window (i.e. honoring the enabled/disabled state of ETS), that would certainly save me a headache!
I'm currently running ETS v1.3 against NPP v7.8.4 (32-bit), which I appreciate may be a bit behind the latest.
While this plugin is active, opening ≥ 5KB torrent file will make notepad++ not responding.
I think it's not happened before, but I can't find the safe version, so maybe just my imagination.
Windows 10 64 bit.
It would be helpful (for novices like myself) if the ReadMe explained what problem this plugin solves. Also, it would be nice for the ReadMe to explain briefly how to use the plugin.
Hello,
I just installed the plugin, but it seems it doesn't work for me...
Nothing has changed, the 'tab delimited file' is displayed the same as without the plugin...
Is there something I need to do? Plugin is enabled (in Notepad++ menu).
(I have Notepad++ v7.9.5 32-bit)
Unintended consequence of implementing this is that now long files with dramatic differences in line lengths nudge left and right like crazy when scrolling.
Could you make the plugin never go below the previously calculated column widths – in other words, make the table only grow, never shrink.
I made you a dummy file from some data I had that made this pretty obvious.
Platform: Windows 7 x64
Notepad++: 7.8 32-bit
Replaced DLL by 1.3.0 and works as expected.
When this plugin is enabled, Notepad++ returns several "Access violation" errors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.