Notepad3 icon indicating copy to clipboard operation
Notepad3 copied to clipboard

About Preserve Caret Position

Open loomee opened this issue 3 years ago • 29 comments

translation text I use notepad3 to read TXT documents. I have a problem. I don't know if it's a bug. for instance:

  1. Open a TXT document, The caret is on the first line,
  2. Use the cursor keys (direction keys) to navigate to the tenth line,
  3. I accidentally pressed the spacebar,
  4. I closed notepad3,
  5. Notepad3 asks me if I want to save, I choose 'no'.
  6. When I opened the txt file again, The caret is on the first line, not the tenth.
  7. When I accidentally input any character, I use Ctrl + Z to return to the original state, Instead of closing notepad3 directly,
  8. When I open the txt document again, the caret can be in the correct position.
  9. If I enter any characters and I delete them, Then press Ctrl + s to save,
  10. When I open the txt document again, the caret can be in the correct position.
  11. If I enter any characters and I delete them, Then I close notepad3 directly. It asks me if I want to save it. I choose 'no'.
  12. When I reopened the txt document, the caret was not in the correct position, The situation is the same as in Article 6. above ? original text 我使用 Notepad3 阅读 txt文档。 我遇到一个问题,我不知道它是不是 bug。 比如说: 1、 打开某个 txt 文档, 插入符号处于第一行, 2、 使用 光标键 (方向键) 浏览到第十行, 3、 我不小心按了一下空格键, 4、 我关闭 Notepad3 , 5、 Notepad3 询问我是否要保存, 我选择 'no'。 6、 当我再一次打开那个 txt 文档时, 插入符号处于第一行,而不是第十行。 7、 当我不小心输入了任意字符,我使用 ctrl+z 回到原始状态, 而不是直接关闭 Notepad3, 8、 当我再一次打开那个 txt 文档时,插入符号可以在正确位置。 9、 如果我输入了任意字符,我又删除了它们, 然后按 ctrl+s 保存, 10、 当我再一次打开那个 txt 文档时,插入符号可以在正确位置。 11、 假如我输入了任意字符,我又删除了它们, 然后我直接关闭 Notepad3 ,它询问我是否保存,我选择 'no'。 12、 当我重新打开那个 txt 文档时,插入符号不在正确位置, 和第六条的情况相同。 以上 ?

loomee avatar Feb 06 '22 09:02 loomee

The caret position is only persisted (if this option is active) if document is saved. Do you ask for change request "preserve caret position always on closing document" ?

RaiKoHoff avatar Feb 07 '22 07:02 RaiKoHoff

@RaiKoHoff
I hope that no matter what I do, it always remembers the last caret position. Just like AkelPad. https://sourceforge.net/projects/akelpad/files/AkelPad%204/4.9.8/

loomee avatar Feb 07 '22 12:02 loomee

@RaiKoHoff
To avoid accidental input, I open the 'Notepad 3', press Alt + F, and choose the 'Read Only File Attribute', I hope this will prevent any characters from entering, However, it can still input characters, but it can't be saved. Why did I do this? Is to make the caret in the correct position. As long as there is no unexpected input, the position of the caret is correct. Remember the last position of the caret. You can continue next time you read. Sincerely

loomee avatar Feb 07 '22 15:02 loomee

As the name says: Read Only File Attribute sets the read only attribute of the file in the file system , so you can not save the document, independant from changes you are still able to do on loaded document. There is no switch to make a View Only Document (read only).

RaiKoHoff avatar Feb 09 '22 15:02 RaiKoHoff

@RaiKoHoff
Enable the read-only attribute in Notepad + +, which will prohibit any character input. I hope that after enabling the read-only attribute, Notepad 3, like Notepad + +, prohibits any character input. Note: instead of modifying the file attributes in the file manager, choose the read-only attribute in the Notepad menu.

loomee avatar Feb 10 '22 01:02 loomee

Maybe no good idea to synchronize Read Only File Attribute and Document View Only mode. I prefer two different switches (needs to add Document View Only switch) - if this is really needed. Some other opinions ?

RaiKoHoff avatar Feb 11 '22 17:02 RaiKoHoff

The caret position is only persisted (if this option is active) if document is saved. Do you ask for change request "preserve caret position always on closing document" ?

I hope that no matter what I do, it always remembers the last caret position. Why did I do this? Is to make the caret in the correct position.

Hi @Rainer, I don't think its a Read Only File Attribute issue ? I think @loome will be happy with Preserve Caret Position ticked, if the caret position is maintained not just with a save operation, but every time a document is opened and closed. 🤔

hpwamr avatar Feb 11 '22 18:02 hpwamr

@RaiKoHoff
Distinguish between reading mode and read-only property, it's a good idea. In read mode, remember the caret position automatically, used for reading next time.

loomee avatar Feb 12 '22 03:02 loomee

@hpwamr
I use a translator and everybody communication, there will be a meaning is not accurate, please forgive me. I use Notepad3 to read TXT, I have already checked Notepad3 remember the caret position in the menu. Without having an input, the position of the caret is correct. Next time you open the document can be read on. If having an input, then the caret position, it is not what I want. See the instructions in this subject. About read-only property or reading model, that in order to avoid unexpected input.

loomee avatar Feb 12 '22 03:02 loomee

that in order to avoid unexpected input.

Well in this case, undo exists and it does the job properly! 😉

hpwamr avatar Feb 12 '22 05:02 hpwamr

if the caret position is maintained not just with a save operation, but every time a document is opened and closed. 🤔

Without having an input, the position of the caret is correct.

Sorry for my mistake, I just checked and you're right the position of the caret is preserved in any case. 👍

hpwamr avatar Feb 12 '22 05:02 hpwamr

Distinguish between reading mode and read-only property, it's a good idea.

2022-02-12_165216


Hello @loomee ,

Feel free to test the "BETA/RC PortableApps", version "Notepad3Portable_5.22.212.1_beta.paf" or newer, see 1st list in issue #1129.

"Notepad3Portable BETA/RC PortableApps" version can be used with or without ".7z" extension.

Also, feel free to test the "BETA/RC Setup", version "Notepad3_5.22.212.1_beta_Setup" or newer, see the 2nd list in issue #1129.

Comments and suggestions are welcome... 😃

hpwamr avatar Feb 12 '22 16:02 hpwamr

Hello @loomee , Does this Document Read Only feature respond correctly to your request for a Read Only Mode? 🤔

hpwamr avatar Feb 16 '22 08:02 hpwamr

@hpwamr
Sorry to get back to you now. I experienced 'Notepad3Portable_5.22.214.1_beta'. 'Document Read Only' works fine. It avoids accidental typing. It can also automatically remember the position of the caret. It's the effect I want. Thank you very much!

loomee avatar Feb 16 '22 14:02 loomee

I don't know which way would be better. For example, when using AkelPad, if you encounter accidental input, When I close the program, it asks me if I want to save and I choose 'no' I opened that document again, and the position of the caret was the effect I expected. But when I use Notepad3, if I encounter accidental input, When I close the program, it asks me if I want to save and I choose 'no' I opened that document again, and the position of the caret was not the effect I expected. But now, the notepad3 has a reading mode (Document View Only mode), which can avoid accidental input, and there is no need to worry.

loomee avatar Feb 16 '22 14:02 loomee

Hello @hpwamr
I don't know if it is abnormal situation. I use the "Notepad3Portable_5.22.302.1_beta", I have enabled the document view-only, I accidentally Press the TAB-key, Notepad3 ask me: The document is locked for view only. Do you like to unlock it for editing? I choose to cancel, Or I press the esc-key. When I close notepad3, asked me if I save it. If I accidentally enter other characters, it do not.


thx

loomee avatar Apr 06 '22 06:04 loomee

I accidentally Press the TAB-key,

I confirm your finding. It seems to be a bug. 🤔

hpwamr avatar Apr 06 '22 08:04 hpwamr

@hpwamr Ok, and the other: About this dialog: "The document is locked for view only. Do you like to unlock it for editing?" Could add an option, (do not ask me next time). Or it play a sound, when the document is view-only, I accidentally pressed some keys.


Sincerely

loomee avatar Apr 06 '22 10:04 loomee

Hello @loomee ,

Feel free to test the "BETA/RC PortableApps", version "Notepad3Portable_5.22.830.1_beta.paf" or newer, see 1st list in issue #1129.

"Notepad3Portable BETA/RC PortableApps" version can be used with or without ".7z" extension.

Also, feel free to test the "BETA/RC Setup", version "Notepad3_5.22.830.1_beta_Setup" or newer, see the 2nd list in issue #1129.

Comments and suggestions are welcome... 😃

hpwamr avatar Aug 31 '22 05:08 hpwamr

Instead of showing the dialog, how about tool-tip popup, telling you to be in read-only doc mode ?

RaiKoHoff avatar Aug 31 '22 23:08 RaiKoHoff

Instead of showing the dialog, how about tool-tip popup, telling you to be in read-only doc mode ?

Maybe not a bad idea ? 👍 @loomee , @hfstar-duan, @jupester, What do you think about the @RaiKoHoff proposal ? 🤔

hpwamr avatar Sep 01 '22 05:09 hpwamr

Instead of showing the dialog, how about tool-tip popup, telling you to be in read-only doc mode ?

Maybe not a bad idea ? +1 @loomee , @hfstar-duan, @jupester, What do you think about the @RaiKoHoff proposal ? thinking Also can. However, I think it's good now. When you want to save the file, it is already prompted that it is a read-only file, and there is no need to add a pop-up window indicating that the file is read-only mode.

hfstar-duan avatar Sep 01 '22 05:09 hfstar-duan

Correction:

Instead of showing the dialog, how about tool-tip popup, telling you to be in read-only doc mode ?

It might not be a bad idea, but the dialog has the advantage of letting you turn off the display of the message again ? 🤔

hpwamr avatar Sep 01 '22 05:09 hpwamr

, telling you to be in read-only doc mode ?

In my humble opinion, the perfect solution is: a tooltip popup that tells you that you are in read-only document mode. In this pop-up window, an optional option is added, [Ignore this message prompt], if it is checked, this pop-up window prompt will be ignored.

hfstar-duan avatar Sep 01 '22 05:09 hfstar-duan

Correction:

Instead of showing the dialog, how about tool-tip popup, telling you to be in read-only doc mode ?

It might not be a bad idea, but the dialog has the advantage of letting you turn off the display of the message again ? thinking This is a good idea. The pop-up prompt window adds an optional checkbox for [Ignore this message prompt], which is perfect.

hfstar-duan avatar Sep 01 '22 05:09 hfstar-duan

Dialog changed in current beta, don't ask me again checkbox needs inversed OK/Cancel logic, so be aware of it. Alternates to dialog : Play Sound and/or show tooltip 🤔

RaiKoHoff avatar Sep 01 '22 08:09 RaiKoHoff

Dialog changed in current beta, don't ask me again checkbox needs inversed OK/Cancel logic, so be aware of it. Alternates to dialog : Play Sound and/or show tooltip thinking Okay, I'll take a look when the new beta comes out.

hfstar-duan avatar Sep 01 '22 09:09 hfstar-duan

Okay, maybe, when don't ask me again has been checked (means no feedback in case of typing while read-only mode active), playing a sound (if beeps are not disabled) would be a good idea ?

RaiKoHoff avatar Sep 01 '22 09:09 RaiKoHoff

Okay, maybe, when don't ask me again has been checked (means no feedback in case of typing while read-only mode active), playing a sound (if beeps are not disabled) would be a good idea ?

This is also a very good idea and scheme.

hfstar-duan avatar Sep 01 '22 10:09 hfstar-duan