Open seva0stapenko opened 4 years ago
I am persisting and restoring an editor view state, so maybe it should be part of it.
alt+z was intended to be an "in-memory" word wrap toggle.
There are better ways to configure permanent wrapping, via the "editor.wordWrap"
setting in user settings.
This is not part of the editor's view state because toggling a file via alt+z toggles its wrapping in all the editors where the file is open.
alt+z was intended to be an "in-memory" word wrap toggle.
There are better ways to configure permanent wrapping, via the
"editor.wordWrap"
setting in user settings.This is not part of the editor's view state because toggling a file via alt+z toggles its wrapping in all the editors where the file is open.
With all due respect, I don't see how word wrap state is different from unsaved changes to the document. "Dirty" status is attached to the document, it is propagated to all views over the document, and it is preserved on restart. For all practical purposes, unsaved changes can be considered in-memory. So, it's not clear why unsaved changes to the document can be preserved across restarts, and word wrap cannot. Also, editor.wordWrap seems to apply to all the documents in a workspace or globally, which is not the ask here.
This is one of many feature requests for a single use case: I am developing a textbased game. Roughly half the time, I'm developing TypeScript in a .ts file, and I want word wrap off by default. The other half of the time, I'm writing prose in a .twee file, and I want word wrap on by default. Defaulting word wrap to on provides no more convenience than defaulting to off. Currently, I manually turn on word wrap per tab. This is nice so long so I don't restart the editor and I don't close the tab. But I don't work in the same files every day so this functionality only helps me so much.
Currently, when VS Code is restarted (e.g. for extension update, or version update), open documents would lose their word wrap settings after restart. It would be very helpful, if word wrap state for an open documents is preserved.