emacs-lsp / dap-mode

Emacs :heart: Debug Adapter Protocol
https://emacs-lsp.github.io/dap-mode
GNU General Public License v3.0
1.29k stars 181 forks source link

Hot to clear screen, display the full content of a variable, and resize the buffer window horizontally for dap-ui mode? #519

Open hongyi-zhao opened 2 years ago

hongyi-zhao commented 2 years ago

I'm trying to use the repl feature of dap-mode by the following setting:

(setq dap-auto-configure-features '(sessions locals breakpoints expressions repl controls tooltip)

But I found some problems that I don't know how to solve, as shown in the figure below:

image

To be more specific:

  1. How to clear screen in the dap-ui buffer?
  2. How to display the full content of a variable under the terminal of the dap-ui buffer?
  3. Hot to resize the buffer window horizontally?

Regards, HZ

yyoncho commented 2 years ago

For 1 use M-x comint-clear-buffer. For 2 I have to investigate more.

hongyi-zhao commented 2 years ago

Another issue: Unable to adjust the size of all buffer windows horizontally by dragging and dropping. I found some discussion here, but still can't figure out the solution.

yyoncho commented 2 years ago

There is treemacs-lock-width

hongyi-zhao commented 2 years ago

I've tried with the following configuration, but still can't solve the problem:

(use-package treemacs
  :config
  (setq treemacs-width-is-initially-locked nil)
  )
yyoncho commented 2 years ago

What is treemacs-width-is-initially-locked?

hongyi-zhao commented 2 years ago

For 1 use M-x comint-clear-buffer

Yes. It doesn't the trick. Thank you for letting me know this trick.

hongyi-zhao commented 2 years ago

What is treemacs-width-is-initially-locked?

`C-h o treemacs-width-is-initially-locked RET'

treemacs-width-is-initially-locked is a variable defined in ‘treemacs-customization.el’.

Its value is nil
Original value was t

Indicates whether the width of the treemacs window is initially locked.
A locked width means that changes it is only possible with the commands
‘treemacs-set-width’ or ‘treemacs-toggle-fixed-width’.

  You can customize this variable.
yyoncho commented 2 years ago

Then check the value of window-size-fixed in that buffer. If it is t you can use M-x debug-on-variable-change to find who is setting it to true. Also, there is treemacs-toggle-fixed-width to enable resizing.

hongyi-zhao commented 2 years ago

Then check the value of window-size-fixed in that buffer.

image

Also, there is treemacs-toggle-fixed-width to enable resizing.

Got the following message:

[Treemacs] There is no treemacs buffer in the current scope.

yyoncho commented 2 years ago

Did you try to call the command in the treemacs buffer? Did you inspect the value of the variable in treemacs buffer?

hongyi-zhao commented 2 years ago

I just put the point in the python code window, and then call treemacs-toggle-fixed-width. Now, I restart Emacs and then call the command again. Even the above message doesn't appear, but I still can't resize the window horizontally:

image

image

yyoncho commented 2 years ago

Then I don't know - setting window-size-fixed to nil in treemacs window on my side works fine.

hongyi-zhao commented 2 years ago

Got it. I figured out the following configuration, which is adapted from here:

(use-package treemacs
  :commands (treemacs
             treemacs-follow-mode
             treemacs-filewatch-mode
             treemacs-fringe-indicator-mode)
  :bind (("<f8>" . treemacs)
         ("<f9>" . treemacs-select-window))
  :init
  (when window-system
    (setq treemacs-width-is-initially-locked nil)
    (treemacs-follow-mode t)
    (treemacs-filewatch-mode t)
    (treemacs-fringe-indicator-mode t)
    (treemacs))) 

It seems the mouse must be put at specific locations on the separator bars to adjust the buffer window horizontal size, as shown below by the red circles:

image

To be more specific, if window size has been locked, only positions 3, 4, and 5 are usable for resizing, after unlocked with M-x treemacs-toggle-fixed-width RET, all positions are vaild.