You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gdscript-use-tab-indents does not make gdformat use spaces instead of tabs.
Fix
Changes in code
I think i fixed it. Here is my version of gdscript-comint-gdformat--run function:
(defungdscript-comint-gdformat--run (arguments)
"Run gdformat in comint mode.ARGUMENTS are command line arguments for gdformat executable.When run it will kill existing process if one exists."
(let ((buffer-name (gdscript-util--get-gdformat-buffer-name))
(inhibit-read-onlyt))
(when (not (executable-find gdscript-gdformat-executable))
(error"Error: Could not find %s on PATH. Please customize the gdscript-gdformat-executable variable" gdscript-gdformat-executable))
(with-current-buffer (get-buffer-create buffer-name)
(unless (derived-mode-p'gdformat-mode)
(gdformat-mode)
(buffer-disable-undo))
(erase-buffer)
(let* ((line-length (list (format"--line-length=%s" gdscript-gdformat-line-length)))
(indent-mode-arg (and (not gdscript-use-tab-indents) (list (format"-s %s" gdscript-indent-offset))))
(buffer (comint-exec (current-buffer) buffer-name gdscript-gdformat-executable nil (append line-length indent-mode-arg arguments))))
(set-process-sentinel (get-buffer-process buffer) 'gdscript-comint-gdformat--sentinel)
buffer))))
I added (indent-mode-arg (and (not gdscript-use-tab-indents) (list (format "-s %s" gdscript-indent-offset)))), and then appended it to comint-exec arguments.
Documentation
If gdscript-use-tab-indents is nil, it uses gdscript-indent-offset as a number of desired spaces, utilizing gdformat's -s --use-spaces=<int> option.
Examples
Using tabs
(setq gdscript-use-tab-indents t)
This configuration will call gdformat *some-args* *buffer-name*.
Issue
gdscript-use-tab-indents
does not makegdformat
use spaces instead of tabs.Fix
Changes in code
I think i fixed it. Here is my version of
gdscript-comint-gdformat--run
function:I added
(indent-mode-arg (and (not gdscript-use-tab-indents) (list (format "-s %s" gdscript-indent-offset))))
, and then appended it tocomint-exec
arguments.Documentation
If
gdscript-use-tab-indents
isnil
, it usesgdscript-indent-offset
as a number of desired spaces, utilizinggdformat
's-s --use-spaces=<int>
option.Examples
Using tabs
This configuration will call
gdformat *some-args* *buffer-name*
.Using spaces
This configuration will call
gdformat *some-args* -s 4 *buffer-name*
, where 4 is a value ofgdscript-indent-offset
.The text was updated successfully, but these errors were encountered: