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

[RDY] Allow running random code on tabline clicks #3871

Merged
merged 6 commits into from
Feb 2, 2016

Conversation

ZyX-I
Copy link
Contributor

@ZyX-I ZyX-I commented Dec 20, 2015

Intended for status line plugins.

Ref vim-airline/vim-airline#369.

@ZyX-I ZyX-I added the enhancement feature request label Dec 20, 2015
@marvim marvim added the RFC label Dec 20, 2015
@ZyX-I
Copy link
Contributor Author

ZyX-I commented Dec 20, 2015

Note that double click will produce two function calls, so the second argument is rather useless. Fixing this is UI layer problem and out of scope of this PR. Vim has the same problem.

label, e.g.: %3Xclose%X. Use %999X for a "close current tab"
mark. This information is used for mouse clicks.
T N For 'tabline': start of tab page N label. Use %T or %X to end
the label. This information is used for mouse clicks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information → The information (or This piece of information)

"This information" is grammatically incorrect, as "information" is always plural in English.

@@ -4,6 +4,7 @@
#include "nvim/window.h"
#include "nvim/pos.h" // for linenr_T
#include "nvim/ex_cmds_defs.h" // for exarg_T
#include "nvim/screen.h" // for StlClickRecord
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed by buffer.h directly, shouldn't the various .c file(s) add this include explicitly? ("include-what-you-use")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed by buffer.h because buffer.h.generated.h is considered to be a part of it. AFAIR it was already discussed since declarations generator does not collect needed includes.

@justinmk
Copy link
Member

@ZyX-I This and other recent PRs failed because of luajit.org connection failures which only affected our builds (seems like they are blocking travis). Rebasing on master will fix this.

STL_HIGHLIGHT = '#', ///< Highlight name.
STL_TABPAGENR = 'T', ///< Tab page label nr.
STL_TABCLOSENR = 'X', ///< Tab page close nr.
STL_CLICK_FUNC = '@', ///< Click region start.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A full stop (period) at the end of sentence fragments or item lists is not meaningful or useful. Does clint require it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always write what can be considered sentences (absence of action is OK in Russian). Clint does not require this, but I omit a dot only in summaries (for them being taken as “topics”), and write dots otherwise.

@ZyX-I ZyX-I added RDY and removed RFC labels Feb 1, 2016
@ZyX-I
Copy link
Contributor Author

ZyX-I commented Feb 1, 2016

Ping.

@ZyX-I ZyX-I changed the title [RFC] Allow running random code on tabline clicks [RDY] Allow running random code on tabline clicks Feb 1, 2016
@justinmk
Copy link
Member

justinmk commented Feb 2, 2016

LGTM.

justinmk added a commit that referenced this pull request Feb 2, 2016
Allow running random code on tabline clicks
@justinmk justinmk merged commit 5308585 into neovim:master Feb 2, 2016
@justinmk justinmk removed the RDY label Feb 2, 2016
@ZyX-I ZyX-I deleted the tabline-clicks branch February 2, 2016 10:17
@ZyX-I
Copy link
Contributor Author

ZyX-I commented Feb 2, 2016

Oh, I forgot to update vim_diff.txt. Though I think I assumed this will be picked up by Vim because *line plugins are pretty popular.

@justinmk
Copy link
Member

justinmk commented Feb 2, 2016

Agreed. Though we will mention it elsewhere.

@justinmk
Copy link
Member

justinmk commented Feb 3, 2016

@ZyX-I coverity found this, which appears valid:

*** CID 135004:  Null pointer dereferences  (FORWARD_NULL)
/src/nvim/screen.c: 6226 in clear_tab_page_click_defs()
6220         for (long i = 0; i < tpcd_size; i++) {
6221           if (i == 0 || tpcd[i].func != tpcd[i - 1].func) {
6222             xfree(tpcd[i].func);
6223           }
6224         }
6225       }
>>>     CID 135004:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "tpcd" to "memset", which dereferences it.
6226       memset(tpcd, 0, (size_t) tpcd_size * sizeof(tpcd[0]));
6227     }
6228
6229     void screenclear(void)
6230     {
6231       check_for_delay(FALSE);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants