Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Offset treats tabs as multiple tokens when calculating the offset/col?

    General Discussion
    2
    3
    1265
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Derek Altamirano
      Derek Altamirano last edited by

      I was using my favorite editor to help troubleshoot an issue in a file parser. I could not figure out why when I hit CTRL-G to to so the offset in the log it was taking me to the wrong place. The file is tab delimited, so I then realized when I was moving the cursor using the right arrow that when went past a tab the column counter jumped 3! I expected tabs to be considered a single token in the file.

      I realize there are probably other use cases where this behavior is useful, however when I go to a file offset I expect a tab to count as one “character”… Is there a way to alter this behavior?

      1 Reply Last reply Reply Quote 0
      • Jim Dailey
        Jim Dailey last edited by

        @Derek-Altamirano

        Perhaps if you set the tab size to 1 for the file type in which you are using Ctrl-G to go to the offset? See Settings->Preferences->Tab Settings

        You can always set it back to its “proper” value once you have fixed the issue(s).

        1 Reply Last reply Reply Quote 0
        • Derek Altamirano
          Derek Altamirano last edited by

          Useful suggestion, which is what I did. However this is annoying because I have to remember to go back and change the tab setting back when I am done. I think it might be useful for this to be a configurable setting… Either by file type or even better as a more general setting that could be toggled on or off.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors