GithubHelp home page GithubHelp logo

ruimaciel / mropes Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 62 KB

M's ropes library: a rope data structure library implemented in C

License: MIT License

CMake 6.42% C 93.58%
c90 rope data-structures string c rope-string

mropes's Introduction

M's ropes library

GitHub actions: master branch License Language Code size Downloads

M's ropes library: a rope data structure library implemented in C.

mropes's People

Contributors

ruimaciel avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nrootconauto

mropes's Issues

Issue with splitting

I have found a bug. It seems in mrope_split you favor pushing right side of the node first before pushing the left side. This is problematic because you do current_index += leaf_node->node.weight; which computes the relative index of the node on line rope.c:318 which acts on the first popped node(the right side). This has lead to some weird behavior as the index is relative to the left side. I have fixed this bug on one of my projects by replacing rope.c lines 248-259 with

                       if(branch_node->right != NULL) {
				error = mrope_stack_push(&node_stack,branch_node->right);
				if(error != MROPE_OK) {
					goto error_cleanup;
				}
			}
			if(branch_node->left != NULL) {
				error = mrope_stack_push(&node_stack,branch_node->left);
				if(error != MROPE_OK) {
					goto error_cleanup;
				}
			}

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.