Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elastic tabstops are not applied after npp start #9

Closed
tolot27 opened this issue Apr 19, 2023 · 15 comments
Closed

elastic tabstops are not applied after npp start #9

tolot27 opened this issue Apr 19, 2023 · 15 comments
Labels
bug Something isn't working question Further information is requested stale unclear if there is still a problem

Comments

@tolot27
Copy link

tolot27 commented Apr 19, 2023

Even if Elastic tabstops are enabled, they are not applied if a fresh instance of Npp is started. They are only applied after disabling and re-enabling it. It also does not work if "Automatically enable this profile when opening *.tsv files." is enabled in the profile settings and a I open a tsv file smaller than 1 MB with 264 lines (see screenshot).

image

@Coises
Copy link
Owner

Coises commented Apr 19, 2023

Thank you for your report.

I think I know what is happening, but I'm not sure. Bear with me, if you will.

Columns++ (like Notepad++) only saves its settings when you close Notepad++. If you have multiple instances of Notepad++ open, the various instances do not communicate with one another, and as each is closed, it overwrites previously saved settings with whatever settings it had. So if you change settings when you have multiple Notepad++ windows open, only the settings from the last window closed will be remembered.

For the time being, I've considered it "acceptable" to work that way, but in the longer term I need to come up with something more in line with users' expectations.

I am not sure if that explains everything you are experiencing, though. Would you be willing to try something?:

Close all instances of Notepad++ and open just one instance. In that one instance, open a .tsv file and make sure the settings are the same as you have above (Tabular profile automatic for *.tsv, General for profiles without a specific extension). If they're not the same, change them and click OK. Then close that instance. Then, use Notepad++ as you usually would (including multiple instances) and see if it behaves as expected.

Thank you for your patience. If it's the "known behavior" I described, I do plan to improve the way Columns++ handles multiple instances. If something else is (also) wrong, narrowing that down and excluding the known behavior will be very helpful.

@Coises Coises added question Further information is requested bug Something isn't working labels Apr 19, 2023
@tolot27
Copy link
Author

tolot27 commented Apr 19, 2023

I have just one instance of npp running (win x64 with c++ 0.2.1.7-alpha) and not multiple. If I enable elastic tabs, a tsv gets aligned correctly. If I close npp and open it again, it opens the last opened files but does not align it. Elastic tabstops are still enabled and profile settings are configured as shown above.

@Coises
Copy link
Owner

Coises commented Apr 19, 2023

Thank you for the clarification. This is definitely a bug... unfortunately, I haven’t been able to reproduce it here.

Can you tell me, when you open Notepad++ and the file is not aligned, if you switch to another tab (open a new, empty tab if there are no other tabs) and switch back, does it then align on its own? Or do you have to disable and re-enable Elastic tabstops to get it to work?

Again, thank you for your patience. Your help in identifying this problem is much appreciated.

@tolot27
Copy link
Author

tolot27 commented Apr 20, 2023

I could not reproduce it with Notepad++ v8.4.8 and will check the version on my computer at work, tomorrow.

@Coises
Copy link
Owner

Coises commented Apr 20, 2023

I could not reproduce it with Notepad++ v8.4.8 and will check the version on my computer at work, tomorrow.

Thank you so much for this. I haven't yet tested with older versions of Notepad++; knowing the version number of a version on which this error occurs will certainly help point me toward finding the cause of the misbehavior and improving the reliability of Columns++.

@tolot27
Copy link
Author

tolot27 commented Apr 23, 2023

The described bug occurs on both my work computers. Both are running Win10 x64 and Npp x64 but different versions (v8.4.6, v8.5.2).
My home computer runs on Win11. If I upgrade Npp to v8.5.2 it still works.

Does Cpp has any debug log which I can enable?

@Coises
Copy link
Owner

Coises commented Apr 23, 2023

And I'm running WIndows 10 here, 8.4.8 32 bit and 8.5.2 64-bit. So whatever it is, it doesn't seem related to either Windows version or Notepad++ version.

I don't (yet) have any sort of debug logging facility.

Can you tell me if this happens when you open a file in an already open instance of Notepad++, or only when the file opens during startup?

When this happens, if you scroll the file (e.g., Page Down and then Page Up), does it format correctly?

If you switch to another tab in the same instance (or Ctrl+N to open a new tab) and then switch back, does the file format correctly?

If you type a single Enter before the first character of the file (thus adding a blank line at the top), does it format correctly?

I apologize for so many questions... knowing these things will help me narrow the possibilities for what could be going wrong, so I can try to come up with a "test" version for you to see if it solves the problem. Thank you for your patience.

Is the set of other plugins installed on your work computers different from what's installed on your home computer?

@tolot27
Copy link
Author

tolot27 commented Apr 25, 2023

