-
-
Notifications
You must be signed in to change notification settings - Fork 121
Add config option for text wrapping in UI windows #456
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
base: master
Are you sure you want to change the base?
Conversation
Hi @chunned Thanks for creating this PR, I was testing this approach, and I found that some widgets such as Threads and Variables get messy, Is there a possiblity to configure the wrapping in the layout section on the element level, such that there is more control on which widget is wrapping |
I don't believe that is possible, although I may be wrong. It looks like the layout settings are global. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested the folowing changes and they seem to work for me well, as I don't need other widgets to wrap. For example Threads and variables tend to get messy when they are wrapped
The solution would be to add wrap
to the layout elements and make changes to the layout.lua line 7
3 ---@class dapui.WinState
+7 ---@field wrap boolean
then apply the changes to the open function by adding the following changes
+33 for i, win_state in pairs(self.win_states) do
+41 if win_state.wrap then
+42 api.nvim_win_set_option(self.opened_wins[i], "wrap", true)
+43 end
at least the above changes are working for me very well, I am not an expert in lua perhaps you can figure out a way to integrate this changes nices and include docs, however default configs are not needed for other windows, may be the integrated terminal would be the best place for default wrap=true
as console logs tend to not wrap
winfixwidth = true, | ||
winfixheight = true, | ||
wrap = false, | ||
wrap = config.wrap, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this
I like the suggestions, I'll have a go at implementing them some time this week. I have a few questions:
|
unfortunately doing the following would cost you more coding since it will require you to draw wrapping from gobal config, as each layout represents a window in vim and each window is configured differently from
Note: I am not saying that it is not possible, it is doable and its a nice challenge. just dig into the init.lua |
This PR adds a new config option
wrap
that lets the user choose to wrap the text within the UI windows. Defaults tofalse
, the current default value.Fixes #435