dap-mode icon indicating copy to clipboard operation
dap-mode copied to clipboard

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

Open hongyi-zhao opened this issue 4 years ago • 13 comments

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

hongyi-zhao avatar Oct 07 '21 04:10 hongyi-zhao

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

yyoncho avatar Oct 07 '21 04:10 yyoncho

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.

hongyi-zhao avatar Oct 07 '21 04:10 hongyi-zhao

There is treemacs-lock-width

yyoncho avatar Oct 07 '21 04:10 yyoncho

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)
  )

hongyi-zhao avatar Oct 07 '21 04:10 hongyi-zhao

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

yyoncho avatar Oct 07 '21 04:10 yyoncho

For 1 use M-x comint-clear-buffer

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

hongyi-zhao avatar Oct 07 '21 04:10 hongyi-zhao

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.

hongyi-zhao avatar Oct 07 '21 04:10 hongyi-zhao

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.

yyoncho avatar Oct 07 '21 04:10 yyoncho

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.

hongyi-zhao avatar Oct 07 '21 05:10 hongyi-zhao

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

yyoncho avatar Oct 07 '21 05:10 yyoncho

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

hongyi-zhao avatar Oct 07 '21 05:10 hongyi-zhao

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

yyoncho avatar Oct 07 '21 05:10 yyoncho

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.

hongyi-zhao avatar Oct 07 '21 06:10 hongyi-zhao