[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Indentation of current line or selected blocks in the code editor?
From: |
Torsten |
Subject: |
Re: Indentation of current line or selected blocks in the code editor? |
Date: |
Wed, 8 Nov 2017 21:56:56 +0100 |
On 08.11.2017 20:25, John W. Eaton wrote:
> The tree_print_code thing only works if there are no errors when parsing
> the code. Otherwise, you don't end up with a valid parse tree.
>
> Also, the parse doesn't generally preserve any whitespace, so as it is
> now, using the parse tree to format the code wouldn't just indent code,
> it would also do things like change spacing around operators and
> reformat code blocks.
>
> I think we need something that just indents and doesn't try to reformat
> everything and that will do a best-guess indentation even if there are
> some syntax errors.
>
> It might be easier to pipe the text to Emacs and ask the Octave mode to
> indent the line or region. :-)
>
> jwe
>
There is some smart indentation while typing
(octave_qscintilla::smart_indent). Maybe we can use parts of it for
"offline" adjusting the indentation.
Torsten
- Indentation of current line or selected blocks in the code editor?, John W. Eaton, 2017/11/07
- Re: Indentation of current line or selected blocks in the code editor?, Ben Abbott, 2017/11/07
- Re: Indentation of current line or selected blocks in the code editor?, Torsten, 2017/11/07
- Re: Indentation of current line or selected blocks in the code editor?, John W. Eaton, 2017/11/07
- Re: Indentation of current line or selected blocks in the code editor?, siko1056, 2017/11/07
- Re: Indentation of current line or selected blocks in the code editor?, John W. Eaton, 2017/11/08
- Re: Indentation of current line or selected blocks in the code editor?,
Torsten <=
- Re: Indentation of current line or selected blocks in the code editor?, John W. Eaton, 2017/11/08
- Re: Indentation of current line or selected blocks in the code editor?, John W. Eaton, 2017/11/14
- Re: Indentation of current line or selected blocks in the code editor?, Richard Crozier, 2017/11/14
- Re: Indentation of current line or selected blocks in the code editor?, Torsten, 2017/11/14