Code Monkey home page Code Monkey logo

Comments (4)

orbitalquark avatar orbitalquark commented on June 26, 2024

from textadept.

merlindiavova avatar merlindiavova commented on June 26, 2024

I thought as much, for some reason, when the caret is within the block comments it reports buffer.current_pos as nil.

I'm using a Linux machine, will check later on my Mac

from textadept.

ClaudioGi avatar ClaudioGi commented on June 26, 2024

The current position is the distance in bytes of the caret position from the beginning of the currently viewed document starting with one. So no matter where in the code, the current position is 1 if the Caret is at the very beginning of the buffer or larger, but never nil.
Try to put following line at the beginning of the file (into the first line):

㑖㑖㑖㑖㑖

and then test which position is reported if you put the caret at the line end (press Ctrl+e and type 'buffer.current_pos` plus Enter. There are five characters behind the caret/cursor but the reported position will be 16 ( 1 + 5*3 bytes for the utf-8 code of the Unicode point of the character).

By the way: you can close the issue clicking on the appropriate button at the bottom of this page as the information provided up to now seem to have solved the problem you were facing.

from textadept.

merlindiavova avatar merlindiavova commented on June 26, 2024

Thanks @ClaudioGi and @orbitalquark

from textadept.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.