Can you tell me if this happens when you open a file in an already open instance of Notepad++, or only when the file opens during startup?

It happens in both cases.

When this happens, if you scroll the file (e.g., Page Down and then Page Up), does it format correctly?

No

If you switch to another tab in the same instance (or Ctrl+N to open a new tab) and then switch back, does the file format correctly?

No

If you type a single Enter before the first character of the file (thus adding a blank line at the top), does it format correctly?

Yes. It also formats correctly, if I execute File -> Reload from Disk

Is the set of other plugins installed on your work computers different from what's installed on your home computer?

No, only standard plugins and Cpp is loaded. I've disabled the standard plugins but it does not matter. I've also disabled 'Auto-indent' in the settings bot it does not matter, either.

It is also independent, if I have a blank session or a session with many different tabs.

I've also reverted all settings of Npp to the defaults but still no difference.

@Coises
Copy link
Owner

Coises commented Apr 25, 2023

Thank you very much for this information. I will look for a plausible cause for this fault and create a "test" version soon.

Coises added a commit that referenced this issue Apr 25, 2023
@Coises
Copy link
Owner

Coises commented Apr 25, 2023

I think that Version 0.2.2 might fix this. When you have time to try it, let me know if it works. Thank you!

If it's interesting to you: My hypothesis is that for unknown reasons, the messages from Notepad++ and Scintilla (the edit control used by Notepad++) that tell plugins when various things change must be arriving in a different order on some systems than on others. I made a guess at the most likely variation in order and made a change in the code that should make it work for either order. My guess could be wrong, though...

@Coises Coises added awaiting confirmation Waiting for confirmation that issue is resolved and removed question Further information is requested labels Apr 25, 2023
@tolot27
Copy link
Author

tolot27 commented Apr 26, 2023

Version 0.2.2 fixed the problem. Many thanks for it! :-)

@tolot27
Copy link
Author

tolot27 commented Apr 26, 2023

One Problem remains: If I switch between tabs, the rendering falls back to non-elastic tab stops except if the cursor is on the first line. Than you can see how it aligns right after tab switching.
If I click the mouse or move the cursor, it aligns immediately.

@Coises
Copy link
Owner

Coises commented Apr 26, 2023

If you know: Is this new with 0.2.2, or was it happening before, too?
Is this only on your work computers?

When you've switched tabs and the alignment is incorrect, if you switch to another application that covers the Notepad++ window and then switch back, does anything change?

I'm not sure how this could be relevant, but do you access your work computers remotely?

@Coises Coises added question Further information is requested and removed awaiting confirmation Waiting for confirmation that issue is resolved labels Apr 26, 2023
@tolot27
Copy link
Author

tolot27 commented Apr 26, 2023

If you know: Is this new with 0.2.2, or was it happening before, too? Is this only on your work computers?

I can't check this on my home computer because the original issue happens only on my work computers.

I'm not sure how this could be relevant, but do you access your work computers remotely?

No, directly.

Maybe, the problem has to do with the way, C++ maintains the view. Here is a screen cast showing the realignment after switching the tabs:

C__Users_Walter_Downloads_Viruses.scaffolds.tsv.-.Notepad++.2023-04-26.21-50-09.mp4

@Coises
Copy link
Owner

Coises commented Apr 28, 2023

I've been thinking about this, but so far I can't guess what could be wrong. Let me be sure I understand what is happening. Is all this correct?:

  1. When you switch to a tab with elastic tabstops enabled and the cursor is on the first line, the result is as shown in your video: all lines except the first are properly aligned when you switch, while the first line initially appears unaligned and then snaps into alignment in a fraction of a second, without you doing anything.
  2. When you switch to a tab with elastic tabstops enabled and the cursor is not on the first line, none of the lines in the file are properly aligned, and they stay that way until you click in the text area or move the cursor, which immediately causes all the lines to snap into alignment.
  3. This (1 or 2) happens every time you switch to a tab that has elastic tabstops enabled (not just the first time you switch to a particular tab after opening the file it holds).
  4. Your home computers never had any failure to align when opening files or switching tabs, and as far as you've seen, nothing changed for them between 0.2.1.7 and 0.2.2.

Did you notice whether this behavior also happened with 0.2.1.7 (after you once disabled and re-enabled elastic tabstops to make it work on a particular tab, if you then switched away from and back to the tab again) or if it's new with 0.2.2? (If you didn't notice or don't remember, don't re-install 0.2.1.7 just to check it... I'm just gathering information, not sure what will be the clue I need, so it isn't worth the trouble.)

Thank you again for your reports and your patience.

@Coises Coises added the stale unclear if there is still a problem label Aug 15, 2023
@Coises Coises closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested stale unclear if there is still a problem
Projects
None yet
Development

No branches or pull requests

2 participants