Hi All,
I would like to know if there is a way to tabify/untabify a portion of selected text? I know I can mark text and change the indentation with tab/shift tab and that will also delete tabs (if configured).
But it does only delete the tab on the start of the line before the first token. E.g. '-->token-->nextToken;' becomes '....token-->nextToken;' ('.' = one space, '-->' = one tab). I would like it to become '....token....nextToken;'.
How can I do that, only for a selection - not for the whole document.
Best Regards, Lars
Hey there,
Lars Paulsen wrote:
I would like to know if there is a way to tabify/untabify a portion of selected text? I know I can mark text and change the indentation with tab/shift tab and that will also delete tabs (if configured).
But it does only delete the tab on the start of the line before the first token. E.g. '-->token-->nextToken;' becomes '....token-->nextToken;' ('.' = one space, '-->' = one tab). I would like it to become '....token....nextToken;'.
How can I do that, only for a selection - not for the whole document.
You can customize the toolbar to add the Increase Indent and the Decrease Indent icons:
Edit -> Preferences -> Interface -> Toolbar -> Customize Toolbar
Click each of the icons in the left frame and then click the right arrow in the middle. If you don't like where they ended up on the toolbar, you can drag them to a different location.
Once those are in place, you can select any text and press either one of them to indent or remove the indent of all of the selected text by one tab for each click of the icon.
On 2017-08-26 10:26 AM, Lars Paulsen wrote:
Hi All,
I would like to know if there is a way to tabify/untabify a portion of selected text? I know I can mark text and change the indentation with tab/shift tab and that will also delete tabs (if configured).
But it does only delete the tab on the start of the line before the first token. E.g. '-->token-->nextToken;' becomes '....token-->nextToken;' ('.' = one space, '-->' = one tab). I would like it to become '....token....nextToken;'.
How can I do that, only for a selection - not for the whole document.
I've wanted that a few times as well. One reasonable way would be to change the `Document->Replace [tabs|spaces] with [tabs|spaces]` options to only affect the current selection if there is one. It just requires someone who cares enough to implement it :)
Regards, Matthew Brush
Le 26/08/2017 à 11:43, Matthew Brush a écrit :
On 2017-08-26 10:26 AM, Lars Paulsen wrote:
Hi All,
I would like to know if there is a way to tabify/untabify a portion of selected text? I know I can mark text and change the indentation with tab/shift tab and that will also delete tabs (if configured).
But it does only delete the tab on the start of the line before the first token. E.g. '-->token-->nextToken;' becomes '....token-->nextToken;' ('.' = one space, '-->' = one tab). I would like it to become '....token....nextToken;'.
How can I do that, only for a selection - not for the whole document.
I've wanted that a few times as well. One reasonable way would be to change the `Document->Replace [tabs|spaces] with [tabs|spaces]` options to only affect the current selection if there is one. It just requires someone who cares enough to implement it :)
Someone did a while ago and it made it in 1.26 already ;) https://github.com/geany/geany/pull/394
So, just select some lines and use that feature and it should do what you like. WFM at least :)
Cheers, Colomban
On 2017-08-26 12:00 PM, Colomban Wendling wrote:
Le 26/08/2017 à 11:43, Matthew Brush a écrit :
On 2017-08-26 10:26 AM, Lars Paulsen wrote:
Hi All,
I would like to know if there is a way to tabify/untabify a portion of selected text? I know I can mark text and change the indentation with tab/shift tab and that will also delete tabs (if configured).
But it does only delete the tab on the start of the line before the first token. E.g. '-->token-->nextToken;' becomes '....token-->nextToken;' ('.' = one space, '-->' = one tab). I would like it to become '....token....nextToken;'.
How can I do that, only for a selection - not for the whole document.
I've wanted that a few times as well. One reasonable way would be to change the `Document->Replace [tabs|spaces] with [tabs|spaces]` options to only affect the current selection if there is one. It just requires someone who cares enough to implement it :)
Someone did a while ago and it made it in 1.26 already ;) https://github.com/geany/geany/pull/394
So, just select some lines and use that feature and it should do what you like. WFM at least :)
Doesn't work here, internal spaces/tabs aren't replaced like the OP is asking about. That PR seems to only affect leading indentation and only when the whole line is selected.
Regards, Matthew Brush
It's fine for me that it requires to have the whole line selected. My tests revealed that "spaces to tabs" only replaces the leading spaces but "tabs to space" replaces all tabs with spaces (as wanted). So this seems to be a bit inconsistent.
Also it would be nice if I could put the action on the toolbar or the menu (e.g. under "edit/format). The menu would be my preferred solution as I am used to it from other IDEs/GUIs.
Looks like that the feature could be improved. Maybe I will do it sometime in the future, but not now.
Thanks for all help/answers!
Regards, Lars
On 26.08.2017 21:35, Matthew Brush wrote:
On 2017-08-26 12:00 PM, Colomban Wendling wrote:
Le 26/08/2017 à 11:43, Matthew Brush a écrit :
On 2017-08-26 10:26 AM, Lars Paulsen wrote:
Hi All,
I would like to know if there is a way to tabify/untabify a portion of selected text? I know I can mark text and change the indentation with tab/shift tab and that will also delete tabs (if configured).
But it does only delete the tab on the start of the line before the first token. E.g. '-->token-->nextToken;' becomes '....token-->nextToken;' ('.' = one space, '-->' = one tab). I would like it to become '....token....nextToken;'.
How can I do that, only for a selection - not for the whole document.
I've wanted that a few times as well. One reasonable way would be to change the `Document->Replace [tabs|spaces] with [tabs|spaces]` options to only affect the current selection if there is one. It just requires someone who cares enough to implement it :)
Someone did a while ago and it made it in 1.26 already ;) https://github.com/geany/geany/pull/394
So, just select some lines and use that feature and it should do what you like. WFM at least :)
Doesn't work here, internal spaces/tabs aren't replaced like the OP is asking about. That PR seems to only affect leading indentation and only when the whole line is selected.
Regards, Matthew Brush
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 27 August 2017 at 06:52, Lars Paulsen lars_paulsen@web.de wrote:
It's fine for me that it requires to have the whole line selected. My tests revealed that "spaces to tabs" only replaces the leading spaces but "tabs to space" replaces all tabs with spaces (as wanted). So this seems to be a bit inconsistent.
Also it would be nice if I could put the action on the toolbar or the menu (e.g. under "edit/format). The menu would be my preferred solution as I am used to it from other IDEs/GUIs.
Spaces to tabs outside the indents is more complicated, do you:
a) convert every occurrence of any number of spaces to a tab, b) convert only every occurrence of N spaces to tab and leave remainders and any number less than N c) convert spaces only where they cross a tabulation point (position that is a multiple on N characters) leaving others as spaces so hopefully maintaining alignment d) probably other options I havn't thought of
No one option is what everybody wants to do, and the use-cases are usually short term (eg convert a code base once) so nobody has considered it worth the effort to add the feature. Same argument for tabs to spaces ignoring non-indents, possibly useful (eg tab separated data files) but not used enough to warrant the effort.
Cheers Lex
Looks like that the feature could be improved. Maybe I will do it sometime in the future, but not now.
Thanks for all help/answers!
Regards, Lars
On 26.08.2017 21:35, Matthew Brush wrote:
On 2017-08-26 12:00 PM, Colomban Wendling wrote:
Le 26/08/2017 à 11:43, Matthew Brush a écrit :
On 2017-08-26 10:26 AM, Lars Paulsen wrote:
Hi All,
I would like to know if there is a way to tabify/untabify a portion of selected text? I know I can mark text and change the indentation with tab/shift tab and that will also delete tabs (if configured).
But it does only delete the tab on the start of the line before the first token. E.g. '-->token-->nextToken;' becomes '....token-->nextToken;' ('.' = one space, '-->' = one tab). I would like it to become '....token....nextToken;'.
How can I do that, only for a selection - not for the whole document.
I've wanted that a few times as well. One reasonable way would be to change the `Document->Replace [tabs|spaces] with [tabs|spaces]` options to only affect the current selection if there is one. It just requires someone who cares enough to implement it :)
Someone did a while ago and it made it in 1.26 already ;) https://github.com/geany/geany/pull/394
So, just select some lines and use that feature and it should do what you like. WFM at least :)
Doesn't work here, internal spaces/tabs aren't replaced like the OP is asking about. That PR seems to only affect leading indentation and only when the whole line is selected.
Regards, Matthew Brush
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users