Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflow bug with indent type "tabs" and tab width over 1 #2810

Open
slowpeek opened this issue May 16, 2021 · 1 comment
Open

Reflow bug with indent type "tabs" and tab width over 1 #2810

slowpeek opened this issue May 16, 2021 · 1 comment
Labels

Comments

@slowpeek
Copy link

slowpeek commented May 16, 2021

Relevant settings:

  • long line marker = 72, enabled
  • indent type = tabs
  • tab width = 8
  • geany 1.37.1

I noticed C-j sometimes does nothing even though a line is well over the long line marker but adding some more chars to the line occasionally makes it work.

Reproduce (with the setting from above):

  • open new doc
  • insert 8 tabs
  • insert "a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a"
  • notice the cursor position is 127, but if you select everything it shows "sel: 71" in the status area
  • press C-j and notice nothing changes
  • insert a space
  • press C-j and notice it got reflowed nicely taking indentation into account.

To me the culprit is the following piece since it doesn't take tab width into account

geany/src/keybindings.c

Lines 2297 to 2302 in 41624c4

/* if this line is short enough, do nothing */
if (column > sci_get_line_end_position(editor->sci, start) -
sci_get_position_from_line(editor->sci, start))
{
return;
}

@elextr
Copy link
Member

elextr commented May 16, 2021

If somebody made a PR using sci_get_col_from_position() instead of just using the byte positions its likely to get accepted.

@ntrel ntrel added the bug label Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants